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

[Checkout] Set Payment Method and Place Order Mutation #716

@pmclain

Description

@pmclain

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
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions