Pay quicker sandbox method CURL

<?php
$url1 ="https://identity.mypayquicker.xyz/core/connect/token";
$vission  = http_build_query(array(
      'grant_type'=>'client_credentials',
      'scope'=>'api useraccount_balance useraccount_debit useraccount_payment useraccount_invitation',
      'client_id' => 'client_demo_VAjsSz4QjWpPtGxU9KA8fN7rZb3ceLzRZxArUjUQ_sandbox',
      'client_secret' => 'fmSj4DwEjkMygJgHTRj3d6G7W9kPKYyEuZZMbJJL9mLd7EH7UzMa9amtqzxt'
   ));
$curl = curl_init($url1);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array(
    'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',
    ));
curl_setopt($curl, CURLOPT_POSTFIELDS, $vission);
$json_response = curl_exec($curl);
$response = json_decode($json_response, true);
curl_close($curl);
$accesstoken = $response['access_token'];

$url1 ="https://platform.mypayquicker.xyz/api/v1/companies/accounts/payments";
$vission  = '{"Payments":
    [{
        "fundingAccountPublicId": "14839d3f5e4442bea9858ef35bc68600",   
        "monetary":
        {
        "amount": "0.05",
        "currency": "Currency_USD"
        },
        "userCompanyAssignedUniqueKey": "emp001",
        "userNotificationEmailAddress": "kevin.nuwer+0@gmail.com"
    }]}';


$curl = curl_init($url1);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  
curl_setopt($curl, CURLOPT_POST, true);
 curl_setopt($curl, CURLOPT_HTTPHEADER,
            array(
  "Authorization: Bearer $accesstoken", 
  "Accept:application/json; charset=utf-8",
  "X-MyPayQuicker-Version:10-11-2016",
  "Content-Type:  application/json"
));
    curl_setopt($curl, CURLOPT_POSTFIELDS, $vission);

    $json_response = curl_exec($curl);

 $response = json_decode($json_response, true);
  
    curl_close($curl);
var_dump($response);


?>

Share this

Related Posts

Previous
Next Post »

Pageviews from the past week