#kencale-testMode

1 messages · Page 1 of 1 (latest)

graceful nimbus
#

Hi there, there is Test Mode switch at the top-right side of the Dashboard. You can use to to turn on/off test mode

lapis dust
#

no its not that

#

we turned it off and switched all keys

#

but within our app, still goes to testmode only

#

btw

#

we are using connect

#

users can registert connect id

graceful nimbus
#

Can you check if you are using a test key in your application?

lapis dust
#

we switched to real key, and we write that key in cloud func

#

live keys

#
#

could you please join our zoom?

#

so you can see our code and maybe solve it instantly

graceful nimbus
#

Let me rephrase your question -> You have set up live key in the cloud func, however, the data shows up in the test mode, but not live mode?

lapis dust
#

please

#

yes

graceful nimbus
#

I'm unable to join video conference, you can share the relevant code with me.

lapis dust
#

we are using flutter

#

dart

#

and you guys don't have any sample in flutter

#

this is a huge problem and waste our a lot of time to research and develop for you, if we need to use stripe

graceful nimbus
#

Sorry to hear that and thank for you feedback. are you using the flutter_stripe lib ?

lapis dust
#

yes

#

Future<void> _displayPaymentSheet(ChefSchema chef) async {
await _initPaymentSheet();
try {
/// 3. display the payment sheet.
await Stripe.instance.presentPaymentSheet(
parameters: PresentPaymentSheetParameters(
clientSecret: _paymentSheetData['paymentIntent'],
confirmPayment: true,
));
setState(() {
_paymentSheetData = null;
});
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Payment successfully completed'),
),
);

#

Future<void> _initPaymentSheet() async {
if (_paymentSheetData != null) {
return;
}
try {
/// 1. create payment intent on the server
_paymentSheetData = await _createPaymentSheet();
if (_paymentSheetData['error'] != null) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('Error code: ${_paymentSheetData['error']}')));
return;
}

  /// 2. initialize the payment sheet
  await Stripe.instance.initPaymentSheet(
    paymentSheetParameters: SetupPaymentSheetParameters(
      // applePay: true,
      // googlePay: true,
      style: ThemeMode.dark,
      testEnv: true,
      merchantCountryCode: 'CA',
      merchantDisplayName: 'Culina',
      customerId: _paymentSheetData['customer'],
      paymentIntentClientSecret: _paymentSheetData['paymentIntent'],
      customerEphemeralKeySecret: _paymentSheetData['ephemeralKey'],
    ),
  );
  setState(() {});
} catch (e) {
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(content: Text('Error: $e')),
  );
  rethrow;
}

}

graceful nimbus
#

can you also send me the payment intent ID?

lapis dust
#

Future<Map<String, dynamic>> _createPaymentSheet() async {
const String _checkoutPath = '/payment-sheet';
// if http throws WRONG_VERSION_NUMBER, try change Uri.http() to Uri.https()
UserController _userController = Provider.of<UserController>(context, listen: false);
final currency = 'cad'; // TODO: something like _userController.getCurrency()
final chefConnectedAccountId = 'acct_1JTfX92QTHPgSlYV'; // TODO: retrieve chef's Stripe Connected Account
// production and local dev env
// final url = Uri.http(_apiBaseLocal, _checkoutPath, queryParameters);
final url = Uri.parse('${Constants.stripeApi}/payment-sheet');
final params = {
'currency': currency,
'email': _userController.currentUser.email,
'chefConnectedAccountId': chefConnectedAccountId,
'orders': formOrderItems(),
'chefUId': _userController.orderList[0].fromUID,
};
final response = await http.post(
url,
headers: {
'Content-Type': 'application/json',
},
body: json.encode(params),
);
if (response.statusCode == 200) {
return json.decode(response.body);
} else {
// TODO: might need an error handler
return null;
}
}

#

pi_3K69MDChxxVYgbnw1pUAnB4D

#

this iss the payment intent id

#

pi_3K69MDChxxVYgbnw1pUAnB4D

graceful nimbus
#

Hi, thanks for the waiting. I can see this payment intent is already registered in the live mode.

lapis dust
#

yes

#

but when we pay in our app

#

the stripe

#

the stripe integrated page has a testMode strip at the left top corner

#

we are confused by this testMode sign

#

we know we all set up everything in real mode, but we see a testmode

graceful nimbus
#

can you send me a screenshot?

lapis dust
#

hold on, i am rebuild the app now

#

Does this "test mode " label means we are still in test mode???

#

If not, how can we remove it ?

graceful nimbus
#

is it a debug build or release build?

lapis dust
#

i am not 100% sure , but i turned the debug label off in android studio

#

do you mind indicate me how to identify which mode I am in and how to switch?

graceful nimbus
#

use flutter run --release

lapis dust
#

we are in debug mode

#

yeah, i just checked this page

#

we are in debug mode

graceful nimbus
#

can you create a release build and see if you still have the TEST MODE label?

lapis dust
#

ok, thanks, but

#

based on your knowledge, does the label goes away when switching to release mode?

graceful nimbus
#

flutter_stripe is a community built lib so I do not too much knowledge on it

#

But I would suggest to give it a try.

lapis dust
#

that is exactly the problem

#

ok, i will have a try. thanks you for your suggest, but what if that still doesn't fix the label issue. what is my next step?

#

or, if I change my question to: i don't care abou the lable, is all my transaction go through stripe now in real mode, regardless of the textmode label?

graceful nimbus
#

your transaction is in live mode, and you can verify it in dashboard

lapis dust
#

but, i don't think so , because, we cannot connect to stripe payment

#

ok

#

i will have a try and get back to you based on new info. thank you