Commit cf6c3a4f6f68656ed05b83a856ddc8f5483edea3

Authored by 刘宏哲
1 parent 5e6ea947

feat(app): change productChannel

@@ -209,7 +209,11 @@ class PurchaseController extends GetxController { @@ -209,7 +209,11 @@ class PurchaseController extends GetxController {
209 Future<void> _unlockWithAlipay(int productId) async { 209 Future<void> _unlockWithAlipay(int productId) async {
210 isUnlocking.value = true; 210 isUnlocking.value = true;
211 try { 211 try {
212 - final orderResult = await _payApi.createOrder(productId: productId); 212 + final orderResult = await _payApi.createOrder(
  213 + productId: productId,
  214 + paymentChannel: PaymentChannel.alipay.value,
  215 + productChannel: ProductChannel.huawei.value,
  216 + );
213 if (orderResult case AppFailure<CreatePayOrderResponse>(:final error)) { 217 if (orderResult case AppFailure<CreatePayOrderResponse>(:final error)) {
214 AppToast.show(error.displayMessage); 218 AppToast.show(error.displayMessage);
215 return; 219 return;
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 }
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "app": { 2 "app": {
3 "bundleName": "com.doublefeel.hmapp", 3 "bundleName": "com.doublefeel.hmapp",
4 "vendor": "DiDi", 4 "vendor": "DiDi",
5 - "versionCode": 100, 5 + "versionCode": 101,
6 "versionName": "2.7.0", 6 "versionName": "2.7.0",
7 "icon": "$media:layered_image", 7 "icon": "$media:layered_image",
8 "label": "$string:app_name" 8 "label": "$string:app_name"
@@ -2,7 +2,7 @@ name: doublefeel_flutter @@ -2,7 +2,7 @@ name: doublefeel_flutter
2 description: "A new Flutter project." 2 description: "A new Flutter project."
3 publish_to: 'none' 3 publish_to: 'none'
4 4
5 -version: 2.7.0+100 5 +version: 2.7.0+101
6 6
7 environment: 7 environment:
8 sdk: ^3.6.2 8 sdk: ^3.6.2
@@ -2,7 +2,7 @@ name: doublefeel_flutter @@ -2,7 +2,7 @@ name: doublefeel_flutter
2 description: "A new Flutter project." 2 description: "A new Flutter project."
3 publish_to: 'none' 3 publish_to: 'none'
4 4
5 -version: 2.7.0+100 5 +version: 2.7.0+101
6 6
7 environment: 7 environment:
8 sdk: ^3.6.2 8 sdk: ^3.6.2