Escrow API for Milestone Transactions payment via Credit card

  0 comments
Share

 

To retrieve an Escrow.com landing page that will allow the user to enter their credit card details, you need to call below endpoint. After completion of payment, the user will be redirected back to the return_url, if provided.

 

<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.escrow-sandbox.com/2017-09-01/transaction/1995346/payment_methods/credit_card', CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERPWD => 'client@drupalchamp.org:233_57fgvc5vIpiqwp6B8Z2986vc4dsfsdftwxHlgpEtOeE5gRPuyzw', //client email:api key(api key must be generated from broker account) CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), CURLOPT_POSTFIELDS => json_encode( array( 'return_url' => 'https://www.google.com/thank-you', //the user will be redirected back to this URL ) ) )); $output = curl_exec($curl); echo $output; curl_close($curl); ?>

If the API call is successful, it will return the Escrow.com landing page that will allow the user to pay via Credit card

Example Response:-- { "landing_page": "https://www.escrow.com/payment-flow/credit_card?auth=23933KJHKCNM" }

You can use drupal_goto function to redirect any page.

drupal_goto('https://www.escrow.com/payment-flow/credit_card?auth=23933KJHKCNM');

Pay with credit card

Once the payment is complete, user will be redirected back to the return_url

Add new comment