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 uses billing address for the shipping address is this right? #80

Closed DangerDawson closed 10 years ago

DangerDawson commented 10 years ago

Looking at the following controller:

app/controllers/spree/paypal_controller.rb

It seems as thought the method address_options returns the billing address rather than the shipping address:

    def address_options
      {
        :Name => current_order.bill_address.try(:full_name),
        :Street1 => current_order.bill_address.address1,
        :Street2 => current_order.bill_address.address2,
        :CityName => current_order.bill_address.city,
        # :phone => current_order.bill_address.phone,
        :StateOrProvince => current_order.bill_address.state_text,
        :Country => current_order.bill_address.country.iso,
        :PostalCode => current_order.bill_address.zipcode
      }
    end

This causes an issue, as the callback from paypal updated the shipping address details in the backend.

Should the above be based on shipping address?

DangerDawson commented 10 years ago

Actually scrap the above it all works fine, the shipping address stays as the original although I have noticed that modifying the shipping address in paypal does not affect the shipping address in the backend, I am guessing this is expected behaviour?

radar commented 10 years ago

@DangerDawson

The address information we pass to PayPal is (I believe) used to validate that the user is using valid credit card credentials. Same as when we pass the address information to any payment gateway. It's usually referred to as an "Address Verification System". Passing the bill address is correct, imo.

What callback from PayPal are you talking about?

I am not sure if PayPal even sends out an event notification when the address information changes, so no, the backend won't magically be updated with the new address information unless this can happen.

DangerDawson commented 10 years ago

Forget the callback part, I must have been drinking something quite strong and was wrongly compared it to the Adyen payment gateway extension we are using :-)

The bit that was slightly confusing was that the ShipToAddress which is part of the payment_details method uses the bill_address from the order rather than the ship_address.

Anyway it is not causing any issues so I will close it.

D

On 3 Mar 2014, at 16:12, Ryan Bigg notifications@github.com wrote:

@DangerDawson

The address information we pass to PayPal is (I believe) used to validate that the user is using valid credit card credentials. Same as when we pass the address information to any payment gateway. It's usually referred to as an "Address Verification System". Passing the bill address is correct, imo.

What callback from PayPal are you talking about?

I am not sure if PayPal even sends out an event notification when the address information changes, so no, the backend won't magically be updated with the new address information unless this can happen.

— Reply to this email directly or view it on GitHub.

radar commented 10 years ago

Alrighty, no worries :)