Set on-hold PayNow SG Woocommerce

PayNow offers an enhanced funds transfer experience that enables retail customers of the participating banks and NFIs to send and receive Singapore Dollar funds from one bank or e-wallet account to another in Singapore through FAST by using just their mobile number, Singapore NRIC/FIN, or Virtual Payment Address (VPA), instantly. The sender no longer needs to know the recipient’s bank/e-wallet provider and account number when transferring money via PayNow.

SG PayNow for Woocommerce designed for online shops using WooCommerce. Once downloaded, installed, and activated, the plugin allows you to start receiving payments from customers via dynamically generated PayNow QR codes without redirecting them to third-party payment gateways. Customers can use any PayNow-supported mobile apps to make payments directly to your online stores. There are no setup costs, transaction fees, or hidden fees.

By default, the PayNow SG plugin sets the order status to ‘processing’ after payment is completed or submitted. In some cases, you may want to set the status to ‘on-hold’. To do this, you will need to edit the plugin using the plugin editor.

  1. First, open the Plugins file editor in WordPress and select the PayNow SG plugin.
  2. Click on the file sg-paynow.php and find the line that looks like this.
      
       public function process_payment( $order_id ) {
    			    global $woocommerce;
    			    $order = new WC_Order( $order_id );
    
    			    // Mark as on-hold (we're awaiting the cheque)
    			    $order->update_status('processing', __( 'Awaiting to process order.', 'woocommerce' ));
    
    			    // Remove cart
    			    $woocommerce->cart->empty_cart();
    
    			    // Return thankyou redirect
    			    return array(
    			        'result' => 'success',
    			        'redirect' => $this->get_return_url( $order )
    			    );
    		}
      
      
  3. Change the status to 'on-hold' so the code looks like the following.
      
       public function process_payment( $order_id ) {
    			    global $woocommerce;
    			    $order = new WC_Order( $order_id );
    
    			    // Mark as on-hold (we're awaiting the cheque)
    			    $order->update_status('on-hold', __( 'Awaiting to process order.', 'woocommerce' ));
    
    			    // Remove cart
    			    $woocommerce->cart->empty_cart();
    
    			    // Return thankyou redirect
    			    return array(
    			        'result' => 'success',
    			        'redirect' => $this->get_return_url( $order )
    			    );
    		}
      
      

So how ? easy isn't it


0 Response to " Set on-hold PayNow SG Woocommerce"

Post a Comment

Komentar yang Anda kirim akan terlebih dahulu di moderasi oleh Admin