在ci-merchant库代码中接收更多的响应数据 [英] receive more response data in ci-merchant library codeigniter

查看:213
本文介绍了在ci-merchant库代码中接收更多的响应数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在ci商家代码指示器库中收到更多回应资料?

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

我使用Paypal快速结帐付款方式。

I am using the Paypal Express checkout payment method.

我传递以下参数:


$ params = array(
'amount' => 100.00,
'currency'=>'USD',
'return_url'=>我的返回网址,
'cancel_url'=>我的取消网址);

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

现在只得到以下回应


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]

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] => )

如何获取PayPal ID,送货地址,项目名称等PayPal在DoExpressCheckoutPayment响应中返回的数据?

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

推荐答案

这不是一个答案,但你应该尝试使用 Omnipay 。 Omnipay基本上是CI-Merchant V2(我是这两个图书馆的作者)。

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可让您直接访问原始回复。例如。你将会这样做:

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

这篇关于在ci-merchant库代码中接收更多的响应数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