Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : Don't receive any status when capture back #855

Open
martygraphy opened this issue May 5, 2020 · 6 comments
Open

Question : Don't receive any status when capture back #855

martygraphy opened this issue May 5, 2020 · 6 comments

Comments

@martygraphy
Copy link

Hi,
I'm currently developing a custom Ogone gateway (because Ogone Ets Bundle is no longer functional on Symfony 4).

Everything works until I complete my transaction on Ogone.
I pass the url capture back after redirection from Ogone to my application, however I don't receive any status. So it creates me a new capture when it should not. Is this a parameter to be passed or is this an Ogone issue?

Any help you can give me would be greatly appreciated.

Marc

@martygraphy martygraphy changed the title Question : Statut when capture back Question : Don't receive any status when capture back May 5, 2020
@Great-Antique
Copy link
Contributor

Great-Antique commented May 5, 2020

I pass the url capture back after redirection from Ogone to my application, however I don't receive any status.

For Paypal Payum works as follows:

  1. Your app redirects you to Paypal
  2. You authorize payment at Paypal
  3. Paypal redirects you to your app
  4. Your app receives status of your payment (resolved by token in URL) from Paypal and if it's authorized app tries to capture the payment. And then redirects you to some page (succes, etc.)

You don't need any status in URL, you ask Paypal for it.

Don't know how Ogone works, but if your app has to capture payment after authorization - you don't need any status provided in URL by payment system. So if you can capture - you capture.

So it creates me a new capture when it should not.

Are those payments not captured in Ogone?

@martygraphy
Copy link
Author

Hi @Great-Antique ,
Thank you for your response.

I don't have to capture the payment directly. Ogone can give me the answer to the transaction, several weeks after the creation of the transaction.

You don't need any status in URL, you ask Paypal for it.

You mean that the application makes another request to know the status of the paypal payment?

Aren't the payments captured in Ogone?

Ogone creates a transaction for me, it sets a status pending validation but will not return the information to me after the redirection.

So how can I let payum know that I want to switch to done if I don't have any new information?

Marc

@Great-Antique
Copy link
Contributor

@martygraphy

I had an experience only with Paypal Express Checkout and custom SafeCharge gateway.

I don't have to capture the payment directly. Ogone can give me the answer to the transaction, several weeks after the creation of the transaction.

It's weird if payment is not captured at Ogone. There should be some status mapping from Ogone to Payum. Maybe it's not correctly mapped?

You mean that the application makes another request to know the status of the paypal payment?

In Paypal Express Checkout intergration - yes, it makes request to synchronize payment details (and map status from details to Payum status) every time you redirected after checkout&pay and on every notifying from Paypal in background. So you don't need to do anything with input parameters (URL, POST). Just sync details & handle difference (between old details and new ones).

Ogone creates a transaction for me, it sets a status pending validation but will not return the information to me after the redirection.

If Ogone don't send you status (or other details) in URL (or POST) - you can get payment by URL for sure and then ask for status by some API. If it's 'pending' - you should map it to correct Payum status, show 'Pending page' and wait for a server-server notification from Ogone when transaction will be processed/validated. But then, again, if they don't provide details in notification URL - you, again, can get payment from URL and ask Ogone.

So how can I let payum know that I want to switch to done if I don't have any new information?

You will receive notification from payment system. There are (at least for Paypal Express Checkout) two tokens: one for handle redirect from payment system and one for handling notifications. Each has own URL. So you will receive (I hope they notify customers) notification to notify token's URL. And then you can ask for details by API (I hope they have API) and decide if the transaction is ready to be captured or already captured. If yes - mark payment model as captured/done.

P.S. This is my vision of how Payum is working. We've integrated our application in this way but with Paypal. But I think that this part should be very similar.

@martygraphy
Copy link
Author

martygraphy commented May 5, 2020

Thank you very much @Great-Antique , for this answer it is much clearer!
Last little question :)

Just sync details & handle difference (between old details and new ones).

I've been looking into this syncing thing, but I see that the Class Sync is empty.
( I don't see any paypal configuration at this level )

And my gateway doesn't recognize it, is there a configuration for the gateway to support Sync?

King Regards

@Great-Antique
Copy link
Contributor

  1. Class Sync is a request. It's handled by an action class. In case of Paypal ExpressCheckout it's PaymentDetailsSyncAction. This action throw GetTransactionDetails request which is handled by GetTransactionDetailsAction and do API request to get relevant details of payment/transcation. Sync request is thrown by Paypal ExpressCheckout's NotifyAction which handles Notify request. This Notify request is thrown by NotifyController from Payum Symfony Bundle. I think you must have similar to NotifyAction and PaymentDetailsSyncAction classes in Ogone gateway.

  2. To capture a payment there is CaptureController (Pay attention to this line) and some action like CaptureAction in which you deal with new details (like a status), and some action like DoCaptureAction in which you DO capture and throw GetTransactionDetails request (which handles by GetTransactionDetailsAction updates your model by new details like mentioned above in "1").

Also, don't forget to dig into Payum Bundle's tab in Symfony Profiler. There is some useful information about those requests and actions. I don't think that Payum's architecture is easy-to-understand but if you have a time to dig in some of existing gateway - you will probably can build your own gateway without changing anything in Payum. I think it's more easy-to-integrate than easy-to-understand flow :) especially without bird-view diagrams and detailed integration (or custom gateway) tutorials. I've spend a lot of time to build my custom SafeCharge gateway but in the end it's easy to install, configure and use.

@martygraphy
Copy link
Author

Hello @Great-Antique ,
Thank you for this additional information and for taking the time to answer me!
I'll try to set it up! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants