Plugin Directory

Changeset 2009809


Ignore:
Timestamp:
01/10/2019 12:04:14 PM (7 years ago)
Author:
RemitaNet
Message:

Fixed for Error on Payment Error Message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remita-payment-gateway/trunk/woocommerce_remita.php

    r1969954 r2009809  
    7373            $this->remita_mode            = $this->settings['remita_mode'];
    7474            $this->remita_checkout_method = $this->settings['remita_checkout_method'];
    75             $this->thanks_message         = $this->settings['thanks_message'];
    76             $this->error_message          = $this->settings['error_message'];
    7775            $this->feedback_message       = '';
    7876            add_action('woocommerce_receipt_remita', array(
     
    254252
    255253                } else if ($this->remita_mode == 'Live') {
    256                     $remitaQueryUrl = 'https://remita.net/payment/v1/payment/query/' . $_REQUEST['transactionId'];
     254                    $remitaQueryUrl = 'https://login.remita.net/payment/v1/payment/query/' . $_REQUEST['transactionId'];
    257255                }
    258256                $publicKey = $this->publicKey;
     
    296294                $paymentReference = $result_response['responseData']['0']['paymentReference'];
    297295
     296                $order_details = explode('_', $result_response['responseData']['0']['transactionId']);
     297
     298                $order_id = (int) $order_details[1];
     299
     300
     301                $order = wc_get_order($order_id);
     302
    298303                if ($result_response['responseCode'] == '00') {
    299 
    300                     $order_details = explode('_', $result_response['responseData']['0']['transactionId']);
    301 
    302                     $order_id = (int) $order_details[1];
    303 
    304 
    305                     $order = wc_get_order($order_id);
    306304
    307305                    if (in_array($order->get_status(), array(
     
    345343
    346344
     345                } elseif ($result_response['responseCode'] == '34'){
     346
     347                    $notice = '<strong>API HASHING ERROR.<br /> Please ensure you have valid credentials on your Admin Panel .</strong>';
     348
     349                    $notice_type = 'notice';
     350
     351
     352                    wc_add_notice($notice, $notice_type);
     353
    347354                } else {
    348 
    349                     $order_details = explode('_', $result_response['responseData']['0']['transactionId']);
    350 
    351                     $order_id = (int) $order_details[1];
    352 
    353 
    354                     $order = wc_get_order($order_id);
    355355
    356356                    $order->update_status('failed', 'Payment was declined by REmita.');
     
    398398            } else if ($this->remita_mode == 'Live') {
    399399
    400                 $jsFile = "https://remita.net/payment/v1/remita-pay-inline.bundle.js";
     400                $jsFile = "https://login.remita.net/payment/v1/remita-pay-inline.bundle.js";
    401401
    402402            }
Note: See TracChangeset for help on using the changeset viewer.