我需要支付網關來使用eWay處理經常性的每月支付。我在eWay 註冊並收到沙盒客戶ID,沙盒用戶名,登錄URL。經常性月度付款eWay在php
我使用php(Codeignioter 2.1)。我有鏈接http://www.eway.com.au/developers/api/recurring。 但我不知道如何在我的PHP應用程序中使用。我有SoapClient函數使用soap庫嗎? 請用php舉一些例子。
在此先感謝。
謝謝, 但我stiill有幾個問題:
$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('[email protected]')
->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參數?
能否請你給我,我可以下載WebService的示例代碼定期付款,我使用XML API,但得到這個error'FailErrorInternal錯誤的鏈接:在根數據級別無效。第1行,位置1.' –