marlon-be / marlon-ogone

Ogone PHP library
http://marlon.be
MIT License
72 stars 54 forks source link

Automatically submit form and redirect #89

Open paulhuisman opened 6 years ago

paulhuisman commented 6 years ago

I'm using this in Laravel 5.6 - is there a way to automatically submit the form and redirect to Ogone?

My code:

        // Create ogone payment request
        $ecommercePaymentRequest = $this->generatePaymentRequest($order);

        // Return html form for Ogone
        $formGenerator = new SimpleFormGenerator;
        $html = $formGenerator->render($ecommercePaymentRequest);

        return new Response('<h1>Pay for order</h1><p></p>' . $html);
L00Cyph3r commented 6 years ago

You could use a JS onload event, or use the direct-payment option which will generate a link where you can redirect a user to.