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

Update braintree-vault.md #8345

Merged
merged 2 commits into from
Dec 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions src/guides/v2.3/graphql/payment-methods/braintree-vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following diagram shows the workflow for placing an order when Braintree Vau

1. 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`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) 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`](#braintree_cc_vault-object).
When the customer selects a stored payment method, the PWA uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation to set the payment method to [`braintree_cc_vault`](#braintree_cc_vault-object). The vaulted public hash is passed with other optional properties in the `braintree_cc_vault`.

1. Magento returns a `Cart` object.

Expand All @@ -35,7 +35,7 @@ The following diagram shows the workflow for placing an order when Braintree Vau
## `setPaymentMethodOnCart` mutation

When you set the payment method to Braintree in the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html)
mutation, the `payment_method` object must contain a `braintree_cc_vault` object.
mutation, the `payment_method` object must contain a [`braintree_cc_vault`](#braintree_cc_vault-object) object.

### braintree_cc_vault object

Expand All @@ -54,18 +54,20 @@ The following example shows the `setPaymentMethodOnCart` mutation constructed fo

```graphql
mutation {
setPaymentMethodOnCart(input: {
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
payment_method: {
code: "braintree_cc_vault"
braintree_cc_vault: {
public_hash: "fake-public-hash"
setPaymentMethodOnCart(
input: {
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
payment_method: {
code: "braintree_cc_vault"
braintree_cc_vault: { public_hash: "fake-public-hash" }
}
}
}) {
cart {
selected_payment_method {
code
) {
cart {
selected_payment_method {
code
title
}
}
}
}
Expand All @@ -80,6 +82,7 @@ mutation {
"cart": {
"selected_payment_method": {
"code": "braintree_cc_vault"
"title": "Stored Cards"
}
}
}
Expand Down