Skip to content

Commit

Permalink
Merge pull request #18 from pokepay/fix/bankpay
Browse files Browse the repository at this point in the history
Fix response from getBankPay and createBankPay
  • Loading branch information
DanRidh authored Sep 29, 2023
2 parents ad3c26c + 0fe3ba6 commit e8dcd22
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.0.7
* Fixed `getBankPay`, `createBankPay` response from API

## 2.0.6
* Added `identifyIndividual` API for My Number
* Added `createBankPay`, `getBankPay`, `bankpayTopup` APIs for BankPay
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.11.1'
implementation 'com.fasterxml.jackson.core:jackson-core:2.11.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.1'
implementation 'jp.pocket-change.pokepay.android-sdk:pokepaylib:2.0.6'
implementation 'jp.pocket-change.pokepay.android-sdk:pokepaylib:2.0.7'
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import java.util.Arrays;

import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.MethodCall;
Expand Down Expand Up @@ -930,7 +931,7 @@ private TaskResult invokeMethod() {
GetBankPay req = new GetBankPay(id, privateMoneyId);
Pokepay.setEnv(env);
BankPay[] res = req.send(accessToken);
return new TaskResult(null, res.toString());
return new TaskResult(null, Arrays.toString(res));
}
case "bankpayTopUp": {
Env env = flutterEnvToSDKEnv((int)call.argument("env"));
Expand All @@ -943,6 +944,7 @@ private TaskResult invokeMethod() {
Pokepay.setEnv(env);
UserTransaction res = req.send(accessToken);
return new TaskResult(null, res.toString());
}
case "identifyIndividual": {
Env env = flutterEnvToSDKEnv((int)call.argument("env"));
String accessToken = call.argument("accessToken");
Expand Down
4 changes: 2 additions & 2 deletions ios/pokepay_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'pokepay_sdk'
s.version = '2.0.6'
s.version = '2.0.7'
s.summary = 'Pokepay flutter SDK'
s.description = <<-DESC
Pokepay flutter SDK
Expand All @@ -15,7 +15,7 @@ Pokepay flutter SDK
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'Pokepay', '2.0.6'
s.dependency 'Pokepay', '2.0.7'
s.platform = :ios, '12.0'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
Expand Down
4 changes: 3 additions & 1 deletion lib/bank_api/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ extension UserAPI on PokepayAPI {
String? privateMoneyId,
}) async {
return await invokeMethod<List<BankPay>>(
(j) => (j as List<Map<String, dynamic>>).map(BankPay.fromJson).toList(),
(j) {
return (j as List<dynamic>).map((k) => BankPay.fromJson(k)).toList();
},
'getBankPay',
{
'env': this.env.index,
Expand Down
2 changes: 1 addition & 1 deletion lib/pokepay_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void setLogLevel(LogLevel lev) {

const MethodChannel channel = const MethodChannel('jp.pokepay/pokepay_sdk');

Future<T> invokeMethod<T>(T factory(Map<String, dynamic> data),
Future<T> invokeMethod<T>(T factory(dynamic data),
String methodName, Map<String, dynamic> args) async {
try {
logger.d("methodName: " + methodName + " args: " + args.toString());
Expand Down
2 changes: 1 addition & 1 deletion lib/responses/bankpay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BankPay {
final String bankCode;
final String branchNumber;
final String branchName;
final int depositType;
final String depositType;
final String maskedAccountNumber;
final String accountName;
final String? privateMoneyId;
Expand Down
2 changes: 1 addition & 1 deletion lib/responses/bankpay.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/responses/bankpay_redirect_url.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pokepay_sdk
description: SDK for pokepay
version: 2.0.6
version: 2.0.7
homepage: https://pay.pocket-change.jp/

environment:
Expand Down

0 comments on commit e8dcd22

Please sign in to comment.