From 960cdf76a71da96bd12a3e6a905c358de52259c5 Mon Sep 17 00:00:00 2001 From: guilhermer Date: Tue, 12 Dec 2023 12:22:14 -0300 Subject: [PATCH 1/2] fix: getting proper logos for actions --- packages/lib/src/components/UIElement.tsx | 3 ++- packages/lib/src/components/internal/QRLoader/QRLoader.tsx | 2 +- packages/lib/src/components/types.ts | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/lib/src/components/UIElement.tsx b/packages/lib/src/components/UIElement.tsx index 9ac139af6e..79b544d90b 100644 --- a/packages/lib/src/components/UIElement.tsx +++ b/packages/lib/src/components/UIElement.tsx @@ -239,7 +239,8 @@ export class UIElement

extends BaseElement

im * Get the element icon URL for the current environment */ get icon(): string { - return this.props.icon ?? this.resources.getImage()(this.type); + const type = this.props.paymentMethodType || this.type; + return this.props.icon ?? this.resources.getImage()(type); } /** diff --git a/packages/lib/src/components/internal/QRLoader/QRLoader.tsx b/packages/lib/src/components/internal/QRLoader/QRLoader.tsx index 41beadb92e..6e60be3729 100644 --- a/packages/lib/src/components/internal/QRLoader/QRLoader.tsx +++ b/packages/lib/src/components/internal/QRLoader/QRLoader.tsx @@ -211,7 +211,7 @@ class QRLoader extends Component { src={qrCodeImage} alt={i18n.get('wechatpay.scanqrcode')} onLoad={() => { - onActionHandled({ componentType: this.props.type, actionDescription: 'qr-code-loaded' }); + onActionHandled?.({ componentType: this.props.type, actionDescription: 'qr-code-loaded' }); }} /> diff --git a/packages/lib/src/components/types.ts b/packages/lib/src/components/types.ts index 8e35e0ad2e..3179d042bd 100644 --- a/packages/lib/src/components/types.ts +++ b/packages/lib/src/components/types.ts @@ -158,6 +158,13 @@ export interface UIElementProps extends BaseElementProps { /** @internal */ clientKey?: string; + /** + * Returned after the payments call, when an action is returned. It represents the payment method tx variant + * that was used for the payment + * @internal + */ + paymentMethodType?: string; + /** @internal */ elementRef?: any; From 68519d8703dc4c024307f62cb85c328aa8d1eab1 Mon Sep 17 00:00:00 2001 From: guilhermer Date: Tue, 12 Dec 2023 12:24:08 -0300 Subject: [PATCH 2/2] changeset --- .changeset/fair-masks-attend.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fair-masks-attend.md diff --git a/.changeset/fair-masks-attend.md b/.changeset/fair-masks-attend.md new file mode 100644 index 0000000000..c8b557c949 --- /dev/null +++ b/.changeset/fair-masks-attend.md @@ -0,0 +1,5 @@ +--- +'@adyen/adyen-web': patch +--- + +Loading the logo images properly when handling qrCode/await actions