The issue:
- User fills in address A as billing info in Drupal.
- User checkout and redirected to external Paypal page, where user modified address to B.
- User redirected back to Drupal upon success, but order details still showing address A.

Seems like the order details created in Drupal is not updated from Paypal, is there any way to capture the updated billing info?

Comments

citlacom’s picture

Title: Update commerce billing info after returning from Express Checkout page » Paypal billing information mismatch
Component: Code » Miscellaneous
Category: feature » support

Hi 00qazs,

What you need is not currently implemented in this module although technically is possible with some development. This should happen in the function commerce_paypal_ec_redirect_form_submit that is called just after PayPal redirect the user to your site. Here we call the method GetExpressCheckoutDetails from PayPal API and you will get a long response:

Sample response of GetExpressCheckoutDetails call

[TOKEN] => EC-0XD79198TM341391U
[CHECKOUTSTATUS] => PaymentActionNotInitiated
[TIMESTAMP] => 2012-08-01T23:27:31Z
[CORRELATIONID] => 22eff73db22bd
[ACK] => Success
[VERSION] => 88.0
[BUILD] => 3386080
[EMAIL] => sample@sample.com
[PAYERID] => DVVM3ZLYXHYHJ
[PAYERSTATUS] => unverified
[FIRSTNAME] => Pablo
[LASTNAME] => Cerda
[COUNTRYCODE] => ES
[SHIPTONAME] => Pablo Cerda
[SHIPTOSTREET] => filipinas 717
[SHIPTOSTREET2] => 40 - 3 IZQ
[SHIPTOCITY] => Madrid
[SHIPTOSTATE] => Madrid
[SHIPTOZIP] => 28012
[SHIPTOCOUNTRYCODE] => ES
[SHIPTOCOUNTRYNAME] => Spain
[ADDRESSSTATUS] => Unconfirmed
[CURRENCYCODE] => EUR
[AMT] => 48.00
[ITEMAMT] => 48.00
[SHIPPINGAMT] => 0.00
[HANDLINGAMT] => 0.00
[TAXAMT] => 0.00
[DESC] => Order 384 at FlamencoTickets
[INVNUM] => 384-1343863484
[INSURANCEAMT] => 0.00
[SHIPDISCAMT] => 0.00
[L_NAME0] => Show with drink
[L_QTY0] => 2
[L_TAXAMT0] => 0.00
[L_AMT0] => 24.00
[L_ITEMWEIGHTVALUE0] => 0.00000
[L_ITEMLENGTHVALUE0] => 0.00000
[L_ITEMWIDTHVALUE0] => 0.00000
[L_ITEMHEIGHTVALUE0] => 0.00000
[PAYMENTREQUEST_0_CURRENCYCODE] => EUR
[PAYMENTREQUEST_0_AMT] => 48.00
[PAYMENTREQUEST_0_ITEMAMT] => 48.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 0.00
[PAYMENTREQUEST_0_HANDLINGAMT] => 0.00
[PAYMENTREQUEST_0_TAXAMT] => 0.00
[PAYMENTREQUEST_0_DESC] => Order 384 at FlamencoTickets
[PAYMENTREQUEST_0_INVNUM] => 384-1343863484
[PAYMENTREQUEST_0_INSURANCEAMT] => 0.00
[PAYMENTREQUEST_0_SHIPDISCAMT] => 0.00
[PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED] => false
[PAYMENTREQUEST_0_SHIPTONAME] => Pablo Cerda
[PAYMENTREQUEST_0_SHIPTOSTREET] => filipinas 717
[PAYMENTREQUEST_0_SHIPTOSTREET2] => 40 - 3 IZQ
[PAYMENTREQUEST_0_SHIPTOCITY] => Madrid
[PAYMENTREQUEST_0_SHIPTOSTATE] => Madrid
[PAYMENTREQUEST_0_SHIPTOZIP] => 28012
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => ES
[PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME] => Spain
[L_PAYMENTREQUEST_0_NAME0] => Show with drink
[L_PAYMENTREQUEST_0_QTY0] => 2
[L_PAYMENTREQUEST_0_TAXAMT0] => 0.00
[L_PAYMENTREQUEST_0_AMT0] => 24.00
[L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0] => 0.00000
[L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0] => 0.00000
[L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0] => 0.00000
[L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0] => 0.00000
[PAYMENTREQUESTINFO_0_ERRORCODE] => 0

Here you retrive the address that could be modified at PayPal payment form so is possible to map this info with the order fieldaddress and update accordingly. After the line:

$response = commerce_paypal_ec_api_call("GetExpressCheckoutDetails", $request_params, $settings);

Probably implementing a helper function that do the mapping and update of the address in the order.

jwilson3’s picture

Category: support » feature

Reclassifying this as a feature request.

jwilson3’s picture

Component: Miscellaneous » Code
jwilson3’s picture

Title: Paypal billing information mismatch » Update commerce billing info after returning from Express Checkout page

Doh, I edited the wrong field :/