mollie / mollie-api-php

Mollie API client for PHP
http://www.mollie.com
BSD 2-Clause "Simplified" License
552 stars 191 forks source link

How to fetch payment id #82

Closed sahilbalani15 closed 7 years ago

sahilbalani15 commented 7 years ago

Hello,

I have been trying with the examples, but when I open the new-payment.php then it redirects to the payment gateway and after paying it sends to 03-return-page.php. When I try to open 02-webhook-verification it gives me an error "API call failed: Invalid payment ID: ''. A payment ID should start with 'tr_'." How do I fetch the payment id when page returns for that particular payment, also how do I fetch the response code after that?

Thanks

ndijkstra commented 7 years ago

Hi, We will do a POST request to your webhookUrl. In this POST request we send the "id" parameter with the Payment ID.

For the redirectUrl you can save the status in your database (via the webhook) and retrieve it on the redirectUrl page.

sahilbalani15 commented 7 years ago

Hello,

So how do I fetch the same in example 3 ? Also how do ai fetch the reponse code when payment is sent or updated in third example.

Thanks in advance

On 20 Jul 2017 20:44, "Nick Dijkstra" notifications@github.com wrote:

Hi, We will do a POST request to your webhookUrl. In this POST request we send the "id" parameter with the Payment ID.

For the redirectUrl you can save the status in your database (via the webhook) and retrieve it on the redirectUrl page.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mollie/mollie-api-php/issues/82#issuecomment-316735369, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac6sZYkGf045QoG2L4pG1_ZQqqf8UEGTks5sP27lgaJpZM4OeQHd .

ndijkstra commented 7 years ago

You have to save it in your own database after you've created the payment. We don't send it with the redirectUrl only with the webhookUrl.

sahilbalani15 commented 7 years ago

Alright. Thanks. Can you help me with one more thing please. If you can give me a code on core php on how do I save all these codes that would be great and really helpful to me. I want to save response code. Thanks

On 20 Jul 2017 21:16, "Nick Dijkstra" notifications@github.com wrote:

You have to save it in your own database after you've created the payment. We don't send it with the redirectUrl only with the webhookUrl.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mollie/mollie-api-php/issues/82#issuecomment-316745167, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac6sZW0nlxqn0lV77_1yZndQ4Bc52Sgeks5sP3ZFgaJpZM4OeQHd .

ndijkstra commented 7 years ago

Unfortunately we don't have more examples then those in this client. Please read our documentation for more information: https://www.mollie.com/nl/docs/reference/payments/get