now i using Woocommerce - wordpress for shopping mall i'm sorry to my bad english but i need your help.
First, i want create new payment gateway. it done - After copy other payment gateway, paste my gateway's name in code
But i faced big problem. - I have no method to add
<script>window.open()</script>
code on Click "PLACE ORDER" button
below my source code
/* class.wc-gateway-mine.php */
if(!defined('ABSPATH')){
exit;
}
//Description ..
class WC_gatewqy_mine extend WC_Payment_Gatewqy{
//function __construct()..
//function init_form_fields()..
//function thankyou_page()..
//function email_instructions()..
function process_payment($order_id){
$order = wc_get_order( $order_id );
/* I want add new Javascript code here for create new window.
After that child window submit "success" value to parent(or Parent window received "success" value from child window),
I hope that the following processes will proceed as well(payment_process).
*/
// Mark as processing (we're awaiting the cinfirm checkout)
$order->update_status( 'processing', _x( 'Awaiting check payment', 'Check payment method', 'woocommerce' ) );
// Reduce stock levels
$order->reduce_order_stock();
// Remove cart
WC()->cart->empty_cart();
// Return thankyou redirect
return array(
'result' => 'success',
'redirect' => $this->get_return_url( $order )
);
}
}
how can i do?