🚧 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; initialPaymentRequest = null;
constructor( context, externalHandler, buttonConfig, ppcpConfig ) { constructor(
apmButtonsInit( ppcpConfig ); context,
externalHandler,
buttonConfig,
ppcpConfig,
contextHandler
) {
// Disable debug output in the browser console:
// buttonConfig.is_debug = false;
this.context = context; super(
this.externalHandler = externalHandler; context,
this.buttonConfig = buttonConfig; externalHandler,
this.ppcpConfig = ppcpConfig; buttonConfig,
ppcpConfig,
contextHandler
);
this.contextHandler = ContextHandlerFactory.create( this.init = this.init.bind( this );
this.context, this.onPaymentAuthorized = this.onPaymentAuthorized.bind( this );
this.buttonConfig, this.onButtonClick = this.onButtonClick.bind( this );
this.ppcpConfig
);
this.refreshContextData(); this.log( 'Create instance' );
} }
/** /**