square / square/in-app-payments-react-native-plugin

rn_apple_pay_not_supported

Open
#246 2 comments 0 reactions 1 assignee View on GitHub

@cesar-sosa-hol is already working on this.

Since Jul 10, 2026.

bug
Dominant language
TypeScript
Stars
131
Forks
55
PR merge metrics
No merged PRs in 30d

Description

Describe the issue

Our team is trying to integrate Apple Pay into our React Native app using the RN Plugin for In-App Payments SDK, but we keep running into this error: [Error: Something went wrong. Please contact the developer of this application and provide them with this error code: rn_apple_pay_not_supported] whenever we call SQIPApplePay.requestApplePayNonce.

To Reproduce

Steps to reproduce the issue.

  1. Initialize the SDK
  2. Initialize Apple Pay
  3. call await SQIPApplePay.requestApplePayNonce

Here the piece of code that reproduce the issue.


useEffect(() => {
  const initializeDigitalWallet = async () => {
    let digitalWalletEnabled = false;

    if (Platform.OS === 'ios') {
      try {
        await SQIPApplePay.initializeApplePay('merchant.FMApplePay');
        digitalWalletEnabled = await SQIPApplePay.canUseApplePay();
      } catch (error) {
        console.error('Error initializing Apple Pay:', error);
      }
    } else if (Platform.OS === 'android') {
      // Add Android-specific logic here
    }

    setCanUseDigitalWallet(digitalWalletEnabled);
  };

  initializeDigitalWallet();
}, []);

const onApplePayNonceRequestSuccess = async (cardDetails) => {
  try {
    // Process the card nonce details (e.g., take payment)
    // await chargeCard(cardDetails);

    // Close the Apple Pay sheet successfully
    await SQIPApplePay.completeApplePayAuthorization(true);
  } catch (ex) {
    // Handle card nonce processing failure
    await SQIPApplePay.completeApplePayAuthorization(false, ex.message);
  }
};

const onApplePayNonceRequestFailure = async (errorInfo) => {
  // Handle the error and close the Apple Pay sheet
  console.log(errorInfo, '!!!!!!!!!!!!err')
  await SQIPApplePay.completeApplePayAuthorization(false, errorInfo.message);
};

const onApplePayEntryComplete = () => {
  // Handle the event when the Apple Pay sheet is closed
  console.log('Apple Pay sheet closed');
};

 const onStartDigitalWallet = async () => {
  if (Platform.OS === 'ios') {
    const applePayConfig = {
      price: '1.00',
      summaryLabel: 'Test Item',
      countryCode: 'US',
      currencyCode: 'USD',
    };

    try {
      await SQIPApplePay.requestApplePayNonce(
        applePayConfig,
        onApplePayNonceRequestSuccess,
        onApplePayNonceRequestFailure,
        onApplePayEntryComplete,
      );
    } catch (ex) {
      console.error('Error requesting Apple Pay nonce:', ex);
    }
  } else if (Platform.OS === 'android') {
    // Add Android-specific logic here
  }
};


Expected behavior

The Apple Pay finish and return me the valid token.



**Environment (please complete the following information):**

- platform: iOS
- In-App Payments Plugin version: [e.g. 1.7.6]


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.