Skip to content

Commit 575fca1

Browse files
committed
use return types for method calls
1 parent be80b6b commit 575fca1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

stripe_platform_interface/lib/src/method_channel_stripe.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class MethodChannelStripe extends StripePlatform {
5050
PaymentMethodParams data, [
5151
Map<String, String> options = const {},
5252
]) async {
53-
final result = await _methodChannel.invokeMethod('createPaymentMethod', {
53+
final result = await _methodChannel
54+
.invokeMapMethod<String, dynamic>('createPaymentMethod', {
5455
'data': data.toJson(),
5556
'options': options,
5657
});
@@ -76,7 +77,8 @@ class MethodChannelStripe extends StripePlatform {
7677
PaymentMethodParams params, [
7778
Map<String, String> options = const {},
7879
]) async {
79-
final result = await _methodChannel.invokeMethod('confirmPaymentMethod', {
80+
final result = await _methodChannel
81+
.invokeMapMethod<String, dynamic>('confirmPaymentMethod', {
8082
'paymentIntentClientSecret': paymentIntentClientSecret,
8183
'data': params.toJson(),
8284
'options': options,
@@ -90,7 +92,8 @@ class MethodChannelStripe extends StripePlatform {
9092
PaymentMethodParams params, [
9193
Map<String, String> options = const {},
9294
]) async {
93-
final result = await _methodChannel.invokeMethod('confirmSetupIntent', {
95+
final result = await _methodChannel
96+
.invokeMapMethod<String, dynamic>('confirmSetupIntent', {
9497
'setupIntentClientSecret': setupIntentClientSecret,
9598
'data': params.toJson(),
9699
'options': options,
@@ -101,7 +104,7 @@ class MethodChannelStripe extends StripePlatform {
101104

102105
@override
103106
Future<String> createTokenForCVCUpdate(String cvc) async {
104-
final result = await _methodChannel.invokeMethod(
107+
final result = await _methodChannel.invokeMethod<String>(
105108
'createTokenForCVCUpdate',
106109
{'cvc': cvc},
107110
);
@@ -112,7 +115,8 @@ class MethodChannelStripe extends StripePlatform {
112115
@override
113116
Future<PaymentIntent> handleCardAction(
114117
String paymentIntentClientSecret) async {
115-
final result = await _methodChannel.invokeMethod('handleCardAction', {
118+
final result = await _methodChannel
119+
.invokeMapMethod<String, dynamic>('handleCardAction', {
116120
'paymentIntentClientSecret': paymentIntentClientSecret,
117121
});
118122

@@ -136,7 +140,8 @@ class MethodChannelStripe extends StripePlatform {
136140

137141
@override
138142
Future<PaymentIntent> retrievePaymentIntent(String clientSecret) async {
139-
final result = await _methodChannel.invokeMethod('retrievePaymentIntent', {
143+
final result = await _methodChannel
144+
.invokeMapMethod<String, dynamic>('retrievePaymentIntent', {
140145
'clientSecret': clientSecret,
141146
});
142147

0 commit comments

Comments
 (0)