🚧 Update the constructor

This commit is contained in:
Philipp Stracker 2024-10-07 11:00:39 +02:00
parent eef4c80a48
commit d1bb877553
No known key found for this signature in database

View file

@ -93,21 +93,29 @@ class ApplePayButton extends PaymentButton {
*/
initialPaymentRequest = null;
constructor( context, externalHandler, buttonConfig, ppcpConfig ) {
apmButtonsInit( ppcpConfig );
constructor(
context,
externalHandler,
buttonConfig,
ppcpConfig,
contextHandler
) {
// Disable debug output in the browser console:
// buttonConfig.is_debug = false;
this.context = context;
this.externalHandler = externalHandler;
this.buttonConfig = buttonConfig;
this.ppcpConfig = ppcpConfig;
super(
context,
externalHandler,
buttonConfig,
ppcpConfig,
contextHandler
);
this.contextHandler = ContextHandlerFactory.create(
this.context,
this.buttonConfig,
this.ppcpConfig
);
this.init = this.init.bind( this );
this.onPaymentAuthorized = this.onPaymentAuthorized.bind( this );
this.onButtonClick = this.onButtonClick.bind( this );
this.refreshContextData();
this.log( 'Create instance' );
}
/**