receive more response data in ci-merchant library codeigniter

流过昼夜 提交于 2020-01-05 12:02:27

问题


How can I receive more response data in the ci-merchant codeigniter library ?

I am using the Paypal Express checkout payment method.

And I am passing the following parameters:

$params = array( 'amount' => 100.00, 'currency' => 'USD', 'return_url' => my return url, 'cancel_url' => my cancel url );

Right now am getting just the following response

Merchant_paypal_api_response Object ( [_status:protected] => complete [_message:protected] => [_reference:protected] => 1K088384XU0947545 [_data:protected] => [_redirect_url:protected] => [_redirect_method:protected] => GET [_redirect_message:protected] => [_redirect_data:protected] => )

How can I get the data like paypal id, shipping address, item name and other stuff that paypal returns in the DoExpressCheckoutPayment response ?


回答1:


Actually, that info wouldn't come back in the DECP response. It would come back in GetExpressCheckoutDetails.

Your library should provide some way to see the RAW API requests and responses. If it's not parsing out all of the details for you you'll need to do that on your own.




回答2:


This isn't exactly an answer to your question, but you should try using Omnipay instead. Omnipay is basically CI-Merchant V2 (I'm the author of both libraries).

Omnipay lets you have direct access to the raw response. E.g. you would do something like this:

$params = array( 'amount' => 1000, 'currency' => 'USD', 'returnUrl' => 'my return url', 'cancelUrl' => 'my cancel url' );
$response = $gateway->completePurchase($params)->send();

$reference = $response->getTransactionReference(); // paypal transaction id
$data = $response->getData(); // this is the raw response object


来源:https://stackoverflow.com/questions/15434555/receive-more-response-data-in-ci-merchant-library-codeigniter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!