Fix: Loading logos when handling qrCode/await actions (#2490)

* fix: getting proper logos for actions

* changeset
This commit is contained in:
Guilherme Ribeiro
2023-12-13 12:04:24 +01:00
committed by GitHub
parent daeb70504a
commit d1c9282980
4 changed files with 15 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'@adyen/adyen-web': patch
---
Loading the logo images properly when handling qrCode/await actions

View File

@@ -239,7 +239,8 @@ export class UIElement<P extends UIElementProps = any> extends BaseElement<P> 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);
}
/**

View File

@@ -211,7 +211,7 @@ class QRLoader extends Component<QRLoaderProps, QRLoaderState> {
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' });
}}
/>

View File

@@ -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;