Closed alexstoick closed 11 months 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?
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.
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?