I have added all the parameter in the Sagepay url. But it throwing an error currency missing. I am unable to solve this issue.
Code:
$cryptString = 'VendorTxCode='.$this->getVendorTxCode();
$cryptString.= '&ReferrerID='.$this->getReferrerID();
$cryptString.= '&Amount='.sprintf("%01.2F",($order->order_total_price-$order->order_fee));
$cryptString.= '&Currency=GBP'; //Status Detail: 3045 : The Currency field is missing.
$cryptString.= '&Description='.$this->getDescription();
$cryptString.= '&SuccessURL=https://testurl/sage/success.php';
$cryptString.= '&FailureURL=https://testurl/sage/fail.php';
$cryptString.= '&CustomerName=Customer Name';
.......
And finally I called encrypt method
$cryptedString = $this->encryptAndEncode($cryptString);
Form Tag:
<form name='sagepay' action='{$pm_sagepay_url}' method='post'>
<input type='hidden' name='VPSProtocol' value='3.00'>
<input type='hidden' name='TxType' value= 'PAYMENT'>
<input type='hidden' name='Vendor' value= 'protxross'>
<input type='hidden' name='Crypt' value= '{$cryptedString}'>
<input type='submit' value='{!pay!}' name='submit2' alt='{!sagepay_pay!}' >
</form>
Error:
- Status Detail: 3045 : The Currency field is missing.
Some one can please help me how to solve this issue.
I have using the test account details with this url:'test.sagepay.com/gateway/service/vspform-register.vsp'; it working,Same as live account details with 'live.sagepay.com/gateway/service/vspform-register.vsp'; but it throws error:The Currency field is missing.Some one can help me. –
I had a similar issue, my problem turned out to be a different key was required if posting a form to
test.sagepay.com/gateway/service/vspform-register.vsp
or
live.sagepay.com/gateway/service/vspform-register.vsp
The fact that the Currency field was being sited was a bit of a red herring.
Hope this helps.
I hope you would have solved your issue. In case not try the following.
Search for function pkcs5_pad
in your sagepay.php which will be placed in lib folder. And replace the content inside that function as follows:
$pad = $blocksize - (strlen($text) % $blocksize);
return $text . str_repeat(chr($pad), $pad);
I had similar issue, and this solved for me. Let me know if this helps you.
来源:https://stackoverflow.com/questions/25940754/status-detail-3045-the-currency-field-is-missing