diff --git a/.changeset/fair-masks-attend.md b/.changeset/fair-masks-attend.md new file mode 100644 index 00000000..c8b557c9 --- /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 diff --git a/packages/lib/src/components/UIElement.tsx b/packages/lib/src/components/UIElement.tsx index 9ac139af..79b544d9 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 41beadb9..6e60be37 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 8e35e0ad..3179d042 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;