spree-contrib / better_spree_paypal_express

A better Spree PayPal Express Extension.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
110 stars 269 forks source link

PayPal Express User Details Filled In #103

Closed alexstoick closed 11 months ago

alexstoick commented 10 years ago

In the pay_pal_express.rb in the purchase method the response that comes back from Paypal also has the user's email,name and shipping address so we could fill those in the order for them. Problem is, at the moment the class returns a "hacky" class if the purchase was successful, so subclassing it it's of no help. At the same time decorating the class would mean copying over the whole function and inserting one line, which is messy again.

Is there anything that can be done to either pass the object around, or implement this kind of behaviour?

radar commented 10 years ago

@alexstoick Aren't those details already filled out by the stage the user chooses to checkout with PayPal? Wouldn't it only make sense to have this happen at the beginning of the checkout?

jhawthorn commented 10 years ago

It would be possible to implement something like this. I started doing so but quickly decided against it.

Spree needs to know the shipping address before the payment spec (in order to calculate shipping rates), and getting billing addresses from paypal is a nuisance (have to contact paypal support to enable the feature). I've proposed #109, which instead removes the address prompt from the paypal interface.