Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function process_payment( $order_id ) {
- $order = wc_get_order( $order_id );
- $cart_total = WC()->cart->total;
- // code to capture payment and status
- if(success){
- $order->payment_complete();
- return array(
- 'result' => 'success',
- 'redirect' => $this->get_return_url( $order )
- );
- }
- else{
- wc_add_notice( "Unable to process.", 'error' );
- return array(
- 'result' => 'failure',
- 'message' => 'Unable to process.',
- );
- }
- }
Add Comment
Please, Sign In to add comment