question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid Email Address - createPaymentMethod on Android

See original GitHub issue

Describe the bug When submitting the card details to Stripe using the createPaymentMethod function, an error is thrown. This is only happening on Android but is working fine on iOS.

async getPaymentMethod() {
  let {cardholderName} = this.state;

  let billingDetails = {
    name: cardholderName,
  };

  return createPaymentMethod({
    type: 'Card',
    billingDetails,
  }).then(result => {
    if (result.error) {
      throw result.error;
    }
    return result.paymentMethod;
  });
}

To Reproduce Steps to reproduce the behavior:

  1. Copy the above code.
  2. Run on Android.
  3. Trigger the function by passing card details.
  4. See error

Expected behavior A payment method should be returned by Stripe but instead it is throwing an error.

Screenshots Screenshot 2021-11-29 at 15 51 33

Screenshot 2021-11-29 at 15 49 12

Additional Information@stripe/stripe-react-native”: “^0.2.3”, “react”: “17.0.2”, “react-native”: “0.66.0”,

If any further information is needed please comment and I will added it as soon as possible.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
AdamLee321commented, Dec 7, 2021

Thanks for posting your solution. This will work as a temporary fix but email and phone number should not be required for creating a payment method.

https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details

0reactions
charliecruzan-stripecommented, Feb 11, 2022

Going to close this as a duplicate of https://github.com/stripe/stripe-react-native/issues/712

Read more comments on GitHub >

github_iconTop Results From Across the Web

createPaymentMethod - Stripe Developer Resources
Create a PaymentMethod from a coroutine. See Create a PaymentMethod. POST /v1/payment_methods. Return. a PaymentMethod object. Parameters.
Read more >
Create a PaymentMethod – curl - Stripe API reference
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, ... billing_details.email optional. Email address.
Read more >
How to create a Payment Method of type Card from Android ...
Assume you are using Stripe's CardInputWidget control? In this case, you would get the paymentMethodCreateParams from the widget like
Read more >
Fix problems with subscriptions - Android - Google Play Help
Fix problems with paying for a subscription. If your payment method was lost, or stolen, or you got an email saying that your...
Read more >
Xendit API Reference
Android SDK helps you to process digital payments using Xendit with features ... For example, the API servers might return a 401 if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found