How to create order when using payment app onsite?

How to create order when using payment app onsite?

daniloab
Shopify Partner
5 1 0

Hi,

 

Im creating a payment app extension onsite following this documentation https://shopify.dev/docs/apps/build/payments/alternative/build-an-alternative-payment-extension

 

Everything is working:

- configure the payment app in a store

- select the payment in the checkout

- redirect to my payment link url

- pay and return to the shopify checkout

 

One thing that is missing is to create the Order to avoid overselling inside Shopify Checkout. So, when calling my payment app it must create the order and redirect to my payment link.

 

I followed the documentation of `PaymentSessionPending` inside my `payment_session_url`. But, when passing by it returns the following error:

 

paymentSessionPending: {
         paymentSession: null,
         userErrors: [
           {
             field: [ 'id' ],
             message: 'Payment session has already been resolved/rejected, has already been pended with a different reason, or the response to start_payment_session request has not been received.'
           }
         ]
       }  

 So, how to:

- implement the creation of order in my payment app when redirecting to my url

- what am I doing wrong here?

Replies 0 (0)