3045 : The Currency field is missing

127 views Asked by At

I'm getting following error in salesforce integration with sagepay test environment. I'm using 'AES128' Algorithm.

This transaction attempt has failed. We are unable to redirect you back to the web store from which you were purchasing. The details of the failure are given below.

Status: MALFORMED

Status Detail:  3045 : The Currency field is missing.

My Source System is Salesforce. We are using AES128 Crypto algorithm.

Blob stringToEncrypt = Blob.valueOf('VendorTxCode=Vtest&Amount=10&Currency=GBP&Description=test description&SuccessURL=https://ap1.salesforce.com/a01&FailureURL=https://ap1.salesforce.com/a01&BillingSurname=Ravi&BillingFirstnames=test ravi&BillingAddress1=BillAddressLine1&BillingCity=Atlanta&BillingPostCode=30004&BillingCountry=US&DeliverySurname=test&DeliveryFirstnames=Fnames&DeliveryAddress1=test&DeliveryCity=Atlanta&DeliveryPostCode=3004&DeliveryCountry=US');

Blob cryptoKey = Blob.valueOf('key');
Blob encryption = Crypto.encrypt('AES128', cryptoKey, cryptoKey, stringToEncrypt);

Thanks in Advance.

1

There are 1 answers

1
Rik Blacow On

Have you checked the padding is PCKS#5? Error 3045 (currency) is the first to crop up when the encryption is wrong....