phplaravelpayment-gatewaymollie

How to display Mollie order status in the redirecturl?


The redirectURL does not seem to POST any data back. It seems to use a GET request. How do I know the payment ID or payment status on the return URL?

$payment = \mollie::api()->payments()->create([
    'amount'        => $price,
    'customerId'    => $customer->id,
    'description'   => 'My Initial Payment',
    'redirectUrl'   => \URL::to('/after-payment'),
]);

Solution

  • Edit: as pointed out in the comments, I was talking about the webhook URL. Mark’s answer is the correct one, as he’s describing the redirect URL.

    As stated in Mollie's docs, a POST request is sent with one parameter id=tr_xxxxxx. Are you sending a 301 or 302 redirection header? In that case the post data is lost and you'll receive a GET request.

    Note that you can always add your own transaction identifier to the webhook URL if you need the redirection.