lzerma/rede-gateway

基于 Rede 平台的支付网关。

dev-master 2015-04-04 00:25 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:05:05 UTC


README

Build Status Code Climate

支付网关 - E-Rede

此模块提供了与支付网关 E-Rede 通信的接口。

要使用此库,您需要安装,可以通过GitHub或使用 composer。

要使用 composer,编辑您的 composer.json 并添加以下行

"lzerma/rede-gateway": "stable"

安装库后,您可以使用设置一些对象来创建请求,然后发送到网关。

身份验证对象

// Auth object
$auth = new Authetication();
$auth->setAcquirerCode("1212121");
$auth->setPassword("###");

在这种情况下,我创建了一个新的对象,包含 收单代码 (由 E-Rede 提供)密码 (由 E-Rede 提供)

卡数据对象

// Card object
$card = new Card()

$card->setCardPan("0101010101010101");
$card->setCardExpiryDate("01/15");
$card->setCvc(123);

// In the CartTypes class, exists others methods for configure this object.
$card->setCardMethod(CardTypes::$CARD_TXN_METHOD_AUTH); 

// Set card type operation (Credit ou Debit)
$card->setCardType(CardTypes::$CARD_CREDIT); 

// Country of transaction
$card->setCountry("Brazil"); 

上述代码创建了一个新的卡对象,包含许多信息,如卡号、卡有效期、卡安全码等。您可以在此处找到所有参数的列表。

要在您的集成中使用 Boleto,您必须编写以下代码

// Boleto object
$boleto->setFirstName("Lucas");
$boleto->setLastName("Zerma");
$boleto->setBillingStret1("No name street, n/a number");
$boleto->setExpiryDate('2013-05-01');
$boleto->setCustomerEmail("lzerma[at]gmail[dot]com");
$boleto->setCustomerIp(192.168.1.1);
$boleto->setInstructions("Few instructions for the bank employer.");
// Here you can set which processor bank you work. A list of all you find on the respective class. 
$boleto->setProcessorId(\Rede\Gateway\Types\Boleto::$PROCESSOR_BANCOBRASIL);

这些代码配置了一个对象,包含发送到网关 e-rede 的 Boleto 请求的所有信息。

ps:上述属性仅是必需属性,您可以在此处找到所有属性的列表。