1
votes

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.

enter image description here

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. –

2
Check that GBP is a supported currency on the Sage Pay account as above is correct. Make sure the encryption password is correct - they should be different encryption passwords for TEST and LIVE and you are using AES for V3.00.Sage Pay Support
your encryption password is not correct, please triple check it.Pablo
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.Ramesh S
I have edit the my post some one can pleas check..Ramesh S

2 Answers

2
votes

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.

0
votes

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.