Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to add a shipping address to payment options #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ Gemfile.lock
*.gem
TAGS
diagram.txt
.bundle
vendor
11 changes: 11 additions & 0 deletions lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shadowing outer local variable - x.

x.addresseeName opts[:sender][:shipping_address][:name] if opts[:sender][:shipping_address][:name]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [114/80]

x.street1 opts[:sender][:shipping_address][:street1] if opts[:sender][:shipping_address][:street1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [114/80]

x.street2 opts[:sender][:shipping_address][:street2] if opts[:sender][:shipping_address][:street2]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [114/80]

x.city opts[:sender][:shipping_address][:city] if opts[:sender][:shipping_address][:city]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [105/80]

x.state opts[:sender][:shipping_address][:state] if opts[:sender][:shipping_address][:state]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [108/80]

x.zip opts[:sender][:shipping_address][:zip] if opts[:sender][:shipping_address][:zip]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [102/80]

x.country opts[:sender][:shipping_address][:country] if opts[:sender][:shipping_address][:country]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [114/80]

end
end
end
unless opts[:display_options].blank?
x.displayOptions do |x|
Expand Down
9 changes: 9 additions & 0 deletions test/fixtures.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down