Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Payment method missing address #185

Closed
hjudoo opened this issue Jul 7, 2021 · 17 comments · Fixed by #631
Closed

Creating Payment method missing address #185

hjudoo opened this issue Jul 7, 2021 · 17 comments · Fixed by #631
Labels
blocked This issue is blocked by an external dependency issue

Comments

@hjudoo
Copy link

hjudoo commented Jul 7, 2021

Creating payment method not sending address but name, email and phone information sent.
I am using the example no webhooks with cardfield

On stripe:
Request POST body
{
"muid": "xxxxxxxx",
"billing_details": {
"name": "test30 test",
"phone": "5555555555",
"email": "h@gmail.com"
},

"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},

@jonasbark
Copy link
Member

Which method are you using with this Flutter Stripe plugin where you cannot set an address?

@hjudoo
Copy link
Author

hjudoo commented Jul 7, 2021

try {

final billingDetails = BillingDetails(
  email: 'email@stripe.com',
  phone: '+48888000888',
  address: Address(
    city: 'Quebec',
    country: 'CA',
    line1: '1459  Circle Drive',
    line2: '',
    state: 'quebec',
    postalCode: 'j1x1x1',
  ),
); // mocked data for tests

// 2. Create payment method
final paymentMethod =
    await Stripe.instance.createPaymentMethod(PaymentMethodParams.card(
  billingDetails: billingDetails,
));

@jonasbark
Copy link
Member

jonasbark commented Jul 8, 2021

Creating payment method not sending address but name, email and phone information sent.

what exactly do you mean by that? the address in BillingDetails isn't sent? Isn't sent where? To Stripe?
Please share more details

@hjudoo
Copy link
Author

hjudoo commented Jul 8, 2021

sorry I thought I was clear..my bad.
I am using the example Payment No Webhooks. The first step in the code is create payment method and sending parameters BillingDetails. The name, email and phone appears in the stripe payment method that was created but not the address and if I look as the post body(in stripe logs) the address was not sent to stripe. The whole process works even if the address is not sent but it was supposed to send the address aswell

@jgrody
Copy link

jgrody commented Jul 30, 2021

This is happening to me as well.

const billingDetails = stripe.BillingDetails(
  email: 'email@stripe.com',
  phone: '+48888000888',
  name: 'Foo Bar',
  address: stripe.Address(
    line1: '123 main st',
    line2: '',
    city: 'San Diego',
    state: 'CA',
    postalCode: '92103',
    country: 'US',
  ),
);
final paymentMethod = await stripe.Stripe.instance.createPaymentMethod(
  stripe.PaymentMethodParams.card(
    billingDetails: billingDetails,
  ),
);

This is the output BillingDetails object:

BillingDetails(email: email@stripe.com, address: Address(city: null, country: null, line1: null, line2: null, postalCode: null, state: null), phone: +48888000888, name: Foo Bar)

All the Address values are null.

I really need to migrate to a new Stripe package but I've had several issues with this package already and cannot implement it with the existing bugs.

@didnteven
Copy link

Image 8-08-21 at 11 52 AM
Image 8-08-21 at 11 51 AM

I am getting the same issue. Name, phone number, email saving fine. But the Address object isn't saving when calling confirmSetupIntent?

The code where I use the billing details:
(method where the error is happening)

 //3. confirm set up intent
  final setupIntentResult = await Stripe.instance.confirmSetupIntent(
    clientSecret,
    PaymentMethodParams.card(
      billingDetails: billingDetails,
    ),
  );

@musthafa1996
Copy link

This issue has been fixed by the pull request: #284

@chuprik
Copy link

chuprik commented Sep 20, 2021

@jonasbark any updates here? 🙈🙈🙈

@didnteven
Copy link

@jonasbark is this going to be being fixed ? Or are billing details not really needed ?
I thought they might have been good to have for fraud protection.

@jonasbark
Copy link
Member

According to the stripe-react-native repository a fix is coming in the next version

@eliezerp3
Copy link

eliezerp3 commented Dec 10, 2021

Any update on this? Also having this problem. Using this setup:

Future<void> checkout() async {
    final billingDetails = BillingDetails(
      email: 'email@stripe.com',
      phone: '+48888000888',
      address: Address(
        city: 'Houston',
        country: 'US',
        line1: '1459  Circle Drive',
        line2: '',
        state: 'Texas',
        postalCode: '77063',
      ),
    );
    try {
      /// retrieve data from the backend
      final _paymentSheetData = await API.createPaymentIntent();
      print(_paymentSheetData.data);
      await Stripe.instance.initPaymentSheet(
          paymentSheetParameters: SetupPaymentSheetParameters(
        // applePay: true,
        // googlePay: true,
        style: ThemeMode.dark,
        testEnv: true,
        merchantCountryCode: 'US',
        merchantDisplayName: 'Flutter Stripe Store Demo',
        customerId: _paymentSheetData.data['customer_id'],
        paymentIntentClientSecret: _paymentSheetData.data['client_secret'],
        customerEphemeralKeySecret: _paymentSheetData.data['ephemeral_key'],
        billingDetails: billingDetails,
      ));
      
      await Stripe.instance.presentPaymentSheet();
    } catch (e) {
      if (e is StripeException)
        ScaffoldMessenger.of(context).showSnackBar(SnackBar(
            content: Text(
          e.error.localizedMessage ??
              'There was an error proccesing your payment',
          textAlign: TextAlign.center,
        )));
      else
        ScaffoldMessenger.of(context).showSnackBar(SnackBar(
            content: Text(
          e.toString(),
          textAlign: TextAlign.center,
        )));
    }
  }

No billing address showing up in stripe charge.

@remonh87
Copy link
Member

remonh87 commented Dec 15, 2021

we are waiting for a new version to be launched by Stripe that includes the fix. Till now no new release

@jamesblasco jamesblasco added the blocked This issue is blocked by an external dependency issue label Jan 15, 2022
@kcunko1996
Copy link

This problems is still happening any new updates?

@syedabdulbasit1
Copy link

syedabdulbasit1 commented Aug 4, 2022

@remonh87
After updating Flutter Stripe 4.0.0 but still (billing address or billingDetails) is not sent in the stripe dashboard.
Please fix this issue

@khizar1556
Copy link

did anyone resolve this issue?

@syedabdulbasit1
Copy link

syedabdulbasit1 commented Feb 20, 2023

@khizar1556 we have to create a customer for stripe and pass parameter in its API.
Checkout stripe API from its documentation

@memishood
Copy link

memishood commented Jun 12, 2023

I m not sure if it is same error but I guess I also have this issue on 9.2.1

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{me.liigu.liigu_mobility/com.stripe.android.paymentsheet.addresselement.AddressElementActivity}: java.lang.IllegalArgumentException: Required value was null.
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
       at android.app.ActivityThread.-wrap11()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked by an external dependency issue
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.