问题
Im having an issue while integrating sagepay form into a website.
I have generated the form and its posting to the correct URL but i get 3045 : The Currency field is missing when it is set.
Is there anything obviouse i may be missing here that i could check?
This leads me to believe my encrypt function is incorrect? I may be wrong but here is my function i use to encrypt the data:
public function encryptAndEncode($strIn, $vendorTxCode) {
$strIV = $this->_password;
$strIn = $this->addPKCS5Padding($strIn);
$strCrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->_password, $strIn, MCRYPT_MODE_CBC, $strIV);
return "@" . bin2hex($strCrypt);
}
There is no integration guides for PHP so if someone knows of a tutorial / documentation they could point me to that would be great.
Thanks
回答1:
You will always get the currency error if its encrypted/encoded not in the right way. Check out the simple php class i wrote https://github.com/tolzhabayev/sagepayForm-php it does the encoding for you
回答2:
When using Form, if you are getting Invalid Currency, check the casing is correct i.e. Great British Pound would be Currency=GBP and not Curreny=gbp. Also check the currency is supported on your Sage Pay account as if you are trying to process a euro transaction (Currency=EUR) when you do not have that currency assigned to your merchant number and Sage Pay, you will get an invalid currency error.
Check you are using the correct Encryption password for TEST or/and LIVE as the encryption password differs for Test and Live. The encryption password is case sensitive. It should be no more than 16 characters (base 64 encoded).
回答3:
i had the same going on and tried almost everything including talking to sage support.
yes the encryption password is probably your problem but if you just like me are moving from server integration to form u might want to check what url you are using
my issue was the git repo that previous developer left me with had the server integration url while live site was using form leaving me with the error
check your url, had to change mine from
https://test.sagepay.com/gateway/service/vspserver-register.vsp
to
https://test.sagepay.com/gateway/service/vspform-register.vsp
doh, hope it helps to someone
来源:https://stackoverflow.com/questions/19653569/sagepay-form-integration-v3-0-error-3045-the-currency-field-is-missing