PayPal Payflow Pro payment method
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.
Other PayPal solutions have the same GraphQL workflow as Payflow Pro. The information in this topic also applies to the following PayPal solution:
- Payments Pro
If Payflow Pro has been configured to implement Express Checkout, use the PayPal Express Checkout for Payflow payment method instead.
Payflow Pro workflow
The following diagram shows the workflow for placing an order when Payflow Pro is the selected payment method.
-
On the checkout page, the customer selects Credit Card as the payment method and enters the credit card information as well as the billing and shipping addresses. When the customer clicks Place Order, the PWA client uses the
setPaymentMethodOnCart
mutation to set the payment method topayflowpro
. -
The mutation returns a
Cart
object. -
The client runs the
createPayflowProToken
mutation to initiate a transaction. -
Magento requests a secure token from the PayPal gateway. The request also contains billing and shipping information, which Magento extracts from the
Cart
object. -
The gateway response includes a secure token, a secure token ID, and result codes and descriptions.
-
Magento returns the secure token, a secure token ID, and result codes and descriptions in response to the
createPayflowProToken
mutation. -
The client uses a hidden iframe to send a silent post request directly to the PayPal gateway for account verification. For live requests, send the silent post to
https://payflowlink.paypal.com
. Send test requests tohttps://pilot-payflowlink.paypal.com
. -
The gateway responds directly to the client. The response contains a payload that includes secure token information and billing and shipping information.
-
The client uses the
handlePayflowProResponse
mutation to send the payload to Magento. Magento stores this information without modifying the cart. -
The mutation returns a
Cart
object. -
The client runs the
placeOrder
mutation, which creates an order in Magento and begins the authorization process. -
Magento sends an authorization request to the gateway.
-
The gateway sends the response to Magento.
-
Magento creates an order and sends an order ID in response to the
placeOrder
mutation.
Additional Payment information
When you set the payment method to Payflow Pro in the setPaymentMethodOnCart
mutation, the payment_method
object must contain a payflowpro
object and a CreditCardDetailsInput
object.
payflowpro object
The payflowpro
object must contain the following attributes:
Attribute | Data Type | Description |
---|---|---|
cc_details |
CreditCardDetailsInput! | Required input for credit card related information |
CreditCardDetailsInput object
Magento supports the following values for the cc_type
attribute. The merchant’s payment processor might support only a subset of these values.
AE
- American ExpressAU
- AuraDI
- DiscoverDN
- Diners ClubELO
- EloHC
- HipercardJCB
- JCBMC
- MasterCardMD
- Maestro DomesticMI
- Maestro InternationalUN
- UnionPayVI
- Visa
The CreditCardDetailsInput
object must contain all of the attributes listed below.
Attribute | Data Type | Description |
---|---|---|
cc_exp_month |
Int! | Credit card expiration month |
cc_exp_year |
Int! | Credit card expiration year |
cc_last_4 |
Int! | Last four digits of the credit card |
cc_type |
String! | Credit card type |
Example usage
The following example shows the setPaymentMethodOnCart
mutation constructed for the Payflow Pro payment method.
Request:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
mutation {
setPaymentMethodOnCart(
input: {
cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
payment_method: {
code: "payflowpro"
payflowpro: {
cc_details: {
cc_exp_month: 12
cc_exp_year: 2021
cc_last_4: 1111
cc_type: "VI"
}
}
}
}
) {
cart {
selected_payment_method {
code
title
}
}
}
}
Response:
1
2
3
4
5
6
7
8
9
10
11
12
{
"data": {
"setPaymentMethodOnCart": {
"cart": {
"selected_payment_method": {
"code": "payflowpro"
"title": "Payflow Pro"
}
}
}
}
}