Pregunta

I am trying to set up an integration with SagePay using ActiveMerchant - I have been able to get the main call working and in the case of 3d secure being needed I can generate the appropriate content within an iframe which sends the user to the correct place.

What I can't do is get the completed 3d secure form to call back to my system.

It feels like I am missing a simple configuration setting but I cannot see where I would add this information.

Right now I call the following;

ActiveMerchant::Billing::SagePayGateway.new({
  login: 'login',
  password: 'password',
  account: 'account',
  server: 'test',
  test_mode: 1
})

And I wonder if there is something I need to add into here?

Any help would be greatly appreciated.

¿Fue útil?

Solución

The Callback URL should be specified in a hidden field in the form you use before you redirect to the 3D Secure page.

The ID/name of this hidden field should be TermUrl, for example;

<form id="3dsform" action="acsurl_value" method="POST">
  <input type="hidden" name="MD" value="md_value" />
  <input type="hidden" name="PaReq" value="pa_req_value" />
  <input type="hidden" name="TermUrl" value="http://myawesomesite.com/sagepaycallback/" />
</form>

The callback will be in the form of a POST so whatever you use to handle it should be set up accordingly.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top