Credit Card Flow | Magento Braintree | Paypal Payflow Pro | Pk Magento 2
Credit Card Flow | Magento Braintree | Paypal Payflow Pro
-
Users add products in cart then move on checkout.
-
User full fill all required fields then select shipping method and payment method
-
If payment is selected as Braintree credit card. Then user enters card details
-
Then Magento to validate all other field data like billing address, shipping address and shipping method etc.
-
Then User clicks on “place order” button.
-
Magento sends validation request to Braintree with Braintree (Merchant) credentials and Card Details.
-
After successful validation, Braintree sends back response token to Magento on real-time.
-
Magento now sends “Token, customer details & order details” to Braintree.
*details like customer billing & shipping address, item total, discount., order ID etc.
-
Braintree validates the card details through token and charge the amount to customer and sends back response to Magento in real-time with below responses
-
Success – Response contains Success array
-
False– Response contains the Error details
-
Null – Blank Array with no details
“Null” response is not handled currently which needs to be solutionized
Request example in json.
‘request’ =>
array (
‘customer’ =>
array (
‘firstName‘ => ‘xxrri-xxynn’,
‘lastName‘ => ‘McKillop’,
‘company’ => ”,
‘phone’ => ‘xxxxxxx’,
’email’ => ‘xxxx@outlook.com’,
),
‘amount’ => ‘189.99’,
‘paymentMethodNonce‘ => ‘tokencc_bd_wyn4wk_657vx3_gfkg9s_t85xkq_vr3’,
‘orderId‘ => ‘xx171241xxx38921’,
‘channel’ => ‘MagxxxxxeneBT’,
‘options’ =>
array (
‘skipAdvancedFraudChecking‘ => false,
‘storeInVaultOnSuccess‘ => true,
‘submitForSettlement‘ => true,
),
‘customFields‘ =>
array (
),
‘billing’ =>
array (
‘firstName‘ => ‘Terri-Lynn’,
‘lastName‘ => ‘McKillop’,
‘company’ => ”,
‘streetAddress‘ => ‘724 xxxtherine Street’,
‘extendedAddress‘ => ”,
‘locality’ => ‘thunder bay’,
‘region’ => ‘ON’,
‘postalCode‘ => ‘p7xxx’,
‘countryCodeAlpha2’ => ‘CA’,
),
‘shipping’ =>
array (
‘firstName‘ => ‘Terri-Lynn’,
‘lastName‘ => ‘McKillop’,
‘company’ => NULL,
‘streetAddress‘ => ‘724 Catherine Street’,
‘extendedAddress‘ => ”,
‘locality’ => ‘thunder bay’,
‘region’ => ‘ON’,
‘postalCode‘ => ‘p7e1l5’,
‘countryCodeAlpha2’ => ‘CA’,
‘countryCodeAlpha3’ => ‘CAN’,
),
‘purchaseOrderNumber‘ => ‘xxx’,
‘taxAmount‘ => ‘21.86’,
‘discountAmount‘ => ‘137.57’,
Response sample
Null
Failed
Response sample
‘client’ => ‘PayPal\Braintree\Gateway\Http\Client\TransactionSale‘,
‘response’ =>
array (
‘success’ => true,
” . “