在PHP中重复每月付款eWay

时间:2013-06-04 12:31:50

标签: php payment recurring

我需要支付网关来使用eWay处理定期的每月付款。我在eWay注册了 并收到Sandbox客户ID,沙箱用户名,登录URL。

我使用php(Codeignioter 2.1)。我在http://www.eway.com.au/developers/api/recurring处有链接。 但我不知道在我的php-app中如何使用它。我是否要使用具有SoapClient功能的soap库? 请举一些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参数?

0 个答案:

没有答案