Skip to content

Instantly share code, notes, and snippets.

@lastday154
Created November 23, 2017 13:25
Show Gist options
  • Select an option

  • Save lastday154/47d8299ebb6f978ba81b7eb69374b77a to your computer and use it in GitHub Desktop.

Select an option

Save lastday154/47d8299ebb6f978ba81b7eb69374b77a to your computer and use it in GitHub Desktop.
curl request php
<?php
$ch = curl_init('https://pal-test.adyen.com/pal/servlet/Payment/v25/refund');
# Setup request to send json via POST.
$payload = '{
"merchantAccount": "ZaloraTW",
"modificationAmount": {
"currency": "TWD",
"value": 8739100.00
},
"originalReference": "8524990628777503",
"reference": "200171463"
}';
$username = "[email protected]";
$password = "38Ye\c&XfY~-I&pGf?RvYTMiT";
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
curl_close($ch);
# Print response.
echo "<pre>$result</pre>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment