I am using an API in which CURL is required for use.
Here is the code:
<?
curl -v -X POST https://sandbox.bluesnap.com/services/2/transactions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"amount": 11,
"recurringTransaction": "ECOMMERCE",
"merchantTransactionId": 3,
"softDescriptor": "DescTest",
"cardHolderInfo": {
"firstName": "test first name",
"lastName": "test last name"
},
"currency": "GBP",
"creditCard": {
"expirationYear": 2018,
"securityCode": 837,
"expirationMonth": "02",
"cardNumber": 4263982640269299
},
"cardTransactionType": "AUTH_CAPTURE"
}'
?>
Please provide an exact conversion of the CURL code to make it work within PHP.