-
-
Save ntalbott/1035533 to your computer and use it in GitHub Desktop.
PHP CURL PUT to Spreedly Core
This file contains 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 | |
$apiLogin = 'Ll6fAtoVSTyVMlJEmtpoJV8Shw5'; | |
$apiSecret = 'RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSylzM2ZzTWFwVH4ucG'; | |
$paymentToken = 'N2V9GWfTgYv4jXAz2vcc4T3i8f6'; | |
$url = 'https://spreedlycore.com/v1/payment_methods/' . $paymentToken . '/retain.xml'; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_USERPWD, $apiLogin . ':' . $apiSecret); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, ""); | |
// Attempt to set content-length to 0 to workaround nginx error... | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/xml')); | |
curl_exec($ch); | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment