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

Add make_default method on AddPaymentSourcesToWallet class #17

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

vassalloandrea
Copy link
Member

@vassalloandrea vassalloandrea commented Oct 12, 2018

Ref: solidusio#2652

Update:

After some consideration with @tvdeyen

With this PR we want to separate the add_to_wallet behavior from the make_default one to help if someone wants to change only the make_default logic without overriding the add_to_wallet.

How it works

Now the add_to_wallet method calls the make_default method after adding on the user wallet the payment sources.
To change the make_default behavior now we can create own class and override the make_default method.

E.g.: solidusio#2913 (comment)

@vassalloandrea vassalloandrea self-assigned this Oct 12, 2018
@vassalloandrea vassalloandrea changed the title Add last_credit_card_as_default preference on Spree::Config Add configuration to settle the last payment source as default Oct 12, 2018
@vassalloandrea vassalloandrea force-pushed the last_payment_source_as_default_for_user_wallet branch from 774691f to 38b18f9 Compare December 12, 2018 16:00
@vassalloandrea vassalloandrea changed the title Add configuration to settle the last payment source as default Add make_default method on AddPaymentSourcesToWallet class Dec 12, 2018
@vassalloandrea vassalloandrea force-pushed the last_payment_source_as_default_for_user_wallet branch from 38b18f9 to 44e5e20 Compare December 13, 2018 15:48
@vassalloandrea vassalloandrea force-pushed the last_payment_source_as_default_for_user_wallet branch from 44e5e20 to 48dd2fe Compare June 14, 2019 14:06
@vassalloandrea vassalloandrea force-pushed the last_payment_source_as_default_for_user_wallet branch from 48dd2fe to 3f9a3ed Compare January 31, 2020 14:48
Move the logic to make the last payment source as default outside the 
add_to_wallet method to take advantage if someone wants to change only 
the make default behavior.
@vassalloandrea vassalloandrea force-pushed the last_payment_source_as_default_for_user_wallet branch from 3f9a3ed to 27fb811 Compare February 7, 2020 10:08
@AlessioRocco AlessioRocco merged commit 27fb811 into master Feb 13, 2020
@AlessioRocco AlessioRocco deleted the last_payment_source_as_default_for_user_wallet branch February 13, 2020 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants