Hi there!
I try to develop a plugin for one payment system and there is a widget API that should be applied from client side plugin.
Here is a part of action:
function(properties, context) {
const params = properties;
context.async(function(cb) {
var widget = new Widget();
widget.show(params,
function (response) {
// on approved
cb(null, response);
console.log(response)
},
function (response) {
// on declined
cb(response, null);
console.log(response)
},
function (response) {
// on pending or in processing
cb(null, response)
console.log(response)
}
);
});
}
Does someone know what is callback in context.async and how to get result from one?