Plugin Directory

Changeset 2188392


Ignore:
Timestamp:
11/08/2019 12:30:21 PM (6 years ago)
Author:
idsbdigital
Message:

update to 1.4

Location:
idpay/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • idpay/trunk/index.php

    r2186073 r2188392  
    55 * Plugin URI: https://idpay.my
    66 * Description: Enable payment by salary deduction. Currently IDPay service is only available for customer that working as government servants in Malaysia.
    7  * Version: 1.3
     7 * Version: 1.4
    88 * Author: IDSB Digital Sdn. Bhd.
    99 * Author URI: https://idsb.my
     
    199199                if ($order) {
    200200                    $order->add_order_note('Request for salary deduction has been submitted to IDPay. Waiting for eligibility check.');
    201                     $order->update_status('pending');
     201                    $order->update_status('on-hold');
    202202                    $woocommerce->cart->empty_cart();
    203203                }
     
    225225                            break;
    226226                        case 'eligible':
    227                             $order->add_order_note('Customer is eligible for this transaction. Please provide AG/BPA form to customer for employer verification and send it to IDPay office to proceed');
    228                             $order->update_status('on-hold');
     227                            $order->add_order_note('Customer is eligible for this transaction. Please provide AG/BPA form to customer and deliver the signed form to IDPay office to process');
    229228                            break;
    230229                        case 'not_eligible':
     
    237236                            break;
    238237                        case 'submitted':
    239                             $order->add_order_note('IDPay transaction number is '. $transaction_number);
     238                            if (!get_post_meta($order_id, '_idpay_transaction', true)) {
     239                                $order->add_order_note('IDPay transaction number is '. $transaction_number);
     240                                add_post_meta($order_id, '_idpay_transaction', $transaction_number, true);
     241                            }
    240242                            break;
    241243                    }
     
    308310        $customer_orders = wc_get_orders(array(
    309311            'limit' => -1,
    310             'status' => 'pending'
     312            'status' => 'on-hold'
    311313        ));
    312314
    313         // Iterating through each Order with pending status
     315        // Iterating through each Order with on-hold status
    314316        foreach ($customer_orders as $order) {
    315317            $order_id = version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id();
     
    333335                        break;
    334336                    case 'eligible':
    335                         $order->add_order_note('Customer is eligible for this transaction. Please provide AG/BPA form to customer for employer verification and send it to IDPay office to proceed');
    336                         $order->update_status('on-hold');
     337                        $order->add_order_note('Customer is eligible for this transaction. Please provide AG/BPA form to customer and deliver the signed form to IDPay office to process');
    337338                        break;
    338339                    case 'not_eligible':
     
    345346                        break;
    346347                    case 'submitted':
    347                         $order->add_order_note('IDPay transaction number is '. $transaction_number);
     348                        if (!get_post_meta($order_id, '_idpay_transaction', true)) {
     349                            $order->add_order_note('IDPay transaction number is '. $transaction_number);
     350                            add_post_meta($order_id, '_idpay_transaction', $transaction_number, true);
     351                        }
    348352                        break;
    349353                }
  • idpay/trunk/readme.txt

    r2186073 r2188392  
    3030== Changelog ==
    3131
     32= 1.4 =
     33* change status to on-hold to avoid WC auto cancel unpaid order
     34* add txn id meta to order to avoid duplicate order note
     35
    3236= 1.3 =
    3337* add transaction number to WC order note
Note: See TracChangeset for help on using the changeset viewer.