Plugin Directory

Changeset 2576606


Ignore:
Timestamp:
08/02/2021 04:24:21 PM (5 years ago)
Author:
slimcd
Message:

payment success check against order_status

Location:
slimcd-payment-gateway
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • slimcd-payment-gateway/tags/1.0.1/includes/class-slimcd-payment-gateway.php

    r2574473 r2576606  
    196196    public function slimcd_redirect()
    197197    {
    198 
    199198        if (!empty($_GET['order_id'])) {
    200199            $order = wc_get_order($_GET['order_id']);
    201 
    202             if ($order->get_payment_method() == "slimcd_payment") {
    203 
    204 
    205                 if ($_GET && $_GET['sessionid'] !== "") {
    206                     if ("Success" == $this->slimcd_payment_status($_GET['sessionid'])) {
    207                         wp_redirect($order->get_checkout_order_received_url());
    208                     } else {
    209                         wc_add_notice('Issue in payment, Please choose another payment method', 'error');
    210                         wp_redirect(wc_get_checkout_url());
    211                     }
     200            if ($order->get_payment_method() == "slimcd_payment" && $order->get_status() == "processing") {
     201                wp_redirect($order->get_checkout_order_received_url());
     202            } else if ($_GET && $_GET['sessionid'] !== "") {
     203                if ("Success" == $this->slimcd_payment_status($_GET['sessionid'])) {
     204                    wp_redirect($order->get_checkout_order_received_url());
     205                } else {
     206                    wc_add_notice('Issue in payment, Please choose another payment method', 'error');
     207                    wp_redirect(wc_get_checkout_url());
    212208                }
    213209            }
  • slimcd-payment-gateway/trunk/includes/class-slimcd-payment-gateway.php

    r2574473 r2576606  
    196196    public function slimcd_redirect()
    197197    {
    198 
    199198        if (!empty($_GET['order_id'])) {
    200199            $order = wc_get_order($_GET['order_id']);
    201 
    202             if ($order->get_payment_method() == "slimcd_payment") {
    203 
    204 
    205                 if ($_GET && $_GET['sessionid'] !== "") {
    206                     if ("Success" == $this->slimcd_payment_status($_GET['sessionid'])) {
    207                         wp_redirect($order->get_checkout_order_received_url());
    208                     } else {
    209                         wc_add_notice('Issue in payment, Please choose another payment method', 'error');
    210                         wp_redirect(wc_get_checkout_url());
    211                     }
     200            if ($order->get_payment_method() == "slimcd_payment" && $order->get_status() == "processing") {
     201                wp_redirect($order->get_checkout_order_received_url());
     202            } else if ($_GET && $_GET['sessionid'] !== "") {
     203                if ("Success" == $this->slimcd_payment_status($_GET['sessionid'])) {
     204                    wp_redirect($order->get_checkout_order_received_url());
     205                } else {
     206                    wc_add_notice('Issue in payment, Please choose another payment method', 'error');
     207                    wp_redirect(wc_get_checkout_url());
    212208                }
    213209            }
Note: See TracChangeset for help on using the changeset viewer.