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 #4

Closed
sidthekidder opened this issue Aug 25, 2015 · 2 comments
Closed

Question #4

sidthekidder opened this issue Aug 25, 2015 · 2 comments

Comments

@sidthekidder
Copy link

In the examples given for creating and retrieving a payment, we need the payment.id to retrieve the status of a payment. But we can't return any data while giving a 302 redirect with response.writeHead(302, { Location: payment.getPaymentUrl() }) . So what is a good flow to return the paymentid back with the API call? This paymentid is needed to show the current status of the payment on the frontend.
One option is not automatically redirect and return JSON data - any other way?

@lvgunst
Copy link
Contributor

lvgunst commented Aug 25, 2015

Hi @sidthekidder,

I'm not exactly sure what you want to do. After the payment is created you can save the payment ID to your database: https://github.com/mollie/mollie-api-node/blob/master/examples/1-new-payment.js#L55

The payment flow is asynchronous so you can't process the payment status directly after you create the payment and redirect the customer to the payment URL. When the payment changes state Mollie will call your webhook URL. https://github.com/mollie/mollie-api-node/blob/master/examples/2-webhook-verification.js#L42 On the webhook URL you can load the payment and process the state.

More about the webhook and the payment flow.

@ghost
Copy link

ghost commented Apr 5, 2016

This issue is older than six months. I'll close this issue for now. If you still have a issue, feel free to create a new issue.

Ricardo,
Mollie

This issue was closed.
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