showThankYouPage not working on wix-pay > PaymentOptions

I set the showThankYouPage = false on using Wix Pay startPayment( ) in PaymentOptions.

We are using pagSeguro as our payment provider, but when pagSeguro finishing processing the payment the ThankYouPage set in pagSeguro is beeing shown. If client does closes this window, it does not return to the checkoutpage we made to use Wix Pay e then our integration does work…

We are using the code shown in this link https://support.wix.com/en/article/corvid-tutorial-processing-payments

On .then( (result) => { if (result.status === “Successful”) …} we call our integration, which works…but if pagSeguro does closes the ThankYouPage, the program does not reach the .then((result)=>…

Is there a way of garantee that the we receive the payment provider result data even if the user does not close the ThankYouPage ?

First make sure that you have followed the tutorial completely and that you have both pay and events jsw files in your backend and that all code in those jsw backend files and your page code is all setup correctly.

Especially where it states:
// Here we use static data. You might want to use data from a // collection.
To see an example of such a usage, see the API Reference.

Make sure that you do use the api reference to check that you are doing it right.
https://www.wix.com/corvid/reference/wix-pay-backend.html
https://www.wix.com/corvid/reference/wix-pay.html

If they are then it would be a good idea to paste your code up here so that the forum users can see your used code and help guide you to a suitable result.

The code we are using is the same of the link I provided:( https://support.wix.com/en/article/corvid-tutorial-processing-payments …)
/********************
*** client-side code ***
********************/

import {createMyPayment} from ‘backend/pay’;
import wixPay from ‘wix-pay’;
import wixWindow from ‘wix-window’;

// Step 1 - User clicks a button.
export function myButton_click(event) {
// Step 2 - Call backend function.
// (Next, see step 3 in the backend code below.)
createMyPayment()
// When the payment has been created and a paymentId has been returned:
.then( (payment) => {
// Step 5 - Call the startPayment() function with the paymentId.
// Include PaymentOptions to customize the payment experience.
wixPay.startPayment(payment.id, {

     *"showThankYouPage": false,* ***//  HERE IS THE PROBLEM....this line does not have any  effect.  pagSeguro aways go back to ThankYouPage...it should skip the ThankYouPage when comes back from paymment provider...*** 

“termsAndConditionsLink”: “https://mysite.com/terms
})
// Step 6 - Visitor enters the payment information.
// When the payment form is completed:
.then( (result) => {
// Step 7 - Handle the payment result.
// (Next, see step 8 in the backend code below.)
if (result.status === “Successful” || result.status === “Pending”) {

doIntegration(result); // call our integration on backend here

}
} );
} );
}


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

import wixPay from 'wix-pay-backend';

export function createMyPayment() {
  // Step 3 - Create payment request.
  // Here we use static data. You might want to use data from a
  // collection. To see an example of such a usage, see the API Reference.
  let paymentRequest = {
    "items": [ 
      {
        name: "Product 1",
        price: 0.50
      }
    ],
    amount: 0.50
  }
  
  // Step 4 - Call createPayment() with the payment request 
  // and return the paymentId.
  // (Next, see step 5 in the client-side code above.)
  return wixPay.createPayment(paymentRequest);
}

How to move the createMyPayment() to backend…does it works?

Here is what is going on:


The problem if client does not closes the Thank You Page the process is never completed…Purchase is already done, but our integration is never reached in step 7…


so createPayment() should be executed at the backend…I am not sure that this will work:

Any news about this?

is there any feedback on this issue ? my code was working fine, but for some reason, the mobile version of the thank you page has a continue shopping button which redirects the user to our homepage @yisrael-wix

the desktop version only works when you add the terms and condition option “termsAndConditionsLink”, but this does not seem to hold on mobile

I am currently experiencing issues with this now as well. “showThankYouPage: false” fails most of the time on mobile and does not return a payment result, thus any further code to save data etc does not run.

If this issue could be escalated it would be great, as its causing great disruptions for my client’s business.