diff --git a/payme.php b/payme.php index d769baa..7a4b379 100644 --- a/payme.php +++ b/payme.php @@ -3,7 +3,7 @@ Plugin Name: Payme Plugin URI: http://paycom.uz Description: Payme Checkout Plugin for WooCommerce -Version: 1.4.6 +Version: 1.4.8 Author: richman@mail.ru, support@paycom.uz Text Domain: payme */ @@ -46,7 +46,8 @@ class WC_PAYME extends WC_Payment_Gateway protected $merchant_id; protected $merchant_key; protected $checkout_url; - protected $return_url; + protected $return_url; + protected $complete_order; public function __construct() { @@ -64,7 +65,8 @@ public function __construct() $this->merchant_id = $this->get_option('merchant_id'); $this->merchant_key = $this->get_option('merchant_key'); $this->checkout_url = $this->get_option('checkout_url'); - $this->return_url = $this->get_option('return_url'); + $this->return_url = $this->get_option('return_url'); + $this->complete_order = $this->get_option('complete_order'); add_action('woocommerce_receipt_' . $this->id, [$this, 'receipt_page']); add_action('woocommerce_update_options_payment_gateways_' . $this->id, [$this, 'process_admin_options']); @@ -111,6 +113,12 @@ public function init_form_fields() 'label' => __('Enabled', 'payme'), 'default' => 'yes' ], + 'complete_order' => [ + 'title' => __('Order auto complete', 'payme'), + 'type' => 'checkbox', + 'label' => __('If disabled, you have to manually change order status to COMPLETE after success payment', 'payme'), + 'default' => 'yes' + ], 'merchant_id' => [ 'title' => __('Merchant ID', 'payme'), 'type' => 'text', @@ -156,8 +164,7 @@ public function generate_form($order_id) $label_pay = __('Pay', 'payme'); $label_cancel = __('Cancel payment and return back', 'payme'); - - $callbackUrl=$this->return_url.'&order_id='.$order_id; + $callbackUrl=$this->return_url.'/'.$order_id.'/?key='.$order->get_order_key(); $form = <<