|
1
|
import 'package:doublefeel_flutter/app/utils/platform_compact.dart';
|
1
|
import 'package:doublefeel_flutter/app/utils/platform_compact.dart';
|
|
2
|
import 'package:doublefeel_flutter/data/models/pay/apple_pay_order_response.dart';
|
2
|
import 'package:doublefeel_flutter/data/models/pay/apple_pay_order_response.dart';
|
|
3
|
|
3
|
|
|
|
|
4
|
+import '../../../data/models/pay/pay_models.dart';
|
|
4
|
import '../../result/app_result.dart';
|
5
|
import '../../result/app_result.dart';
|
|
5
|
import '../../result/safe_call.dart';
|
6
|
import '../../result/safe_call.dart';
|
|
6
|
-import '../../../data/models/pay/pay_models.dart';
|
|
|
|
7
|
import '../api_paths.dart';
|
7
|
import '../api_paths.dart';
|
|
8
|
import '../dio_client.dart';
|
8
|
import '../dio_client.dart';
|
|
9
|
|
9
|
|
|
@@ -53,7 +53,8 @@ class PayApi { |
|
@@ -53,7 +53,8 @@ class PayApi { |
|
53
|
|
53
|
|
|
54
|
Future<AppResult<CreatePayOrderResponse>> createOrder({
|
54
|
Future<AppResult<CreatePayOrderResponse>> createOrder({
|
|
55
|
required int productId,
|
55
|
required int productId,
|
|
56
|
- int paymentChannel = 2,
|
56
|
+ required int paymentChannel,
|
|
|
|
57
|
+ required int productChannel,
|
|
57
|
}) {
|
58
|
}) {
|
|
58
|
return safeCall(
|
59
|
return safeCall(
|
|
59
|
call: () async {
|
60
|
call: () async {
|
|
@@ -62,6 +63,7 @@ class PayApi { |
|
@@ -62,6 +63,7 @@ class PayApi { |
|
62
|
data: CreatePayOrderRequest(
|
63
|
data: CreatePayOrderRequest(
|
|
63
|
productId: productId,
|
64
|
productId: productId,
|
|
64
|
paymentChannel: paymentChannel,
|
65
|
paymentChannel: paymentChannel,
|
|
|
|
66
|
+ productChannel: productChannel,
|
|
65
|
).toJson(),
|
67
|
).toJson(),
|
|
66
|
);
|
68
|
);
|
|
67
|
return CreatePayOrderResponse.fromJson(
|
69
|
return CreatePayOrderResponse.fromJson(
|
|
@@ -125,6 +127,7 @@ enum ProductType { |
|
@@ -125,6 +127,7 @@ enum ProductType { |
|
125
|
subscriptionVip(10);
|
127
|
subscriptionVip(10);
|
|
126
|
|
128
|
|
|
127
|
const ProductType(this.value);
|
129
|
const ProductType(this.value);
|
|
|
|
130
|
+
|
|
128
|
final int value;
|
131
|
final int value;
|
|
129
|
}
|
132
|
}
|
|
130
|
|
133
|
|
|
@@ -140,6 +143,7 @@ enum ProductChannel { |
|
@@ -140,6 +143,7 @@ enum ProductChannel { |
|
140
|
huawei(3);
|
143
|
huawei(3);
|
|
141
|
|
144
|
|
|
142
|
const ProductChannel(this.value);
|
145
|
const ProductChannel(this.value);
|
|
|
|
146
|
+
|
|
143
|
final int value;
|
147
|
final int value;
|
|
144
|
}
|
148
|
}
|
|
145
|
|
149
|
|
|
@@ -155,5 +159,6 @@ enum PaymentChannel { |
|
@@ -155,5 +159,6 @@ enum PaymentChannel { |
|
155
|
apple(3);
|
159
|
apple(3);
|
|
156
|
|
160
|
|
|
157
|
const PaymentChannel(this.value);
|
161
|
const PaymentChannel(this.value);
|
|
|
|
162
|
+
|
|
158
|
final int value;
|
163
|
final int value;
|
|
159
|
} |
164
|
} |