|
|
|
import 'package:doublefeel_flutter/app/utils/platform_compact.dart';
|
|
|
|
import 'package:doublefeel_flutter/data/models/pay/apple_pay_order_response.dart';
|
|
|
|
|
|
|
|
import '../../../data/models/pay/pay_models.dart';
|
|
|
|
import '../../result/app_result.dart';
|
|
|
|
import '../../result/safe_call.dart';
|
|
|
|
import '../../../data/models/pay/pay_models.dart';
|
|
|
|
import '../api_paths.dart';
|
|
|
|
import '../dio_client.dart';
|
|
|
|
|
|
...
|
...
|
@@ -53,7 +53,8 @@ class PayApi { |
|
|
|
|
|
|
|
Future<AppResult<CreatePayOrderResponse>> createOrder({
|
|
|
|
required int productId,
|
|
|
|
int paymentChannel = 2,
|
|
|
|
required int paymentChannel,
|
|
|
|
required int productChannel,
|
|
|
|
}) {
|
|
|
|
return safeCall(
|
|
|
|
call: () async {
|
|
...
|
...
|
@@ -62,6 +63,7 @@ class PayApi { |
|
|
|
data: CreatePayOrderRequest(
|
|
|
|
productId: productId,
|
|
|
|
paymentChannel: paymentChannel,
|
|
|
|
productChannel: productChannel,
|
|
|
|
).toJson(),
|
|
|
|
);
|
|
|
|
return CreatePayOrderResponse.fromJson(
|
|
...
|
...
|
@@ -125,6 +127,7 @@ enum ProductType { |
|
|
|
subscriptionVip(10);
|
|
|
|
|
|
|
|
const ProductType(this.value);
|
|
|
|
|
|
|
|
final int value;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -140,6 +143,7 @@ enum ProductChannel { |
|
|
|
huawei(3);
|
|
|
|
|
|
|
|
const ProductChannel(this.value);
|
|
|
|
|
|
|
|
final int value;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -155,5 +159,6 @@ enum PaymentChannel { |
|
|
|
apple(3);
|
|
|
|
|
|
|
|
const PaymentChannel(this.value);
|
|
|
|
|
|
|
|
final int value;
|
|
|
|
} |
...
|
...
|
|