#diarra

1 messages · Page 1 of 1 (latest)

subtle furnaceBOT
young dome
#

Hi! Let me help you with this.

#

What platform are you using? iOS/Android/React Native?

late mulch
#

I use an android emulator to launch my project, my language is flutter

young dome
late mulch
#

I use this function to have my interface preconfigured from stripe: Future<void> makePayment() async {
try {
paymentIntent = await createPaymentIntent('100', 'USD'); //STEP 2: Initialize Payment Sheet
await Stripe.instance
.initPaymentSheet( paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret:paymentIntent!['client_secret'], //Gotten from payment intent
style: ThemeMode.dark,
merchantDisplayName: 'My shopper',
))
.then((value) {}); //STEP 3: Display Payment sheet
displayPaymentSheet();
} catch (err) {
throwException(err);
}
}

young dome
#

What fields do you want to collect?

late mulch
#

just a field to have the name of the cardholder

young dome
#

It will be collected by default for card.

late mulch
#

good, and how?? is there the possibility after payment to see the name of the cardholder somewhere??? kind is it collected or this name??

young dome
#

It should be available on the Charge object.
Could you please try and send an example PaymentIntent ID or Charge ID?

late mulch
#

you are talking about payment method id
????

young dome
#

No, PaymentIntent. It's an object that holds info about a single payment.

late mulch
#

hummm I have this in my code source : createPaymentIntent(String amount, String currency) async {
try {
//Request body
Map<String, dynamic> body = {
'amount': calculateAmount(amount),
'currency': currency,
};

  //Make post request to Stripe
  var response = await http.post(
    Uri.parse('https://api.stripe.com/v1/payment_intents'),
    headers: {
      'Authorization': 'Bearer ${dotenv.env['STRIPE_SECRET']}',
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: body,
  );
  return json.decode(response.body);
} catch (err) {
  throw Exception(err.toString());
}

}

young dome
#

Yes, can you run this and try to pay? (in Test mode)

late mulch
#

yes

#

I made 7 payments in test mode, and in my dashboard at the payment level I see the payments made

young dome
#

Could you please share the PaymentIntent ID pi_xxx?

late mulch
#

pi_3NDTRfIGy3YRUrDX1p1P4Vck

young dome
#

Okay, I checked and you can use billingDetailsCollectionConfiguration: {name: "always"} when configuring the PaymentSheet

late mulch
#

i.e in this function Future<void> makePayment() async {
try {
paymentIntent = await createPaymentIntent('100', 'USD'); //STEP 2: Initialize Payment Sheet
await Stripe.instance
.initPaymentSheet( paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret:paymentIntent!['client_secret'], //Gotten from payment intent
style: ThemeMode.dark,
merchantDisplayName: 'My shopper',
))
.then((value) {}); //STEP 3: Display Payment sheet
displayPaymentSheet();
} catch (err) {
throwException(err);
}
}

young dome
#

Yes

late mulch
#

and name: "always" is just a word by chance ??? can i change that??

late mulch
#

I have this paremeter billingDetails instead of billingDetailsCollectionConfiguration in the class SetupPaymentSheetParameters

#

in my code

young dome
#

What version are you using?

late mulch
#

stripe version ??

young dome
#

flutter_stripe

late mulch
#

flutter_stripe: ^4.0.0

young dome
#

I see v8.0.0 is released so you might want to update

late mulch
#

so with the flutter_stripe version: ^4.0.0 I can't have the functionality

flat mural
#

Hi there 👋 jumping in as my teammate needed to step away. Since the flutter_stripe package is not one of our official packages, we aren't familiar with the functionality available in its different versions. As my teammate suggsted, reaching out to the owners/maintainers of that package is likely the best approach to get assistance with using it.