-
Notifications
You must be signed in to change notification settings - Fork 4.6k
refactor: add payment_issuer and payment_experience in pa #491
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There is a use case where missing_required_field error should be raised when constructing the connector request which is possible using encode function
Type of Change
Description
Add
payment_issuerandpayment_experienceto payment_attempt table. The pay_later issuer will be decided based on this.a small example of how this could and will be used.
if payment_issuer is
klarnaand payment_experience isredirect_to_urlthen klarna payment will be processed throughstripeor any supported connector, but if the payment_experience isinvoke_sdk_clientthen the payment will be processed throughklarnawhich supports sdk.Additional Changes
payment_issuserandpayment_experiencetopayment_attempttable. Migrations can be found here.redirectandpayment_flowfields frompayment_attempttable since those were not used anywhere. Migrations can be found here.Motivation and Context
#447 Not sure of how we will be handling the billing and shipping address. Currently billing details must be sent in
payment_method_datathe same way as stripes api.How did you test it?
{ "payment_method": "pay_later", "payment_issuer": "klarna", "payment_experience": "redirect_to_url", "payment_method_data": { "pay_later": { "klarna_redirect": { "billing_email" : "[email protected]", "billing_country": "US" } } } }{ "payment_method": "pay_later", "payment_issuer": "affirm", "payment_experience": "redirect_to_url", "payment_method_data": { "pay_later": { "affirm_redirect": {} } }, }{ "payment_issuer": "afterpay_clearpay", "payment_experience": "redirect_to_url", "payment_method_data": { "pay_later": { "afterpay_clearpay_redirect": { "billing_email": "[email protected]", "billing_name": "Example" } } }, "shipping": { "address": { "first_name": "example", "zip": "123456", "line1": "New York", "country": "US" } }, }{ "payment_method": "pay_later", "payment_issuer": "klarna", "payment_experience": "redirect_to_url", "payment_method_data": { "pay_later": { "affirm_redirect": {} } }, }Checklist
cargo +nightly fmt --allcargo clippy