I am developing custom payment gateway which is iframe javscript based payment. Onclick the place order i need to getthe response and process the payment.
For example
public function payment_fields() {
echo ' <script>
var success = function(response) {
$this->process_payment // php function
}
sendbillinginfoto(requesttoexernalserverfromiframe);
</script>';
}
public function process_payment( $order_id ) {
$order = wc_get_order( $order_id );
.......
.......
}