tolzhabayev / sagepayForm-php

A simple class to integrate sagepayForm into your website
40 stars 26 forks source link

Status: MALFORMED Status Detail: 3045 : The Currency field is missing. #7

Closed ScottGoMedia closed 10 years ago

ScottGoMedia commented 10 years ago

Hi there,

I keep getting the error mentioned above, I am pretty sure that everything is in place and don't know where I am going wrong.

Any chance you could have a look?

Thanks,

$sagePay = new SagePay(); $sagePay->setCurrency('GBP'); $sagePay->setAmount('100'); $sagePay->setDescription('Breakdown Cover'); $sagePay->setBillingSurname('Bowers'); $sagePay->setBillingFirstnames('Scott'); $sagePay->setBillingCity('Wakefield'); $sagePay->setBillingPostCode('WF59TJ'); $sagePay->setBillingAddress1('1 The Gateway, Fryersway'); $sagePay->setBillingCountry('gb');
$sagePay->setDeliverySameAsBilling();

$sagePay->setSuccessURL($websiteRoot.'quote/step/6/success'); $sagePay->setFailureURL($websiteRoot.'quote/step/6/failure');

?>

tolzhabayev commented 10 years ago

I have just tested it by me with your code and it works like a charm.

Are you sure you are using the same currency as set in your account?

ScottGoMedia commented 10 years ago

Yeah the currency definitely matches. Can you see any problems with my form?

<form method="POST" id="SagePayForm" action="https://test.sagepay.com/gateway/service/vspform-register.vsp">
    <input type="hidden" name="VPSProtocol" value= "3.00">
    <input type="hidden" name="TxType" value= "PAYMENT">
    <input type="hidden" name="Vendor" value= "XXXX">
    <input type="hidden" name="Crypt" value= "<?php echo $sagePay->getCrypt(); ?>">
    <input type="submit" value="continue to SagePay" id="continue" class="button teal">
</form>
tolzhabayev commented 10 years ago

I dont really see you form, show me how you create you form (but remove the sensitive data first)

Does it look like this?

<form method="POST" id="SagePayForm" action="https://test.sagepay.com/gateway/service/vspform-register.vsp">
    <input type="hidden" name="VPSProtocol" value= "3.00">
    <input type="hidden" name="TxType" value= "PAYMENT">
    <input type="hidden" name="Vendor" value= "XXXXX">
    <input type="hidden" name="Crypt" value= "<?php echo $sagePay->getCrypt();?>">
    <input type="submit">
  </form>
ScottGoMedia commented 10 years ago

Yeah it looks exactly same, I'll double check all the information with Sage Pay as the problem could be at their end.

Thanks for your prompt response and help :)

tolzhabayev commented 10 years ago

@ScottGoMedia i have changed your vendor id against mine and got the same error as you get. So it is definitely the vendor setting in your sagepay backend. The code is perfectly fine.

ScottGoMedia commented 10 years ago

Okay that's fine, thanks for your help :)

feridmovsumov commented 9 years ago

Reason of problem can be wrong encryption password. You should get yours from your admin https://test.sagepay.com/mysagepay/settings.msp