square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK
Apache License 2.0
117 stars 36 forks source link

Not able to payment using sdk #186

Closed sahilshah-canwill closed 2 years ago

sahilshah-canwill commented 2 years ago

Describe the issue

I am not able to make payments with square reader SDK for iOS - It's very frustrating guys - we are on a point - please provide us with some guidance asap - please

Error log details:

 USAGE_ERROR:checkout_present_from_presenting_view_controller:The checkout controller cannot be presented from a view controller which is already presenting another view controller.

This device is not currently authorized to accept payments with Square.

To Reproduce

Steps to reproduce the issue.

For example -

  1. Initialize the SDK
  2. Get a valid authz code
  3. Call await RNReaderSDKAuthorization.authorize(authCode); and failed

    Here the piece of code that reproduce the issue.

    const { RNReaderSDKAuthorization, RNReaderSDKCheckout, RNReaderSDKReaderSettings } = NativeModules;
    
    export async function authorizeAsync(authCode) {
    try {
      // it looks like that RNReaderSDKAuthorization is undefined
      return await RNReaderSDKAuthorization.authorize(authCode);
    } catch (ex) {
      throw createReaderSDKError(ex);
    }
    }

Expected behavior

The authorization should complete successfully with my valid authz token.

Environment (please complete the following information):

Screenshots

Additional context

CharmisG commented 2 years ago

@sahilshah-canwill Sorry for the delay !! Can you please pull latest code it's resolved !!