-
Notifications
You must be signed in to change notification settings - Fork 396
fix(payment): fixed the issue with triggering BraintreePaypalCreditBanner for BigCommercePayments provider and made made a little refactoring of customTitles #2631
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
base: master
Are you sure you want to change the base?
Conversation
…nner for bigcommerce payments provider and made made a little refactoring of customTitles
| subtitle: (props: PaymentMethodSubtitleProps) => <BigCommercePaymentsPayLaterBanner {...props} /> | ||
| }, | ||
| [PaymentMethodId.BigCommercePaymentsPayLater]: { | ||
| [PaymentMethodId.BraintreePayPal]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new. It was added to let only braintreepaypal and braintreepaypalcredit to have BraintreePaypalCreditBanner as a subtitle
| titleText: method.logoUrl ? '' : methodDisplayName, | ||
| }, | ||
| [PaymentMethodType.VisaCheckout]: { | ||
| [PaymentMethodId.BraintreeVisaCheckout]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PaymentMethodType.VisaCheckout -> PaymentMethodId.BraintreeVisaCheckout.
This was made to simplify understanding of the affiliation of the VisaCheckout payment method type.
| [PaymentMethodId.AmazonPay]: { | ||
| logoUrl: cdnPath('/img/payment-providers/amazon-header.png'), | ||
| titleText: '', | ||
| [PaymentMethodId.BigCommercePaymentsVenmo]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method moved here just to avoid making unnecessary condition in the end of current method. Also the code will be easier to read.
| [PaymentMethodId.Zip]: { | ||
| logoUrl: cdnPath('/img/payment-providers/zip.png'), | ||
| titleText: language.translate('payment.zip_display_name_text'), | ||
| [PaymentMethodId.PaypalCommerceVenmo]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for BigCommercePaymentsVenmo
| method.method === 'scheme' ? 'card' : method.method | ||
| }.svg`, | ||
| titleText: methodDisplayName, | ||
| [PaymentMethodId.PaypalExpress]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New one. It was created instead of PaymentMethodType.PayPal.
method: PaymentMethodType.PayPal also present for PayPalCommerce, BraintreePayPal and BigCommercePaymentsPayPal, however the list of providers already has their own title keys.
| method.method === 'credit_card' | ||
| ? '' | ||
| : cdnPath(`/img/payment-providers/mollie_${method.method}.svg`), | ||
| [PaymentMethodId.PaypalExpressCredit]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New one. It was created instead of PaymentMethodType.PayPalCredit.
method: PaymentMethodType.PayPalCredit also present for PayPalCommerceCredit, BraintreePayPalCredit and BigCommercePaymentsPayLater, however the list of providers already has their own title keys.
| logoUrl: cdnPath('/img/payment-providers/quadpay.png'), | ||
| titleText: language.translate('payment.quadpay_display_name_text'), | ||
| }, | ||
| [PaymentMethodId.Ratepay]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was moved from condition bellow. Does not know why it was not placed here in the past
|
|
||
| if ( | ||
| method.gateway === PaymentMethodId.BigCommercePaymentsAlternativeMethod && | ||
| method.id === PaymentMethodId.Klarna |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to customTitles[PaymentMethodId.BigCommercePaymentsAlternativeMethod]
| } | ||
| } | ||
|
|
||
| if (method.id === PaymentMethodId.PaypalCommerceVenmo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to customTitles[PaymentMethodId.PaypalCommerceVenmo]
| }; | ||
| } | ||
|
|
||
| if (method.id === PaymentMethodId.BigCommercePaymentsVenmo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to customTitles[PaymentMethodId.BigCommercePaymentsVenmo]
| return customTitles[PaymentMethodType.CreditCard]; | ||
| } | ||
|
|
||
| if (method.id === PaymentMethodId.Ratepay) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to customTitles[PaymentMethodId.Ratepay]
| PayPalCommerceGooglePay = 'googlepaypaypalcommerce', | ||
| BraintreeVisaCheckout = 'braintreevisacheckout', | ||
| BraintreeLocalPaymentMethod = 'braintreelocalmethods', | ||
| BraintreePayPal = 'braintreepaypal', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new
| BigCommercePaymentsFastLane = 'bigcommerce_payments_fastlane', | ||
| BigCommercePaymentsGooglePay = 'googlepay_bigcommerce_payments', | ||
| PaypalExpress = 'paypalexpress', | ||
| PaypalExpressCredit = 'paypalexpresscredit', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I didn't left a comment for the change, then it was just sorted
What/Why?
BigCommercePaymentsprovider usedBraintreePaypalCreditBannerinstead ofBigCommercePaymentsPayLaterBannercomponent ;BraintreePayPal,PayPalExpressCreditmethod ids in payments-integration-api package;getPaymentMethodTitlemethod inPaymentMethodTitle.tsxfile:BraintreePaypalCreditBannershould be rendered;Rollout/Rollback
Merge / revert
Testing
TODO: