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

Commit 47574a1

Browse files
authored
Merge pull request #7714 from magento/kh_payflow-vault
GraphQL: Add support for Vault on Payflow Pro
2 parents b308881 + fa1554c commit 47574a1

File tree

7 files changed

+203
-2
lines changed

7 files changed

+203
-2
lines changed

src/_data/toc/graphql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ pages:
318318
- label: PayPal Payflow Pro
319319
url: /graphql/payment-methods/payflow-pro.html
320320

321+
- label: PayPal Payflow Pro Vault
322+
url: /graphql/payment-methods/payflow-pro-vault.html
323+
exclude_versions: ["2.3"]
324+
321325
- label: PayPal Payments Advanced
322326
url: /graphql/payment-methods/payments-advanced.html
323327

src/common/images/graphql/paypal-payflow-pro-vault.svg

Lines changed: 3 additions & 0 deletions
Loading

src/guides/v2.3/graphql/payment-methods/braintree-vault.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following diagram shows the workflow for placing an order when Braintree Vau
2020

2121
1. The client renders the token information, and the customer selects a payment method.
2222

23-
When the customer clicks **Place Order**, 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).
23+
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).
2424

2525
1. Magento returns a `Cart` object.
2626

src/guides/v2.4/graphql/mutations/set-payment-method.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Supported online payment methods include:
2020
- [PayPal Express Checkout]({{page.baseurl}}/graphql/payment-methods/paypal-express-checkout.html)
2121
- [PayPal Payflow Link]({{page.baseurl}}/graphql/payment-methods/payflow-link.html)
2222
- [PayPal Payflow Pro]({{page.baseurl}}/graphql/payment-methods/payflow-pro.html)
23+
- [PayPal Payflow Pro Vault]({{page.baseurl}}/graphql/payment-methods/payflow-pro-vault.html)
2324
- [PayPal Payments Advanced]({{page.baseurl}}/graphql/payment-methods/payments-advanced.html)
2425
- [PayPal Website Payments Pro Hosted Solution]({{page.baseurl}}/graphql/payment-methods/hosted-pro.html)
2526
- [Express Checkout for other PayPal solutions]({{page.baseurl}}/graphql/payment-methods/payflow-express.html)
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
group: graphql
3+
title: PayPal Payflow Pro Vault payment method
4+
---
5+
6+
PayPal Payflow Pro Vault payment method processes credit and debit card payments using information stored in the Magento vault. This payment method is available for customers of the United States, Canada, Australia, and New Zealand.
7+
8+
The following conditions must be true to use this payment method:
9+
10+
- The shopper must be a logged-in customer.
11+
12+
- The customer must have previously saved their payment information in the Magento vault.
13+
14+
You cannot use this payment method if the customer decides to use a credit or debit card that is not stored in the Magento vault.
15+
16+
If the customer's stored payment information becomes outdated, use the [deletePaymentToken mutation]({{page.baseurl}}/graphql/mutations/delete-payment-token.html) to remove the token. Then perform the actions described in the [PayPal Payflow Pro payment method]({{page.baseurl}}/graphql/) to generate a new token and process the order.
17+
18+
{:.bs-callout-info}
19+
Use the [`storeConfig` query]({{page.baseurl}}/graphql/queries/store-config.html) and specify the `payment_payflowpro_cc_vault_active` attribute to determine whether the Vault feature is enabled for Payflow Pro.
20+
21+
## Payflow Pro workflow
22+
23+
The following diagram shows the workflow for placing an order when Payflow Pro Vault is the selected payment method.
24+
25+
![PayPal Payflow Pro Vault sequence diagram]({{site.baseurl}}/common/images/graphql/paypal-payflow-pro-vault.svg)
26+
27+
1. Use the [`customerPaymentTokens`]({{page.baseurl}}/graphql/queries/customer-payment-tokens.html) query to retrieve the payment tokens the customer has stored in the vault.
28+
29+
1. Magento returns an array of payment tokens.
30+
31+
1. The client renders the token information, and the customer selects a payment method.
32+
33+
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 `payflowpro_cc_vault`. The vaulted public hash is passed in the [`payflowpro_cc_vault`](#payflowpro_cc_vault) object.
34+
35+
1. Magento returns a `Cart` object.
36+
37+
1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/mutations/place-order.html) mutation.
38+
39+
1. Magento sends an authorization request to the gateway.
40+
41+
1. The gateway sends the response to Magento.
42+
43+
1. Magento creates an order and sends an order ID in response to the `placeOrder` mutation.
44+
45+
## Additional Payment information
46+
47+
When you set the payment method to Payflow Pro Vault in the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation, the `payment_method` object must contain a `payflowpro_cc_vault` object, which contains the customer's public hash.
48+
49+
### payflowpro_cc_vault attributes {#payflowpro_cc_vault}
50+
51+
The `payflowpro_cc_vault` object must contain the following attribute:
52+
53+
Attribute | Data Type | Description
54+
--- | --- | ---
55+
`public_hash` | String! | The public hash of the payment token
56+
57+
### Example usage
58+
59+
The following example shows the `setPaymentMethodOnCart` mutation constructed for the Payflow Pro payment method.
60+
61+
**Request:**
62+
63+
```graphql
64+
mutation {
65+
setPaymentMethodOnCart(input: {
66+
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
67+
payment_method: {
68+
code: "payflowpro_cc_vault"
69+
payflowpro_cc_vault: {
70+
public_hash: "<public-hash-value>"
71+
}
72+
}
73+
}
74+
})
75+
{
76+
cart {
77+
selected_payment_method {
78+
code
79+
}
80+
}
81+
}
82+
```
83+
84+
**Response:**
85+
86+
```json
87+
{
88+
"data": {
89+
"setPaymentMethodOnCart": {
90+
"cart": {
91+
"selected_payment_method": {
92+
"code": "payflowpro_cc_vault"
93+
}
94+
}
95+
}
96+
}
97+
}
98+
```

