Created
November 23, 2017 13:25
-
-
Save lastday154/47d8299ebb6f978ba81b7eb69374b77a to your computer and use it in GitHub Desktop.
curl request php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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