0

Paypal API と統合するためにCodeIgniter Paymentsを使用しています。「成功」という応答が返ってきたので、正しいメソッドを呼び出していると思いますが、サンドボックスにトランザクションが表示されません。Paypal のサンプル DoDirectPayment ファイルを使用すると、トランザクションが完了し、サンドボックスで確認できます。

CodeIgniter Payments を使用したコードは次のとおりです。

//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
    )
)
4

2 に答える 2

0

私もこの問題を抱えていました。

私の場合、構成ドライバーを正しく設定しなかったため、すべてのトランザクションが Calvin (作成者) のデフォルトのペイパル サンドボックス アカウントに送信されてしまいました。

以下を使用して、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);
于 2012-06-07T20:22:56.507 に答える
0

他の Paypal ライブラリを使用するように切り替えることができます。この問題を理解するよりも時間を節約できます。http://codeigniter.com/wiki/PayPal_Lib

于 2012-05-24T03:53:59.827 に答える