Reputation: 1665
i'm beginner for flutter. i need connect stripe payment and flutter. so i use stripe_payment: ^1.0.6(https://pub.flutter-io.cn/packages/stripe_payment/versions/1.0.6). using this example i tried to build payment gate way. but their has error "Unrecognized app. Please make sure you trust this app before proceeding".
After that press the continuous button it provide,
In my widget button has following codes,
void _payWithCard() {
StripePayment.createSourceWithParams(SourceParams(
type: 'ideal',
amount: 333,
currency: 'eur',
returnURL: 'projectXXXXX://payment_redirect',
)).then((source) {
setState(() {
_source = source;
});
}).catchError(setError);
}
their has some codes related with my Stripe payment gateway.
@override
void initState() { super.initState();
StripePayment.setOptions(StripeOptions(
publishableKey: "piok_test_pIoKxxxxxxxxxxxxxxTzgP009ywg8JNs",
merchantId: "projectXXXXXsolutions",
androidPayMode: 'test'));
initPlatformState();
}
initPlatformState() async {
if (_type == UniLinksType.string) {
await initPlatformStateForStringUniLinks();
} else {
await initPlatformStateForUriUniLinks();
}
print('init platform state');
}
// Attach a second listener to the stream
getLinksStream().listen((String link) {
print(' got link success: $link');
lartChechOutLoading(context);
}, onError: (err) {
print('got err: $err');
});
// Get the latest link
String initialLink;
Uri initialUri;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
initialLink = await getInitialLink();
print('initial link: $initialLink');
if (initialLink != null) initialUri = Uri.parse(initialLink);
} on PlatformException {
initialLink = 'Failed to get initial link.';
initialUri = null;
} on FormatException {
initialLink = 'Failed to parse the initial link as Uri.';
initialUri = null;
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
setState(() {
_latestLink = initialLink;
_latestUri = initialUri;
});
}
// Get the latest Uri
Uri initialUri;
String initialLink;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
initialUri = await getInitialUri();
print('initial uri: ${initialUri?.path}'
' ${initialUri?.queryParametersAll}');
initialLink = initialUri?.toString();
} on PlatformException {
initialUri = null;
initialLink = 'Failed to get initial uri.';
} on FormatException {
initialUri = null;
initialLink = 'Bad parse the initial link as Uri.';
}
Upvotes: 0
Views: 1187
Reputation: 6250
This little note is shown while operating in TEST
mode, and inform your users that your application hasn't gone through the process of being approved in Google Pay's Business Console (see the troubleshooting guide to learn more).
Also, I'd recommend taking a look at the new official Flutter plugin built by the community in collaboration with Stripe. If you are using other payment providers, you can also easily add Apple and Google Pay to your Flutter applications with the pay plugin.
Upvotes: 0