From #1864842-7: Add support for PayPal Express Checkout:
For the "Mark" flow, we need to improve our address options. SetExpressCheckout lets us pass in known addresses and also lets us tell PayPal whether or not to show things like shipping address prompts or to default them to the address we pass in instead of the address on file. We should take advantage of these options found at https://www.x.com/developers/paypal/documentation-tools/api/setexpressch....
Specifically, I'm talking about the NOSHIPPING and ADDROVERRIDE parameters and passing the shipping address in via the PAYMENTREQUEST_0_SHIPTO* parameters. Obviously this should only happen if the site actually collects shipping addresses and the order in question has one. For NOSHIPPING and ADDROVERRIDE we should add payment method settings letting the merchant toggle these features, but we should still allow for sites where some orders require shipping information and some don't.
Also, to reiterate, the "Mark" flow is the one where the customer has already filled out the checkout form on the Drupal Commerce site but then opted to pay via Express Checkout from the payment methods selection list. We'd only want to submit these parameters if
$order->data['commerce_paypal_ec']['flow'] == 'mark'.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | commerce_paypal-Improve_our_address_options_in_SetExpressCheckout_requests_for_the_Mark_flow-1882520-2.patch | 4.07 KB | JulienD |
| #1 | screenshot 2013-01-17 à 10.09.47.png | 115.15 KB | JulienD |
Comments
Comment #0.0
rszrama commentedImproving formatting with a line break.
Comment #1
JulienD commentedHey
I provided settings on the payment method to allow the merchant toggle these features. Maybe some wording have to be changed and more precision have to be add (see the attached screenshot).
Currently I'm not able to submit these parameters only if the customer used the 'mark' mode, because I don't have the information in the commerce_paypal_ec_set_express_checkout() function. This function is used to generate a token and if it's a valid token, we fill out the $order->data['commerce_paypal_ec'] array (see the code below). The solution would be to pass the mark information to the commerce_paypal_ec_set_express_checkout() ?
Comment #2
JulienD commentedComment #3
rszrama commentedGreat, thanks for the patch. Looking through it, I began to realize that we could simplify how we set the parameters by basing our checks around whether or not the Shipping module actually existed on the site. If it doesn't, we simply won't prompt for shipping at all. If it does and there's an address, we pass that in and let the admin determine whether or not we should allow the address to be changed at PayPal (turns out the parameters were inconsistent with the documentation, btw). If it does and there's no address, then we ask for one unless the administrator has said not to do so at all.
Commit: http://drupalcode.org/project/commerce_paypal.git/commitdiff/14c780c
Comment #4.0
(not verified) commentedFixing a tag.