src/guides/v2.4/graphql/payment-methods/payflow-pro.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
group: graphql
3+
title: PayPal Payflow Pro payment method
4+
---
5+
6+
Payflow Pro is a payment gateway that processes debit and credit card payments. It is available for customers of the United States, Canada, Australia, and New Zealand.
7+
8+
Other PayPal solutions have the same GraphQL workflow as Payflow Pro. The information in this topic also applies to the following PayPal solution:
9+
10+
- Payments Pro
11+
12+
If Payflow Pro has been configured to implement Express Checkout, use the [PayPal Express Checkout for Payflow payment method]({{page.baseurl}}/graphql/payment-methods/payflow-express.html) instead.
13+
14+
{:.bs-callout-info}
15+
If the `is_active_payment_token_enabler` attribute is set to `1` (true), in future orders, the logged-in customer can use the [Payflow Pro Vault payment method]({{page.baseurl}}/graphql/payment-methods/payflow-pro-vault.html).
16+
17+
## Payflow Pro workflow
18+
19+
The following diagram shows the workflow for placing an order when Payflow Pro is the selected payment method.
20+
21+
![PayPal Payflow Pro sequence diagram]({{site.baseurl}}/common/images/graphql/paypal-payflow-pro.svg)
22+
23+
{% include graphql/payment-methods/payflow-pro-workflow.md %}
24+
25+
## Additional Payment information
26+
27+
When you set the payment method to Payflow Pro in the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/mutations/set-payment-method.html) mutation, the `payment_method` object must contain a `payflowpro` object and a `CreditCardDetailsInput` object.
28+
29+
### payflowpro object
30+
31+
The `payflowpro` object must contain the following attributes:
32+
33+
Attribute | Data Type | Description
34+
--- | --- | ---
35+
`cc_details` | CreditCardDetailsInput! | Required input for credit card related information
36+
`is_active_payment_token_enabler` | Boolean | States whether details about the customer's credit/debit card should be tokenized for later use. Required only if Vault is enabled for PayPal Payflow Pro payment integration.
37+
38+
### CreditCardDetailsInput object
39+
40+
The `CreditCardDetailsInput` object must contain the following attributes:
41+
42+
Attribute | Data Type | Description
43+
--- | --- | ---
44+
`cc_exp_month` | Int! | Credit card expiration month
45+
`cc_exp_year` | Int! | Credit card expiration year
46+
`cc_last_4` | Int! | Last four digits of the credit card
47+
`cc_type` | String! | Credit card type
48+
49+
### Example usage
50+
51+
The following example shows the `setPaymentMethodOnCart` mutation constructed for the Payflow Pro payment method.
52+
53+
**Request:**
54+
55+
```graphql
56+
mutation {
57+
setPaymentMethodOnCart(input: {
58+
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
59+
payment_method: {
60+
code: "payflowpro"
61+
payflowpro: {
62+
cc_details: {
63+
cc_exp_month: 12
64+
cc_exp_year: 2023
65+
cc_last_4: 1111
66+
cc_type: "VI"
67+
}
68+
is_active_payment_token_enabler: 1
69+
}
70+
}
71+
})
72+
{
73+
cart {
74+
selected_payment_method {
75+
code
76+
}
77+
}
78+
}
79+
```
80+
81+
**Response:**
82+
83+
```json
84+
{
85+
"data": {
86+
"setPaymentMethodOnCart": {
87+
"cart": {
88+
"selected_payment_method": {
89+
"code": "payflowpro"
90+
}
91+
}
92+
}
93+
}
94+
}
95+
```

src/guides/v2.4/graphql/queries/store-config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ Attribute | Data Type | Description | Default or example value
290290
`magento_reward_points_review` | String | The number of points for writing a review | null
291291
`minimum_password_length` | String | The minimum number of characters required for a valid password. <br/>Configuration path: customer/password/minimum_password_length | 6
292292
`no_route` | String | Contains the URL of the default page that you want to appear when if a 404 “Page not Found” error occurs | `cms/noroute/index`
293+
`payment_payflowpro_cc_vault_active` | String | Payflow Pro vault status | `0` (inactive) or `1` (active)
293294
`product_fixed_product_tax_display_setting` | [FixedProductTaxDisplaySettings](#FixedProductTaxDisplaySettings) | Corresponds to the **Display Prices On Product View Page** field. It indicates how Fixed Product Taxes information is displayed on product pages | FPT_DISABLED
294295
`product_url_suffix` | String | The suffix applied to product pages, such as `.htm` or `.html` | `.html`
295296
`required_character_classes_number` | String | The number of different character classes required in a password (lowercase, uppercase, digits, special characters). <br/>Configuration path: customer/password/required_character_classes_number | 2

0 commit comments

Comments
 (0)