stripe / stripe-terminal-react-native

React Native SDK for Stripe Terminal
https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=react-native
MIT License
95 stars 47 forks source link

collectInputs return type differs on iOS from those documented in the API docs #743

Open asher5 opened 2 weeks ago

asher5 commented 2 weeks ago

Describe the bug When trying the workaround for iOS collectInputs bug to pass a dummy collectInputs parameter we had other issues, it look like SDK doesn't return the documented object types in the result. It returns an object that is as follows

When FormType.SELECTION used

{
  "selectionResult": {
    "skipped": false,
    "selection": "Custom Amount",
    "toggles": []
  }
}

When FormType.NUMERIC used

{
  "numericResult": {
    "skipped": false,
    "toggles": [],
    "numericString": "20"
  }
}

which is different from what the SDK types defined are i.e.

export interface ICollectInputsResults {
    collectInputResults?: ICollectInputsResult[];
    error: StripeError;
}
export interface ICollectInputsResult {
    skipped: boolean;
    email?: string;
    numericString?: string;
    phone?: string;
    selection?: string;
    signatureSvg?: string;
    text?: string;
    toggles: ToggleResult[];
}

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Stripe Terminal React Native SDK version

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

nazli-stripe commented 2 weeks ago

hey @asher5 thanks a lot for flagging this issue. We are working on fixing this in the new release to align iOS and Android types, and it is scheduled for end of July.