How to use the expo-payments-stripe.PaymentsStripe.createSourceWithParamsAsync function in expo-payments-stripe

To help you get started, we’ve selected a few expo-payments-stripe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / packages / expo-payments-stripe / examples / with-expokit / src / BySourceScreen.js View on Github external
handleCreateSourcePress = async () => {
    try {
      this.setState({ loading: true, source: null });

      const source = await Stripe.createSourceWithParamsAsync({
        type: 'alipay',
        amount: 50,
        currency: 'EUR',
        returnURL: Linking.makeUrl('source'),
      });
      this.setState({ loading: false, source });
    } catch (error) {
      this.setState({ loading: false });
    }
  };