Does wix-pay api work on mobile devices?

I’m trying to make the wix-pay api work on smartphones to receive payments, does anyone know why it does not work on mobile devices? already try in several and nothing, in the computers it works perfectly but not in other devices. I can not get the wix-pay lightbox open. can someone tell me if the api works or not? What can I do, please

Jess, I have not had a problem with the Wix-pay API on smartphones.

First, you probably want to go into debug mode to see if an error is occurring on a device that is not happening on a desktop computer or tablet. If there is no error, possibly there is a code tweak that you could do. You could post the relevant functions, and maybe a suggestion will occur to one of us.

I already found the problem, for some reason if you create a payment using the collection and it has “admin” permissions, the computer can create the payment but on the smartphone you need to put permissions of the collection on “anyone”.

The people of wix should check this.

Thanks for your answer

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

import wixData from 'wix-data';
import wixPay from 'wix-pay-backend';

export async function createMyPayment(productId) {
  return wixData.get("productCollection", productId)
    .then( (product) => {
      return wixPay.createPayment( {
        items: [{
          name: product.name,
          price: product.price
        }],
        amount: product.price
      } );
    } );
}

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

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

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