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

Permit passing an address via payment source parameters #3713

Merged
merged 1 commit into from
Aug 26, 2020
Merged
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: 1 addition & 1 deletion core/lib/spree/permitted_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module PermittedAttributes
:number, :month, :year, :expiry, :verification_value,
:first_name, :last_name, :cc_type, :gateway_customer_profile_id,
:gateway_payment_profile_id, :last_digits, :name, :encrypted_data,
:existing_card_id, :wallet_payment_source_id
:existing_card_id, :wallet_payment_source_id, address_attributes: address_attributes
]

@@stock_item_attributes = [:variant, :stock_location, :backorderable, :variant_id]
Expand Down
8 changes: 8 additions & 0 deletions frontend/spec/features/checkout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@
expect(page).to have_current_path(spree.order_path(Spree::Order.last))
expect(page).to have_content('Ending in 1111')
end

it "allows user to save a billing address associated to the credit card" do
choose "use_existing_card_no"
fill_in_credit_card

click_on "Save and Continue"
expect(Spree::CreditCard.last.address).to be_present
end
end

# regression for https://github.com/spree/spree/issues/2921
Expand Down