Redirect to a specific page after paying

Hi,

I do not know/understand Corvid, so I’m hoping perhaps someone can either provide the code (rather than linking to a page where it is explained) or a link to a step-by-step tutorial video or something.

I need the Wix Pay Button (not a paypal button, but the actual Pay Button that is linked to the Wix back-end/Wix payments) to redirect the user after successful payment to a page that we have created.

It really seems like this is a basic thing that you should be able to specify in the button settings, but alas, it is not.

Hoping someone can help, thank you so much!

Megan

Did you code your Payment-Button?

For example, like this? From the backend?

*************************
* backend code - pay.jsw *
*************************/

import wixPayBackend from 'wix-pay-backend';
import wixLocation from 'wix-location';

export function createMyPayment() {
  return wixPayBackend.createPayment({
    items: [{
      name: "Product Name",
      price: 9.99
  }],
    amount: 19.98
  } );
}


/********************
 * client-side code *
 ********************/

import {createMyPayment} from 'backend/pay';
import wixPay from 'wix-pay';

export function myButton_click(event, $w) {
  createMyPayment()
    .then( (payment) => {
      wixPay.startPayment(payment.id);
    } );
}

So if yes, perhaps you could doing something like…

export function myButton_click(event, $w) {
  createMyPayment()
    .then( (payment) => {
      wixPay.startPayment(payment.id);
      
      //expand code here with your own (after payment was done).
      
      //redirection...
      wixLocation.to("http://wix.com");
      
    } );
}

This is just an idea, not a solution! Not tested!

How do you get to this section? I am in Dev Mode trying to code the button to redirect and it won’t let me code the button. Can I just copy and paste this with the appropriate costs and link in the Dev coding on that page?

I can’t really tell you any detailed advice, because i do not see anything of your project (of your page).

-I do not see the structure of your page.
-I do not see the flow of your page.
-I do not know which elements are used in details.

To make it short —> more details needed (screenshots / description / used elements, and so on…)

Because of the structure of the product we are selling we cannot use Wix Stores, and so I need this button (see image) to redirect to another page within the website.

This is the page that I need to add code for this Pay Button to redirect

Is this more clear?

This article should help you to understand → how to create a payment-gateway and it’s flow…

https://www.wix.com/velo/reference/wix-pay/introduction

this doesn’t show the redirect and I am trying to add the redirect in there and it’s not working…