我正在使用需要使用CURL的API。
以下是代码:
<?
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"
}'
?>
请准确转换CURL代码,使其在PHP中运行。