GithubHelp home page GithubHelp logo

Comments (7)

sandervanhooft avatar sandervanhooft commented on April 28, 2024

At first glance I kinda like it :). Would save me some trouble with Spark as well if we can solve this in Cashier.

from cashier-mollie.

sandervanhooft avatar sandervanhooft commented on April 28, 2024

We could use {order_id} in the route, and replace it dynamically if it's used there.

from cashier-mollie.

sandervanhooft avatar sandervanhooft commented on April 28, 2024

Scratch that. The Order is not created before the payment has been paid, so there's no order_id available.

I have discussed this with Mollie a while ago, and we ended up adding an Update Payment API endpoint.

Long story short: we can update the Payment's redirectUrl right after the payment has been created in order to include the paymentId (i.e. when the redirectUrl contains {payment_id}) , and use that for checking the status.

from cashier-mollie.

sandervanhooft avatar sandervanhooft commented on April 28, 2024

So that would all need to happen in the FirstPaymentBuilder.create() method.

from cashier-mollie.

sandervanhooft avatar sandervanhooft commented on April 28, 2024

Fix merged in develop 😄 .

With this you will be able to use {payment_id} in the redirectUrl. Using this payment_id in your controller, you can either retrieve the Order (locally) or the Payment (from Mollie) to check the status.

$paymentId = $request->get('payment_id');
$order = Order::whereMolliePaymentId($paymentId)->findOrFail();
$order->mollie_payment_status; // depending on Mollie / your app, this may take a second

$payment = mollie()->payments->get($paymentId);
$payment->status; // Always up to date

Make sure you reference the {payment_id} in your route definition as well!

from cashier-mollie.

sandervanhooft avatar sandervanhooft commented on April 28, 2024

I don't know about you @marijnbent , but I am really happy about this 🕺 !

from cashier-mollie.

marijnbent avatar marijnbent commented on April 28, 2024

Really cool Sander! This should help a lot with displaying the proper page, thanks 💃!

from cashier-mollie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.