Skip to content

Conversation

@serhii-tkachenko
Copy link
Contributor

What/Why?

  1. Fixed the issue when BigCommercePayments provider used BraintreePaypalCreditBanner instead of BigCommercePaymentsPayLaterBanner component ;
  2. Updated PaymentMethodIds file with BraintreePayPal, PayPalExpressCredit method ids in payments-integration-api package;
  3. Updated getPaymentMethodTitle method in PaymentMethodTitle.tsx file:
  • now customTitles object sorted alphabetically based on PaymentMethodType and then by PaymentMethodId;
  • updated PaymentMethodType.PayPal -> PaymentMethodId.PayPalExpress and PaymentMethodType.PayPalCredit -> PaymentMethodId.PayPalExpressCredit;
  • created additional BraintreePayPal key to set direct method id for which BraintreePaypalCreditBanner should be rendered;
  • other items I will describe via comments in the PR;

Rollout/Rollback

Merge / revert

Testing

TODO:

  • as before, show the error in the console;
  • as after, show, that error in console does not exists anymore;
  • plus make screenshots of google pay, paypal, paylater methods;
  • check if braintree banners are working as expected;
  • check if bigcommerce payments banners are working as expected;
  • check if paypal express payment methods have valid titles;
  • check if paypal commerce ratepay title renders as expected;

…nner for bigcommerce payments provider and made made a little refactoring of customTitles
subtitle: (props: PaymentMethodSubtitleProps) => <BigCommercePaymentsPayLaterBanner {...props} />
},
[PaymentMethodId.BigCommercePaymentsPayLater]: {
[PaymentMethodId.BraintreePayPal]: {
Copy link
Contributor Author

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]: {
Copy link
Contributor Author

@serhii-tkachenko serhii-tkachenko Oct 10, 2025

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]: {
Copy link
Contributor Author

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]: {
Copy link
Contributor Author

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]: {
Copy link
Contributor Author

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]: {
Copy link
Contributor Author

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]: {
Copy link
Contributor Author

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
Copy link
Contributor Author

@serhii-tkachenko serhii-tkachenko Oct 10, 2025

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) {
Copy link
Contributor Author

@serhii-tkachenko serhii-tkachenko Oct 10, 2025

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) {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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',
Copy link
Contributor Author

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',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is new

Copy link
Contributor Author

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

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