I am re posting this issue because its already asked. But nobody answer that question. i am into the problem while integrating sage pay api into my web page.
i am following the documentation of sage pay. Everything is going fine and smooth but when i am going to make a transaction and make a request to link https://pi-test.sagepay.com/api/v1/transactions it give me the response error
stdClass Object ( [description] => Incorrect request format [code] => 1000 )
i did the same as mentioned on their documentation even i tried to use the same keys and credentials they are using in the example but it gives me the same error at the point of transaction.
My transaction request code is
curl_setopt_array($curl, array(
CURLOPT_URL => "https://pi-test.sagepay.com/api/v1/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{' .
'"transactionType": "Payment",' .
'"paymentMethod": {' .
' "card": {' .
' "merchantSessionKey": "' . $merchant_session_key . '",' .
' "cardIdentifier": "' . $cardIdentifier . '",' .
' "save": "false",' .
' }' .
'},' .
'"vendorTxCode": "demotransaction' . time() . '",' .
'"amount": 10000,' .
'"currency": "GBP",' .
'"description": "Demo transaction",' .
'"apply3DSecure": "UseMSPSetting",' .
'"customerFirstName": "Sam",' .
'"customerLastName": "Jones",' .
'"billingAddress": {' .
' "address1": "407 St. John Street",' .
' "city": "London",' .
' "postalCode": "EC1V 4AB",' .
' "country": "GB"' .
'},' .
'"entryMethod": "Ecommerce"' .
'}',
CURLOPT_HTTPHEADER => array(
"Authorization: Basic aEpZeHN3N0hMYmo0MGNCOHVkRVM4Q0RSRkxodUo4RzU0TzZyRHBVWHZFNmhZRHJyaWE6bzJpSFNyRnliWU1acG1XT1FNdWhzWFA1MlY0ZkJ0cHVTRHNocktEU1dzQlkxT2lONmh3ZDlLYjEyejRqNVVzNXU=",
"Cache-Control: no-cache",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
Can any one help me out with this. i am unable to resolve what i am doing wrong. so far i am following the same code using in documentation.
Documentation link is https://test.sagepay.com/documentation/