我在使用结帐页面上的“下单”按钮时遇到问题,无法运行使用woocommerce_review_order_after_submit
钩子链接到付款网关的功能。
我尝试使用woocommerce_review_order_after_submit
'钩子:
function renderMMoneyPaymentButton(amount, merchantOrderId, apiKey) {
let paymentParams = {
amount: amount,
api_key: apiKey,
currency: 'BBD',
merchant_order_id: merchantOrderId,
onCancel: function() { console.log('Modal closed'); },
onError: function(error) { console.log('Error', error); },
onPaid: function(invoice) { console.log('Payment complete', invoice); }
}
// "mMoney" window global provided by sourcing mmoney-payment.js script.
// Attach the button to the empty element.
mMoney.payment.button.render(paymentParams, '#mmoney-payment-button');
}