0

I have 2 versions of the same payment type I am writing plugins for and I need help understanding the difference in the architecture and how to handle the differences with custom actions.

Method 1 is an offsite payment that returns to the 'done' url, which in turn checks the status and redirects the user to a success/error page. (When the user returns, MY SYSTEM sends a query about the payment status)

Method 2 is again an offsite payment, however the user cannot be returned to the same 'done' page as this payment gateway sends an individual notification to a url that I set when creating the payment, that contains the payment result data. So presently I send my user to a pending page. However I cannot use the 'done' page to handle the separate notification as I need to set a different response (Just 'OK', nothing else) and the 'done' page wants to redirect as it it has been accessed by a user in the browser.

What is the best way to handle this? I have already written code to handle method 1 but need it to handle method 2 also.

Can I use custom actions to achieve this?

The docs aren't really that clear about how I can perform the seperate actions from the 'done' url?

Thanks in advance

J

jonupton
  • 95
  • 1
  • 5
  • The done action is your project area, you can put there what ever you want there. About two payment methods: I believe you have to have two payment objects with different set of Payum's actions. It is a general approach. – Maksim Kotlyar Aug 20 '14 at 12:39
  • Yeah. I have that. I guess my question is more directed at how do I actually create the action, how do i register it and then how do I use it in my 'done' action. I find the documentation lacking detail and confusing. The action about custom actions doesn't really explain it to me. – jonupton Aug 21 '14 at 13:58

0 Answers0