1

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 ?

Vinay B
  • 63
  • 1
  • 8

2 Answers2

0

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.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • Oh yeah sorry. You are right. DECP doesn't give that data, my mistake. I checked that later. But I wasn't able to find anywhere in the library how to retrieve the GetExpressCheckoutDetails response. The library is just making the SetExpressCheckout and the DoExpressCheckoutPayment calls but not the GetExpressCheckoutDetails. I am not able to find it. I guess I will keep looking for it otherwise would just have to write my custom code as I need those details. I just thought if it was available it would be a little easier. – Vinay B Mar 16 '13 at 04:53
  • Ah I checked the library properly, it's not making a call to GetExpressCheckoutDetails but directly calling the DoExpressCheckoutpayment. I guess I need to make my own custom call. Thanks for your help. – Vinay B Mar 16 '13 at 05:48
0

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
Adrian Macneil
  • 13,017
  • 5
  • 57
  • 70