This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Description
Preconditions (*)
The current frontend workflow allows setting payment methods and placing order in a single request.
@joni-jones notes in #392
It doesn't make sense to call SetPaymentMethodOnCart and PlaceOrder resolvers separately for Braintree (now it's done because PlaceOrder resolver doesn't set payment details). The current flow does place an order through payment-information REST API call which sets payment information and places the order.
The main problem in two separate calls that some data might be changed during these calls, like fraud fingerprints and the payment data won't be actual anymore.
A proposed schema for facilitating is below:
type Mutation {
setPaymentandPlaceOrder(input: SetPaymentMethodOnCartInput): PlaceOrderOutput
}
Example mutation:
mutation {
setPaymentandPlaceOrder(input:{
cart_id:$cartId
payment_method:{
code:"braintree"
braintree:{
is_active_payment_token_enabler:false
payment_method_nonce:"fake-valid-nonce"
}
}
}) {
order {
order_id
}
}
}