Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions _data/toc/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ pages:
- label: PayPal Payflow Pro
url: /graphql/payment-methods/payflow-pro.html

- label: PayPal Payments Advanced
url: /graphql/payment-methods/payments-advanced.html

- label: Tutorial
class: tutorial
url: /graphql/tutorials/checkout/index.html
Expand Down
5 changes: 5 additions & 0 deletions _includes/graphql/payment-methods/payflow-link-attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Attribute | Data Type | Description
--- | --- | ---
`cancel_url` | String! | The URL that PayPal redirects to upon payment cancellation
`error_url` | String! | The URL that PayPal redirects to upon payment error
`return_url` | String! | The URL that PayPal redirects to upon payment success
21 changes: 21 additions & 0 deletions _includes/graphql/payment-methods/payflow-link-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. The PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation to set the payment method.

1. The mutation returns a `Cart` object.

1. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/reference/quote-place-order.html) mutation, which creates an order in Magento and begins the authorization process.

1. Magento requests a secure token from the Paypal gateway.

1. The gateway response includes a secure token, a secure token ID, and the URL to use for requesting the form in step 9. This token secures the data for a one-time transaction and is valid for 30 minutes.

1. The `placeOrder` mutation returns an order ID. Magento does not return secure token information. The order has the status `payment pending`.

1. The client runs the [`getPayflowLinkToken`]({{page.baseurl}}/graphql/reference/paypal-get-payflow-link-token.html) mutation to retrieve the secure token information.

1. Magento returns the token information.

1. The client displays a payment form in an iframe rendered from the URL specified by the `paypal_url` from the `getPayflowLinkToken` mutation response. When the customer completes the form, the client sends the payment information directly to the PayPal gateway, bypassing the Magento server.

1. After PayPal processes the payment, the gateway runs a silent post request against the Magento server. As a result, Magento sets the order status to pending, and the order is ready to be invoiced.

1. The PayPal gateway returns control of the customer's browser to the client.
2 changes: 2 additions & 0 deletions common/images/graphql/paypal-payflow-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions guides/v2.3/graphql/images/paypal-payflow-link.svg

This file was deleted.

32 changes: 4 additions & 28 deletions guides/v2.3/graphql/payment-methods/payflow-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,21 @@ title: PayPal Payflow Link payment method

PayPal [PayFlow Link](https://developer.paypal.com/docs/classic/payflow/integration-guide/) is available for merchants in the United States and Canada only. Customers are not required to have a personal PayPal account. Instead, customers enter their credit card information in a form that is hosted by PayPal.

The Payflow gateway uses a secure token to send non-credit card transaction data to the Payflow server for storage in a way that cannot be intercepted and manipulated maliciously. This token secures the data for a one-time transaction and is valid for 30 minutes. When the AWS client runs the `placeOrder` mutation, Magento requests a secure token. The Payflow server returns the token as a string of up to 32 alphanumeric characters.
The Payflow gateway uses a secure token to send non-credit card transaction data to the Payflow server for storage in a way that cannot be intercepted and manipulated maliciously. This token secures the data for a one-time transaction and is valid for 30 minutes. When the PWA client runs the `placeOrder` mutation, Magento requests a secure token. The Payflow server returns the token as a string of up to 32 alphanumeric characters.

## Payflow Link workflow

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

![PayPal Payflow Link sequence diagram]({{page.baseurl}}/graphql/images/paypal-payflow-link.svg)
![PayPal Payflow Link sequence diagram]({{site.baseurl}}/common/images/graphql/paypal-payflow-link.svg)

1. The PWA client uses the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation to set the payment method to `payflow_link`.

2. The mutation returns a `Cart` object.

3. The client runs the [`placeOrder`]({{page.baseurl}}/graphql/reference/quote-place-order.html) mutation, which creates an order in Magento and begins the authorization process.

4. Magento requests a secure token from the Payflow Link gateway.

5. The gateway response includes a secure token, a secure token ID, and the URL to use for requesting the Payflow form in step 9.

6. The `placeOrder` mutation returns an order ID. Magento does not return secure token information. The order has the status `payment pending`.

7. The client runs the [`getPayflowLinkToken`]({{page.baseurl}}/graphql/reference/paypal-get-payflow-link-token.html) mutation to retrieve the secure token information.

8. Magento returns the token information.

9. The client displays a payment form in an iframe rendered from the URL specified by the `paypal_url` from `getPayflowLinkToken` mutation response. When the customer completes the form, the client sends the payment information directly to the Payflow gateway, bypassing the Magento server.

10. After PayPal processes the payment, the gateway runs a silent post request against the Magento server. As a result, Magento sets the order status to pending, and the order is ready to be invoiced.

11. The Payflow gateway returns control of the customer's browser to the client.
{% include graphql/payment-methods/payflow-link-workflow.md %}

## Additional Payment information

When you set the payment method to Payflow Link in the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation, the `additional_data` object must contain a `payflow_link` object, which defines the following objects:

Attribute | Data Type | Description
--- | --- | ---
`cancel_url` | String! | The URL PayPal will redirect back to upon payment cancellation
`error_url` | String! | The URL PayPal will redirect back to upon payment error
`return_url` | String! | The URL PayPal will redirect back to upon payment success
{% include graphql/payment-methods/payflow-link-attributes.md %}

## Example setPaymentMethodOnCart mutation

Expand Down
70 changes: 70 additions & 0 deletions guides/v2.3/graphql/payment-methods/payments-advanced.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
group: graphql
title: PayPal Payments Advanced payment method
---

The PayPal Payments Advanced payment solution allows merchants to enable their online stores to collect payments directly via credit card, PayPal Express Checkout, or PayPal's PayPal Credit service. From a GraphQL integration standpoint, PayPal Payments Advanced payment method is identical to the PayPal [Payflow Link]({{page.baseurl}}/graphql/payment-methods/payflow-link.html) payment method, with the exception of the payment method `code`. The PayPal [Payments Advanced documentation](https://developer.paypal.com/docs/classic/products/paypal-payments-advanced/) describes other ways in which the payment methods differ.

PayPal Payments Advanced is available in the US and Canada only.

## PayPal Payments Advanced workflow

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

![PayPal Payments Advanced sequence diagram]({{site.baseurl}}/common/images/graphql/paypal-payflow-link.svg)

{% include graphql/payment-methods/payflow-link-workflow.md %}

## Additional Payment information

When you set the payment method code to `payflow_advanced` in the [`setPaymentMethodOnCart`]({{page.baseurl}}/graphql/reference/quote-payment-method.html) mutation, the `additional_data` object must contain a `payflow_link` object, which defines the following attributes:

{% include graphql/payment-methods/payflow-link-attributes.md %}

## Example setPaymentMethodOnCart mutation

The following example shows the `setPaymentMethodOnCart` mutation constructed for the Payments Advanced payment method.

**Request**

```text
mutation {
setPaymentMethodOnCart(input: {
payment_method: {
code: "payflow_advanced"
additional_data: {
payflow_link: {
return_url: "https://www.example.com/payflow/test/return"
error_url: "https://www.example.com/payflow/test/error"
cancel_url: "https://www.example.com/payflow/test/cancel"
}
}
}
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
}) {
cart {
selected_payment_method {
code
title
}
}
}
}
```

**Response**

```json
{
"data": {
"setPaymentMethodOnCart": {
"cart": {
"selected_payment_method": {
"code": "payflow_advanced",
"title": "Credit Card"
}
}
}
}
}
```