wixPay skipUserInfoPage doesn't work

I tried every possible way to skip the userInfo page but it’s not working. I also checked this post but this also didn’t help https://www.wix.com/corvid/forum/community-discussion/wixpay-skipuserinfopage-doesn-t-work/p-1/dl-5ede2d8b80c84d001759b1f2-5e6408e86db435001711ebaf-3?origin=member_comments_page . Please can anyone help me to fix it? I also didn’t found any idea here https://www.wix.com/corvid/reference/wix-pay-backend . Please help

@yisrael-wix sir Please help

The thread that you linked to indicates that the issue works and explains how to do it. Explain what you are trying to do, what works, and what doesn’t. Also, add any code in a code block as stated in the Forum Guidelines.

import wixPay from ‘wix-pay-backend’ ;

export function createMyPayment ( userInfo ) {
return wixPay . createPayment ({
items : [{
name : “Product Name” ,
price : 9.99 ,
quantity : 2
}],
amount : 19.98 ,
userInfo
} );
}

/********************

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

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

export function myButton_click ( event, $w ) {
const firstName = // the user’s first name
const lastName = // the user’s last name
const phone = // the user’s phone number
const email = // the user’s email address
const countryCode = // the user’s country code

createMyPayment ( { firstName , lastName , phone , email , countryCode } )
. then ( ( payment ) => {
wixPay . startPayment ( payment . id,
{SkipUserInfoPage:true}) ;
} );
}


I am using this code the same as the posted but it didn’t opened the payment window.

And also this page is not working https://www.wix.com/corvid/reference/wix-pay-backend/paymentinfo

You first need to set up your site to accept payments as described in About Accepting Payments . Note that y ou must upgrade your site to a Premium Plan in order to accept payments .

See the introductions for the client-side API , and the backend API . to see what’s needed to accept payments.

See these two examples:

//Backend pay.jsw  code

export function createMyPayments(userInfo) {
 return wixPay.createPayment({
    items: [{
      name: "Product Name",
      price: 9.99,
      quantity: 2
    }],
    amount: 19.98,
    userInfo
  } );
}

// For full API documentation, including code examples, visit https://wix.to/94BuAAs
import {createMyPayments} from 'backend/pay';
import wixPay from 'wix-pay';
import {countries, usStates, canadaStates} from 'public/states';

$w.onReady(function() {
    $w('#state').options = usStates;
    $w('#country').options = countries;

 // TODO: write your page related code here...

});

export function checkout_click(event) {
 // Add your code for this event here: 
 const firstName =$w("#firstname").value; // the user's first name
 const lastName = $w("#lastName").value;// the user's last name
 const phone = $w("#phone").value;// the user's phone number
 const email = $w("#email").value;// the user's email address
 const countryCode = $w("#country").value;// the user's country code
    createMyPayments({ firstName, lastName, phone, email, countryCode })
 // 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, {
 "skipUserInfoPage":true,
 "showThankYouPage": false,
 "termsAndConditionsLink": "https://mysite.com/terms"
      })
 // Step 6 - Visitor enters the payment information.
 // When the payment form is completed:
        .then( (result) => {
 //    console.log(result);
 // Step 7 - Handle the payment result.
 // (Next, see step 8 in the backend code below.)
 if (result.status === "Successful") {
 let paymentID= result.payment['id'];
 //console.log(paymentID);
 let transactionID= result.transactionId;
 //console.log(transactionID);
 
 //createOrderBackend(result.status);
        } else if (result.status === "Pending") {
 //wixWindow.openLightbox("Pending Box");
        }
 else if (result.status === "Cancelled") {
 // wixWindow.openLightbox("Pending Box");
 //createOrderBackend();
 //session.clear();
        }
 
      } );
    } );    
}

Here is my whole code… I think I tried that 8-9 months ago. That was working fine but now it gives the error . I am digging into it from the last 5 days.

Hi, @sharmakrishankant9 have you found a solution to the problem?