2013-06-04 63 views
1

我需要支付網關來使用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參數?

回答

1

eWAY在我們的合作伙伴門戶中有兩個PHP樣本可用於定期付款。一個樣本用於循環的XML版本,第二個用於Web服務版本,這是首選和更廣泛部署的API集成。

WebService示例是圍繞NuSOAP構建的,並且lirbaries也包含在示例代碼中。您可以從我們的合作伙伴門戶網站下載樣品,如果您有任何問題,請隨時通過電子郵件[email protected]或訪問www.eway.com.au和 與我們的技術支持團隊發起實時聊天會話。

+0

能否請你給我,我可以下載WebService的示例代碼定期付款,我使用XML API,但得到這個error'FailErrorInternal錯誤的鏈接:在根數據級別無效。第1行,位置1.' –