我需要支付网关来使用 eWay 处理每月定期付款。我在 eWay 注册并收到了 Sandbox 客户 ID、Sandbox 用户名、登录 URL。
我使用 php(Codeignioter 2.1)。我在http://www.eway.com.au/developers/api/recurring有链接。但我不知道这在我的 php-app 中是如何使用的。我是否可以使用带有 SoapClient 功能的肥皂库?请举一些php的例子。
提前致谢。
谢谢,但我仍然有几个问题:
$eWay = new eWay('REAL_TIME_CVN', TRUE); // Which must be this parameter if I use sandbox for testing ?
$eWay
->setCustomerID('87654321') // Is it customer ID I recieved when I registered at eWay site ?
->setCardNumber('4444333322221111') // Is this parameter and parameters below are data of User(not customer above) who pays money to Customer above ?
->setCardHoldersName('John Smith')
->setPaymentAmount(1.00)
->setCardExpiry('08', '09')
->setCVN('123')
->setCustomerFirstName('Firstname')
->setCustomerLastName('Lastname')
->setCustomerEmail('name@xyz.com.au')
->setCustomerAddress('123 Someplace Street, Somewhere ACT')
->setCustomerPostcode('2609')
->setCustomerInvoiceReference('INV120394')
->setCustomerInvoiceDescription('Testing')
->setCustomerTransactionReference('4230')
->setOption1('Option Number One')
->setOption2('Option Number Two')
->setOption3('Option Number Three')
;
$eWay->pay(); // I do not have to pay, but I have to verify if payment is made monthly. Which menthod have I to use?
在 eWay 类中,我找到了 loadPaymentResponse 方法的定义:
public function loadPaymentResponse($response_string)
{
$response = simplexml_load_string($response_string);
$this->transactionError = (string) $response->{'ewayTrxnError'};
$this->transactionStatus = (string) $response->{'ewayTrxnStatus'};
$this->transactionNumber = (string) $response->{'ewayTrxnNumber'};
$this->transactionReference = (string) $response->{'ewayTrxnReference'};
$this->transactionAmount = (string) $response->{'ewayReturnAmount'};
$this->transactionAuthNumber = (string) $response->{'ewayAuthCode'};
$this->transactionOption1 = (string) $response->{'ewayTrxnOption1'};
$this->transactionOption2 = (string) $response->{'ewayTrxnOption2'};
$this->transactionOption3 = (string) $response->{'ewayTrxnOption3'};
$this->transactionBeagleScore = (string) $response->{'ewayBeagleScore'};
if(preg_match('/^\d{2}/', $this->transactionError, $code))
{
$this->responseCode = $code[0];
}
}
但是 $response_string 参数是什么?