Changeset 3185786
- Timestamp:
- 11/11/2024 02:13:26 PM (17 months ago)
- File:
-
- 1 edited
-
payaza/trunk/includes/class-wc-gateway-payaza.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
payaza/trunk/includes/class-wc-gateway-payaza.php
r3183219 r3185786 456 456 457 457 // Simulate payment success for testing. Replace with actual payment success check. 458 //$payment_success = true;458 $payment_success = true; 459 459 460 460 if ( $payment_success ) { … … 474 474 return array( 475 475 'result' => 'success', 476 'redirect' => $ this-> receipt_page( $order_id )476 'redirect' => $order->get_checkout_payment_url(true), 477 477 ); 478 478 } … … 554 554 } 555 555 556 if ( 'redirect' === $this->payment_page ) { 557 return $this->process_redirect_payment_option( $order_id ); 558 } 556 559 557 560 558 return array( … … 567 565 568 566 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 619 567 620 568 /**
Note: See TracChangeset
for help on using the changeset viewer.