Edit in GitHubLog an issue
Thanks to Something Digital (now Rightpoint) for contributing this topic!

Braintree Vault payment method

Braintree Vault is a payment gateway that processes debit and credit card payments from the Magento_Vault.

Braintree Vault workflow

The following diagram shows the workflow for placing an order when Braintree Vault is the selected payment method.

Braintree sequence diagram

  1. Use the customerPaymentTokens query to retrieve the payment tokens the customer has stored in the vault.

  2. The application returns an array of payment tokens.

  3. The client renders the token information, and the customer selects a payment method.

    When the customer selects a stored payment method, the PWA uses the setPaymentMethodOnCart mutation to set the payment method to braintree_cc_vault. The vaulted public hash is passed with other optional properties in the braintree_cc_vault.

  4. The application returns a Cart object.

  5. The client runs the placeOrder mutation.

  6. The application sends an authorization request to the gateway.

  7. The gateway sends the response to Magento.

  8. The application creates an order and sends an order ID in response to the placeOrder mutation.

setPaymentMethodOnCart mutation

When you set the payment method to Braintree in the setPaymentMethodOnCart mutation, the payment_method object must contain a braintree_cc_vault object.

braintree_cc_vault object

The braintree_cc_vault object must contain the following attributes:

AttributeData TypeDescription
public_hash
String!
Required input for Magento_Vault public hash for the selected stored payment method
device_data
String
Optional. JSON-encoded device data for Kount integration

Example Usage

The following example shows the setPaymentMethodOnCart mutation constructed for the Braintree Vault payment method.

Request:

Copied to your clipboard
mutation {
setPaymentMethodOnCart(
input: {
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
payment_method: {
code: "braintree_cc_vault"
braintree_cc_vault: { public_hash: "fake-public-hash" }
}
}
) {
cart {
selected_payment_method {
code
title
}
}
}
}

Response:

Copied to your clipboard
{
"data": {
"setPaymentMethodOnCart": {
"cart": {
"selected_payment_method": {
"code": "braintree_cc_vault"
"title": "Stored Cards"
}
}
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.