@@ -25,11 +25,11 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.
2525
2626### Pass billingData to canMakePayment and debounce its calls ([ 4776] ( https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4776 ) )
2727
28- - Add this code somewhere (you can try ` assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-registration.ts ` ):
28+ - Add this code somewhere (you can try ` assets/js/base/context/providers/cart-checkout/payment-methods/use-payment-method-registration.ts ` ).
29+ - If you can't edit files, install ` Custom CSS & JS ` plugin and insert this code:
2930
3031``` js
31- import { registerPaymentMethodExtensionCallbacks } from ' @woocommerce/blocks-registry' ;
32- registerPaymentMethodExtensionCallbacks ( ' woocommerce-marketplace-extension' , {
32+ wc .wcBlocksRegistry .registerPaymentMethodExtensionCallbacks ( ' woocommerce-marketplace-extension' , {
3333 cod : ( arg ) => {
3434 console .log ( ' checking COD' );
3535 return arg .billingData .first_name === ' Alexandra' ;
@@ -46,15 +46,10 @@ registerPaymentMethodExtensionCallbacks( 'woocommerce-marketplace-extension', {
4646- As the previous step, paste this code somewhere:
4747
4848``` js
49- import {
50- registerExpressPaymentMethod ,
51- registerPaymentMethodExtensionCallbacks ,
52- } from ' @woocommerce/blocks-registry' ;
53-
54- registerExpressPaymentMethod ( {
49+ wc .wcBlocksRegistry .registerExpressPaymentMethod ( {
5550 name: ' expressMethod' ,
5651 edit: null ,
57- content: createElement ( ' div' , {}, ' My express test method' ),
52+ content: wp . element . createElement ( ' div' , {}, ' My express test method' ),
5853 canMakePayment : () => true ,
5954 paymentMethodId: ' expressMethod' ,
6055 supports: {
@@ -67,7 +62,7 @@ registerExpressPaymentMethod( {
6762- Add this code now:
6863
6964``` js
70- registerPaymentMethodExtensionCallbacks ( ' woocommerce-marketplace-extension' , {
65+ wc . wcBlocksRegistry . registerPaymentMethodExtensionCallbacks ( ' woocommerce-marketplace-extension' , {
7166 expressMethod : ( arg ) => {
7267 console .log ( ' canMakePayment expressMethod' );
7368 return false ;
0 commit comments