mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
🚧 Update the constructor
This commit is contained in:
parent
eef4c80a48
commit
d1bb877553
1 changed files with 20 additions and 12 deletions
|
@ -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' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue