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

Offsite payment completion #224

Open
snake77se opened this issue May 23, 2018 · 3 comments
Open

Offsite payment completion #224

snake77se opened this issue May 23, 2018 · 3 comments

Comments

@snake77se
Copy link

Hi,

I'm implementing the PaypalPayment with express checkout, which uses offsite confirmation. Everything works ok but I don't know how to complete the transaction after the user comes back to my site. Of course I could just manually update every field on the Order entity, but I woul like to know if there is a "formal" way of doing this. Maybe the "payment.plugin_controller" service has an API for doing this?

Thanks a lot!

@psrpinto
Copy link
Collaborator

psrpinto commented May 23, 2018

Hi. I'm not sure I 100% understand what you mean. I don't know if you noticed that there's a guide which explains how to accept payments. The section on offsite payments might help.

Note that this bundle doesn't provide a fully-fledged checkout system, it only handles payment-related matters. You still need to take care of what should happen to your order yourself, since this is highly application-dependent.

I hope this helps. If not, please provide more detailed information of what you're trying to achieve.

@snake77se
Copy link
Author

Hi @regularjack thanks for the answer.

As far as I understand, the guide provides information to the point the user leaves the site to authorize the payment, but my question is after the user returns back to the site (correct me if that is not true). At that point, the guide states that I should show a "Payment complete" message, but there is no information on how to update the model's state properties (for PaymentInstruction, Payment and FinancialTransaction).
In other words, should we go through this process manually when the user comes back?

Thanks!

@psrpinto
Copy link
Collaborator

You're right, the docs are confusing. It's been a while since I've worked with this but, from just re-reading the guide, I think that the missing piece of information is that Paypal should redirect the user to the paymentCreateAction(). In that action, the call to $ppc->approveAndDeposit() will take care of persisting data. Then, the action redirects to paymentCompleteAction().

I assume you're passing /{order_id}/payment/complete as the return_url option of the paypal plugin? I guess it should be /{order_id}/payment/create.

If this works, please let me know so that I can update the docs. Or feel free to submit a PR, of course ;)

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