Skip to content

Commit 472d921

Browse files
committed
Fixed issuee with google pay
1 parent 9a6ed7e commit 472d921

6 files changed

Lines changed: 17 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.4.1
2+
* Fixed issue with google pay
3+
14
## 0.4.0
25
* Added extended cookie handling for android 3DS extra cases
36
* Formatted code

lib/src/api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class Api {
201201
return {
202202
'User-Agent': 'Flutter',
203203
'SDK-OS': _platformSpecific.operatingSystem,
204-
'SDK-Version': '0.0.1'
204+
'SDK-Version': '0.4.1'
205205
};
206206
}
207207

lib/src/native.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:convert';
2+
13
import 'package:flutter/services.dart';
24

35
class Native {
@@ -33,8 +35,9 @@ class Native {
3335
return _channel.invokeMethod('applePayComplete', {'success': success});
3436
}
3537

36-
Future<dynamic> googlePay(dynamic configData) {
37-
return _channel.invokeMethod('googlePay', configData);
38+
Future<dynamic> googlePay(dynamic configData) async {
39+
final serializedJson = await _channel.invokeMethod('googlePay', configData);
40+
return jsonDecode(serializedJson);
3841
}
3942

4043
Future<void> androidAddCookie(String url, String cookie) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: cloudipsp_mobile
22
description: Cloudipsp SDK for Mobile(Android, iOS). The only way to accept payment with Fondy service on Flutter platform for mobiles.
3-
version: 0.4.0
3+
version: 0.4.1
44
homepage: https://github.com/cloudipsp/flutter-mobile-sdk
55
repository: https://github.com/cloudipsp/flutter-mobile-sdk
66

test/api_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ const RESPONSE_ERROR = '''
426426
const REQUEST_HEADERS = {
427427
'User-Agent': 'Flutter',
428428
'SDK-OS': 'UnitTestOS',
429-
'SDK-Version': '0.0.1',
429+
'SDK-Version': '0.4.1',
430430
'Accept': 'application/json',
431431
'Content-Type': 'application/json'
432432
};
433433
const REQUEST_HEADERS_3DS = {
434434
'User-Agent': 'Flutter',
435435
'SDK-OS': 'UnitTestOS',
436-
'SDK-Version': '0.0.1',
436+
'SDK-Version': '0.4.1',
437437
'Content-Type': 'application/whoknows'
438438
};

test/native_test.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:convert';
2+
13
import 'package:flutter_test/flutter_test.dart';
24
import 'package:mockito/annotations.dart';
35
import 'package:mockito/mockito.dart';
@@ -67,11 +69,12 @@ void main() {
6769
});
6870

6971
test('googlePay invokes via channel with right params', () async {
72+
final expectedResult = {'some': 'SomeResultAboutGooglePay'};
7073
when(mockedMethodChannel.invokeMethod('googlePay', any))
71-
.thenAnswer((_) async => 'SomeResultAboutGooglePay');
74+
.thenAnswer((_) async => jsonEncode(expectedResult));
7275
final config = {'someKey': 'someValue'};
7376
final result = await native.googlePay(config);
7477
verify(mockedMethodChannel.invokeMethod('googlePay', config)).called(1);
75-
expect(result, 'SomeResultAboutGooglePay');
78+
expect(result, expectedResult);
7679
});
7780
}

0 commit comments

Comments
 (0)