【问题标题】:CodeIgniter Payments Getting a Success Response but not WorkingCodeIgniter Payments 获得成功响应但无法正常工作
【发布时间】:2012-05-22 20:13:03
【问题描述】:

我正在使用 CodeIgniter Payments 与 Paypal API 集成。我相信我调用了正确的方法,因为我得到了“成功”的响应,但我没有在沙盒中看到交易。当我使用 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
    )
)

【问题讨论】:

    标签: codeigniter paypal


    【解决方案1】:

    您可以直接切换到使用其他 Paypal 库。与解决这个问题相比,它可能会节省您的时间。 http://codeigniter.com/wiki/PayPal_Lib

    【讨论】:

      【解决方案2】:

      我也有这个问题。

      就我而言,我没有正确设置我的配置驱动程序,它最终将我的所有交易发送到 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);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-02-05
        相关资源
        最近更新 更多