Plugin Directory

Changeset 3185786


Ignore:
Timestamp:
11/11/2024 02:13:26 PM (17 months ago)
Author:
bigmaster
Message:

updated on-hold to completed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • payaza/trunk/includes/class-wc-gateway-payaza.php

    r3183219 r3185786  
    456456   
    457457        // Simulate payment success for testing. Replace with actual payment success check.
    458         //$payment_success = true;
     458        $payment_success = true;
    459459   
    460460        if ( $payment_success ) {
     
    474474        return array(
    475475            'result'   => 'success',
    476             'redirect' => $this-> receipt_page( $order_id )
     476            'redirect' => $order->get_checkout_payment_url(true),
    477477        );
    478478    }
     
    554554        }
    555555
    556         if ( 'redirect' === $this->payment_page ) {
    557             return $this->process_redirect_payment_option( $order_id );
    558         }
     556   
    559557
    560558        return array(
     
    567565   
    568566
    569     // public function process_payment( $order_id ) {
    570        
    571    
    572     //  $order = wc_get_order( $order_id );
    573        
    574    
    575     //  if ( ! $order || $this->id !== $order->get_payment_method() ) {
    576     //      return;
    577     //  }
    578    
    579     //  $order_key = isset( $_GET['key'] ) ? sanitize_text_field( wp_unslash( $_GET['key'] ) ) : '';
    580    
    581     //  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    582     //  wp_enqueue_script( 'jquery' );
    583     //  wp_enqueue_script( 'payaza', 'https://checkout-v2.payaza.africa/js/v1/bundle.js', array( 'jquery' ), WC_PAYAZA_VERSION, false );
    584     //  wp_enqueue_script( 'wc_payaza', plugins_url( 'assets/js/payaza' . $suffix . '.js', WC_PAYAZA_MAIN_FILE ), array( 'jquery', 'payaza' ), WC_PAYAZA_VERSION, false );
    585    
    586     //  $payaza_params = array(
    587     //      'key'            => $this->public_key,
    588     //      'connection_mode'=> $this->testmode ? 'test' : 'Live',
    589     //      'email'          => $order->get_billing_email(),
    590     //      'first_name'     => $order->get_billing_first_name(),
    591     //      'last_name'      => $order->get_billing_last_name(),
    592     //      'phone_number'   => $order->get_billing_phone(),
    593     //      'amount'         => $order->get_total() * 100,
    594     //      'txnref'         => $order_id . '_' . time(),
    595     //      'currency'       => $order->get_currency(),
    596     //  );
    597    
    598     //  update_post_meta( $order_id, '_payaza_txn_ref', $payaza_params['txnref'] );
    599     //  $order->save();
    600        
    601 
    602        
    603     //  wp_localize_script( 'wc_payaza', 'wc_payaza_params', $payaza_params );
    604 
    605     //  //$order->update_status( 'on-hold',  __('Awaiting Payment' , 'woo-payaza' ) );
    606     //     //$order->reduce_order_stock();
    607        
    608     //  //WC()->cart->empty_cart();
    609     //  return array(
    610     //      'result'   => 'success',
    611     //      'redirect' => esc_url( $order->get_checkout_payment_url(true))
    612     //      //'redirect' => $this->get_return_url($order),
    613     //  );
    614 
    615        
    616 
    617     // }
    618    
    619567       
    620568    /**
Note: See TracChangeset for help on using the changeset viewer.