Jump to content

Recommended Posts

Posted

I'm working on the Stripe Checkout plugin. I've ironed out most of the kinks and it's basically ready to go. Stripe Checkout posts directly to a form of your choosing. Currently, it is sending the client to: callback/gw/1/stripe_checkout/?client_id=$id. This is all good (invoices are getting marked as paid, everything looks nice), except that there is no redirect to a success page or failure page. Is there any way for me to redirect them to some other page?

Posted

There are two URLs a gateway typically needs to use. First, the payment callback should be sent to:

Configure::get("Blesta.gw_callback_url") . Configure::get("Blesta.company_id") . "/yourgateway/". $client_id

Second, the client should be redirected to:

domain.com/blesta/client/pay/received/yourgateway/client-id/

...which should be provided to the YourGateway::bulidProcess() method in $options['return_url']. If the gateway only supports one of these, use the callback URL.

  • 4 months later...
Posted

There are two URLs a gateway typically needs to use. First, the payment callback should be sent to:

Configure::get("Blesta.gw_callback_url") . Configure::get("Blesta.company_id") . "/yourgateway/". $client_id

Second, the client should be redirected to:

domain.com/blesta/client/pay/received/yourgateway/client-id/

...which should be provided to the YourGateway::bulidProcess() method in $options['return_url']. If the gateway only supports one of these, use the callback URL.

 

Problem with using the callback URL for clients is that the Blesta code is then redirecting the client to /client/pay/received/yourgateway, and not preserving any added parameters (like /client_id in your example)

 

/blesta/app/controllers/callback.php

// Process the payment notification from the gateway
$this->GatewayPayments->processNotification($gateway_name, $this->get, $this->post);
 
// Redirect any client back to the payment received page
if ($this->Session->read("blesta_client_id") || $this->Session->read("payment"))
    $this->redirect($this->client_uri . "pay/received/" . $gateway_name);

Can workaround this by storing the added parameters in a session as well (which is what we did in our proof of concept Omnipay module), but would be nice if the Blesta core code was fixed to just append any additional parameters as well when redirecting.

  • 9 years later...
Posted
On 8/31/2015 at 7:43 PM, Max said:

If the gateway only supports one of these, use the callback URL.

I have coded it, but it doesn't redirect to the received page, my gateway supports one return URL, and as soon as the client pays, it shows a blank page. and the transaction is added. I have tried $this->redirect invalidate, but it doesn't work at all. now help, please. how do I redirect the client back to the client's page?

 

    $redirectUrl = "https://domain.com/client/payments/success";
            $this->redirect($redirectUrl); // Use Blesta's redirect method

also checked that, but doesn't work 

 

sucess()

 public function success(array $get, array $post)
    {
        $validatedData = $this->validate($post);
       
        if ($validatedData) {
            $redirectUrl = "https://domain.com/client/payments/success";
            $this->redirect($redirectUrl); // Use Blesta's redirect method
            exit;

            return $validatedData; // Return the already validated data
        }
    
        echo "Validation failed."; // Handle failure case
        return null;

 

  • 3 weeks later...
Posted

It sounds like your Stripe Checkout integration is working well, but you're missing a proper redirect after payment. Stripe Checkout allows you to set success_url and cancel_url when creating a Checkout session. You should ensure these URLs are correctly configured to redirect users after payment. If you're using a plugin, check its settings for redirect options. Otherwise, in your code, add success_url=https://yourdomain.com/success and cancel_url=https://yourdomain.com/failure when initializing the Checkout session. This will ensure users land on the appropriate page after payment. If you need more details, feel free to contact Stripe support or check their documentation.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...