-
Notifications
You must be signed in to change notification settings - Fork 221
feat(payment): PI-4031 Change how payment_method_category parameter i… #2890
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?
feat(payment): PI-4031 Change how payment_method_category parameter i… #2890
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ code/snyk check is complete. No issues have been found. (View Details) |
356a420
to
c92122e
Compare
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.
LGTM! And thanks for test coverage improvement!
…s passed to Klarna
c92122e
to
9920190
Compare
@@ -105,7 +105,7 @@ export default class KlarnaV2PaymentStrategy { | |||
|
|||
await this.klarnav2TokenUpdater.klarnaOrderInitialization(cartId, clientToken); | |||
|
|||
const { authorization_token: authorizationToken } = await this.authorizeOrThrow(methodId); | |||
const { authorization_token: authorizationToken } = await this.authorizeOrThrow(methodId, gatewayId); |
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.
const { authorization_token: authorizationToken } = await this.authorizeOrThrow(methodId, gatewayId); | |
const paymentMethodСategory = this.isKlarnaSingleRadioButtonEnabled() ? gatewayId : methodId; | |
const { authorization_token: authorizationToken } = await this.authorizeOrThrow(paymentMethodСategory); |
@@ -228,7 +228,7 @@ export default class KlarnaV2PaymentStrategy { | |||
return klarnaAddress; | |||
} | |||
|
|||
private async authorizeOrThrow(methodId: string): Promise<KlarnaAuthorizationResponse> { | |||
private async authorizeOrThrow(methodId: string, gatewayId: string): Promise<KlarnaAuthorizationResponse> { |
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.
private async authorizeOrThrow(methodId: string, gatewayId: string): Promise<KlarnaAuthorizationResponse> { | |
private async authorizeOrThrow(paymentMethodСategory: string): Promise<KlarnaAuthorizationResponse> { |
@@ -245,7 +245,7 @@ export default class KlarnaV2PaymentStrategy { | |||
} | |||
|
|||
this.klarnaPayments.authorize( | |||
{ payment_method_category: methodId }, | |||
{ payment_method_category: this.isKlarnaSingleRadioButtonEnabled() ? gatewayId : methodId }, |
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.
{ payment_method_category: this.isKlarnaSingleRadioButtonEnabled() ? gatewayId : methodId }, | |
{ payment_method_category: paymentMethodСategory }, |
…s passed to Klarna
…s passed to Klarna
What?
Adjusting payment_method_category to the new requirements requested by Klarna.
BE part - https://github.com/bigcommerce/bigpay/pull/9155
Also improved test coverage to meet 80% requirement
Testing / Proof
Tested manually
Klarna.mov
@bigcommerce/team-checkout @bigcommerce/team-payments