mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Update paylater amount in block cart/checkout
This commit is contained in:
parent
ccc0e263dd
commit
c8632e3826
4 changed files with 76 additions and 3 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
normalizeStyleForFundingSource
|
||||
} from '../../../ppcp-button/resources/js/modules/Helper/Style'
|
||||
import buttonModuleWatcher from "../../../ppcp-button/resources/js/modules/ButtonModuleWatcher";
|
||||
import BlockCheckoutMessagesBootstrap from "./Bootstrap/BlockCheckoutMessagesBootstrap";
|
||||
|
||||
const config = wc.wcSettings.getSetting('ppcp-gateway_data');
|
||||
|
||||
|
@ -38,6 +39,7 @@ const PayPalComponent = ({
|
|||
|
||||
if (!paypalScriptLoaded) {
|
||||
if (!paypalScriptPromise) {
|
||||
// for editor, since canMakePayment was not called
|
||||
paypalScriptPromise = loadPaypalScriptPromise(config.scriptData)
|
||||
}
|
||||
paypalScriptPromise.then(() => setPaypalScriptLoaded(true));
|
||||
|
@ -386,7 +388,11 @@ if (config.scriptData.continuation) {
|
|||
ariaLabel: config.title,
|
||||
canMakePayment: async () => {
|
||||
if (!paypalScriptPromise) {
|
||||
paypalScriptPromise = loadPaypalScriptPromise(config.scriptData)
|
||||
paypalScriptPromise = loadPaypalScriptPromise(config.scriptData);
|
||||
paypalScriptPromise.then(() => {
|
||||
const messagesBootstrap = new BlockCheckoutMessagesBootstrap(config.scriptData);
|
||||
messagesBootstrap.init();
|
||||
});
|
||||
}
|
||||
await paypalScriptPromise;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue