DEV Community

Nguyen Hoang
Nguyen Hoang

Posted on

How to Integrate Custom Payment Gateways with WooCommerce Checkout Block

Image description

Image description

follow this guide

https://rudrastyh.com/woocommerce/checkout-block-payment-method-integration.html

be carefull

check this code is run?
if not we cannot see custom payment method

public function get_payment_method_script_handles() {
wp_register_script(
'wc-shop_as_client-blocks-integration',
plugin_dir_url(FILE) . 'js/checkout.js',
[
'wc-blocks-registry',
'wc-settings',
'wp-element',
'wp-html-entities'
],
null,
true
);

    return [ 'wc-shop_as_client-blocks-integration' ];
}
Enter fullscreen mode Exit fullscreen mode

check this file
plugin_dir_url(FILE) . 'js/checkout.js',

and add alert("test payment") to test

Top comments (0)