2012-05-22 60 views
0

我正在使用CodeIgniter Payments與PayPal API集成。我相信我正在調用正確的方法,因爲我得到了「成功」的響應,但我沒有在沙盒中看到該事務。當我從PayPal使用示例DoDirectPayment文件時,我完成了交易,我可以在沙箱中看到它。CodeIgniter支付獲得成功響應但不工作

下面是使用笨支付我的代碼:

//load the payment library 
$this->load->spark('codeigniter-payments/0.1.4/'); 

//configure the parameters for the payment request 
$paymentParameters = array(
    'cc_type'  => 'foo', 
    'cc_number'  => 'foo', 
    'cc_exp'  => 'foo', 
    'first_name' => 'foo', 
    'last_name'  => 'foo', 
    'street'  => 'foo', 
    'street2'  => 'foo', 
    'city'   => 'foo', 
    'state'   => 'foo', 
    'country'  => 'foo', 
    'postal_code' => 'foo', 
    'amt'   => 'foo', 
    'currency_code' => 'USD' 
); 

//make the call 
$paymentResponse = $this->payments->oneoff_payment('paypal_paymentspro', $paymentParameters); 

//print the response 
print_r($paymentResponse); 

這裏是迴應:

stdClass Object 
(
    [type] => gateway_response 
    [status] => Success 
    [response_code] => 100 
    [response_message] => The authorization was successful. 
    [details] => stdClass Object 
    (
     [gateway_response] => stdClass Object 
      (
       [TIMESTAMP] => 2012-05-22T19:18:17Z 
       [CORRELATIONID] => 7939eeaa6c0c0 
       [ACK] => Success 
       [VERSION] => 66.0 
       [BUILD] => 2929894 
       [AMT] => 20.89 
       [CURRENCYCODE] => USD 
       [AVSCODE] => X 
       [CVV2MATCH] => M 
       [TRANSACTIONID] => 4RS01101TL8204042 
      ) 

     [timestamp] => 2012-05-22T19:18:17Z 
     [identifier] => 4RS01101TL8204042 
    ) 
) 

回答

0

我也有這個問題。

在我的情況下,我沒有正確設置我的配置驅動程序,它最終將我的所有交易發送到Calvin(作者)的默認PayPal沙箱帳戶。

仔細檢查,以確保您的API標記與正確設置:

$gateway_name = 'paypal_paymentspro'; 
$params = array(
    'identifier' => *Your transaction ID from above* 
); 
$response = $this->payments->get_transaction_details($gateway_name, $params); 
print_r($results); 

另外,如果你不想設置驅動程序想從你的PHP文件中所做的一切,你可以隨時通過你的API令牌如下:

$gateway_name = 'paypal_paymentspro'; 
$params = array(
    'identifier' => *Your transaction ID from above* 
); 
$config['api_username'] = *Your api username*; 
$config['api_password'] = *Your api password*; 
$config['api_signature'] = *Your sig*; 
$response = $this->payments->get_transaction_details($gateway_name, $params); 
print_r($results); 
相關問題