How to use the tipsi-stripe.paymentRequestWithCardForm function in tipsi-stripe

To help you get started, we’ve selected a few tipsi-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 tipsi / tipsi-stripe / example / src / scenes / PaymentIntentScreen.js View on Github external
onLaunchCardForm = async () => {
    try {
      this.setState({ ...this.state, loading: true, token: null })
      const token = await stripe.paymentRequestWithCardForm(demoCardFormParameters)

      this.setState({ ...this.state, token: token.tokenId })

      // We now have the token, use it to confirm
      const confirmPaymentResult = await stripe.confirmPaymentIntent({
        clientSecret: this.state.paymentIntent.secret,
        paymentMethod: demoPaymentMethodDetailsWithToken(token.tokenId),
      })
      const display = confirmPaymentResult

      this.setState({ ...this.state, display })
    } catch (e) {
      console.log(e)
      this.setState({ loading: false })
    }
  }
github tipsi / tipsi-stripe / example / src / scenes / CardFormScreen.js View on Github external
handleCardPayPress = async () => {
    try {
      this.setState({ loading: true, token: null })
      const token = await stripe.paymentRequestWithCardForm({
        // Only iOS support this options
        smsAutofillDisabled: true,
        requiredBillingAddressFields: 'full',
        prefilledInformation: {
          billingAddress: {
            name: 'Gunilla Haugeh',
            line1: 'Canary Place',
            line2: '3',
            city: 'Macon',
            state: 'Georgia',
            country: 'US',
            postalCode: '31217',
            email: 'ghaugeh0@printfriendly.com',
          },
        },
      })