Blocks Checkout – Catch onSubmit for Payment with Context

[ad_1]

We have implemented payments with context and blocks to our gateway plugin successfully!

This refers to the javascript implementation of the onSubmit() event – how to listen to it and run a function in js once the event happens :

Catching events such as the “Place Order” – onSubmit() is missing… currently we are using an observer to catch the isComplete() after things started happening.

In the docs I have read that these events are available, however we did not manage to access said events from the examples. Also the examples on how to create or catch the event are unclear…. (It seems as some packages or dependencies are missing though trying to add them or search for them also did not raise much).

How do we catch the onSubmit event when the context process begins and is finished with the $result->set_status(); function on PHP and catching it on JavaScript, there we want to open the iframe we have.

Currently this is acheived via the Observer. however this is not idle nor is it the way to go! is it?!

Suffices to say that our code is available on woocommerce and this is the blocks inside the main plugin directory.

https://projectdmc.org/plugins/payplus-payment-gateway/

In the current development version we are working with we have already implemented the isComplete() check , but we would much rather using an event instead!

Thanks!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer