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.
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.
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
setPaymentMethodOnCartmutation to set the payment method topayflowpro.The mutation returns a
Cartobject.The client runs the
createPayflowProTokenmutation to initiate a transaction.The application requests a secure token from the PayPal gateway. The request also contains billing and shipping information, which the application extracts from the
Cartobject.The gateway response includes a secure token, a secure token ID, and result codes and descriptions.
The application returns the secure token, a secure token ID, and result codes and descriptions in response to the
createPayflowProTokenmutation.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
handlePayflowProResponsemutation to send the payload to the application. The application stores this information without modifying the cart.The mutation returns a
Cartobject.The client runs the
placeOrdermutation, which creates an order and begins the authorization process.The application sends an authorization request to the gateway.
The gateway sends the response to Magento.
The application creates an order and sends an order ID in response to the
placeOrdermutation.
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 |
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. |
CreditCardDetailsInput object
The CreditCardDetailsInput object must contain the following attributes:
| 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:
Copied to your clipboardmutation {setPaymentMethodOnCart(input: {cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"payment_method: {code: "payflowpro"payflowpro: {cc_details: {cc_exp_month: 12cc_exp_year: 2023cc_last_4: 1111cc_type: "VI"}is_active_payment_token_enabler: 1}}}){cart {selected_payment_method {code}}}
Response:
Copied to your clipboard{"data": {"setPaymentMethodOnCart": {"cart": {"selected_payment_method": {"code": "payflowpro"}}}}}