File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313add_action ('plugins_loaded ' , 'woocommerce_unitpay ' , 0 );
1414function woocommerce_unitpay (){
1515 load_plugin_textdomain ( 'unitpay ' , false , dirname ( plugin_basename ( __FILE__ ) ) . '/lang/ ' );
16-
16+
1717 if (!class_exists ('WC_Payment_Gateway ' ))
1818 return ; // if the WC payment gateway class is not available, do nothing
1919 if (class_exists ('WC_UNITPAY ' ))
@@ -100,12 +100,14 @@ public function generate_form($order_id){
100100 $ sum = number_format ($ order ->order_total , 2 , '. ' , '' );
101101 $ account = $ order_id ;
102102 $ desc = __ ('Payment for Order № ' , 'unitpay ' ) . $ order_id ;
103+ $ currency = $ order ->get_order_currency ();
103104
104105 return
105106 '<form action="https://unitpay.ru/pay/ ' . $ this ->public_key . '" method="POST" id="unitpay_form"> ' .
106107 '<input type="hidden" name="sum" value=" ' . $ sum . '" /> ' .
107108 '<input type="hidden" name="account" value=" ' . $ account . '" /> ' .
108109 '<input type="hidden" name="desc" value=" ' . $ desc . '" /> ' .
110+ '<input type="hidden" name="currency" value=" ' . $ currency . '" /> ' .
109111 '<input type="submit" class="button alt" id="submit_unitpay_form" value=" ' .__ ('Pay ' , 'unitpay ' ).'" />
110112 <a class="button cancel" href=" ' .$ order ->get_cancel_order_url ().'"> ' .__ ('Cancel payment and return back to card ' , 'unitpay ' ).'</a> ' ."\n" .
111113 '</form> ' ;
You can’t perform that action at this time.
0 commit comments