diff --git a/.gitignore b/.gitignore index 7658e8f..69e3741 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ Gemfile.lock *.gem TAGS diagram.txt +.bundle +vendor diff --git a/lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb b/lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb index e7c7664..6802c4b 100644 --- a/lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb +++ b/lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb @@ -210,6 +210,17 @@ def build_adaptive_set_payment_options_request(opts) x.sharePhoneNumber opts[:sender][:share_phone_number] if opts[:sender][:share_phone_number] x.requireShippingAddressSelection opts[:sender][:require_shipping_address_selection] if opts[:sender][:require_shipping_address_selection] x.referrerCode opts[:sender][:referrerCode] if opts[:sender][:referrerCode] + if opts[:sender][:shipping_address] + x.shippingAddress do |x| + x.addresseeName opts[:sender][:shipping_address][:name] if opts[:sender][:shipping_address][:name] + x.street1 opts[:sender][:shipping_address][:street1] if opts[:sender][:shipping_address][:street1] + x.street2 opts[:sender][:shipping_address][:street2] if opts[:sender][:shipping_address][:street2] + x.city opts[:sender][:shipping_address][:city] if opts[:sender][:shipping_address][:city] + x.state opts[:sender][:shipping_address][:state] if opts[:sender][:shipping_address][:state] + x.zip opts[:sender][:shipping_address][:zip] if opts[:sender][:shipping_address][:zip] + x.country opts[:sender][:shipping_address][:country] if opts[:sender][:shipping_address][:country] + end + end end unless opts[:display_options].blank? x.displayOptions do |x| diff --git a/test/fixtures.example.yml b/test/fixtures.example.yml index f313343..ae71b64 100644 --- a/test/fixtures.example.yml +++ b/test/fixtures.example.yml @@ -6,6 +6,15 @@ credentials: paydetails_options: pay_key: AP-49N53304XXkjh2374P + :sender: + :shipping_address: + :name: John + :street1: 17 Magneson St + :street2: building 1 + :city: San Jose + :state: CA + :zip: 12345 + :country: US recipients: &recipients - :email: seller_1313041935_biz@gmail.com