Moltin.Cart().Checkout() does not return order id

orders
checkout
javascript

#1

Like my title says I am wondering why I get no response that should contain the order UUID so I can go and process the order via chosen payment gateway?


#2

Hey @joe :wave:

Can you share the full request and response? The API should return a new order object.


#3

I am not getting anything in my result, all my other services are written the same. I can see the order being added in the moltin dashboard but I get nothing in the response object?

service.ts

checkoutCart(customer, address): Observable <MoltinCartCheckout> {
  const request = this.moltin.Cart(this.cartId).Checkout(customer, address)

  return from(request)
}

component.ts

this.storeService.checkoutCart(customer, address).pipe(
  map(result => function(result) {
    console.log(result)
  }),
  tap(r => console.log(r))
)

#4

@jonathan Any update on this?


#5

Maybe it could be because I am accessing the API implicitly?


#6

@jonathan Still having issues with getting a response that contains the order id can this be done using implicit token?


#7

Hi @joe

What do you get back when you console like the result from checkoutCart?

You should get the id of the order there.

{
	"data": {
		"type": "order",
		"id": "25cdab13-bf0c-41fd-a7ee-ab1765e208d1",
		"status": "incomplete",
		"payment": "unpaid",
		"shipping": "unfulfilled",
		"customer": {
			"name": "Jamie Barton",
			"email": "jamieb@example.com"
		},
		// ...
	}
}

#8

I am using the browser SDK and I am not getting any response back but my order is being created in the dashboard. When I log my response to console I do not see anything


#9

Hi @joe

Inside your Network tabs inside developer tools, what does the request look like and respond with there?

Are you able to share your code on GitHub or deploy it so I can see it working?

Thanks :slight_smile:


#10

@notrab I sent you a pm :slight_smile:


#11

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.