#kwac-plugin-error

1 messages · Page 1 of 1 (latest)

floral stirrupBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

tulip elm
#

`
public function process_payment( $order_id ) {

        $order = wc_get_order( $order_id );

        $status = 'wc-' === substr( $this->order_status, 0, 3 ) ? substr( $this->order_status, 3 ) : $this->order_status;
        
        $payment_intent = \Stripe\PaymentIntent::create(array(
        'amount'   => $order->get_total() * 100,
        'currency' => strtolower( get_woocommerce_currency() ),
        'payment_method' => $order->get_payment_method(),
        'confirmation_method' => 'manual',
        'confirm' => true,
         ));

        // Set order status
        $order->update_status( $status, __( 'Checkout with custom payment. ', $this->domain ) );

        // or call the Payment complete
        // $order->payment_complete();


        // Remove cart
        WC()->cart->empty_cart();

        // Return thankyou redirect
        return array(
            'result'    => 'success',
            'redirect'  => $this->get_return_url( $order )
        );
    }

`

cloud gazelle
#

Hello! Can you share a request ID that's giving you the error?

tulip elm
#

request id? im sorry i dont understand as im new in this

#

where can i find this request id?

cloud gazelle
tulip elm
#

req_G7PlJedtVr72Ww

cloud gazelle
#

So it looks like your code is directly passing us custom for a Payment Method, when we're really expecting an ID like pm_123.

You need to debug you're code (likely something wrong with the $order) to see what could be going wrong

tulip elm
#

Okay thank you I won't bother you anymore I will look through it.