How to use the expo-payments-stripe.PaymentsStripe.completeApplePayRequestAsync 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 / without-expokit / src / ApplePay.js View on Github external
//requiredShippingAddressFields: ['all'],
          shippingMethods: [
            {
              id: 'fedex',
              label: 'FedEX',
              detail: 'Test @ 10',
              amount: '1.00',
            },
          ],
        }
      );

      this.setState({ loading: false, token });

      if (this.state.complete) {
        await Stripe.completeApplePayRequestAsync();
        this.setState({ status: 'Apple Pay payment completed' });
      } else {
        await Stripe.cancelApplePayRequestAsync();
        this.setState({ status: 'Apple Pay payment cenceled' });
      }
    } catch (error) {
      this.setState({ loading: false, status: `Error: ${error.message}` });
    }
  };