feat: iap支付方式
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class KRPurchaseOrderNo {
|
||||
final String orderNo;
|
||||
final String orderNo;
|
||||
|
||||
KRPurchaseOrderNo({required this.orderNo});
|
||||
|
||||
@@ -8,8 +8,6 @@ class KRPurchaseOrderNo {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class KRPurchaseOrderUrl {
|
||||
final String url;
|
||||
|
||||
@@ -22,14 +20,16 @@ class KRPurchaseOrderUrl {
|
||||
|
||||
/// Checkout 响应(参考 Tauri 项目)
|
||||
class KRCheckoutResponse {
|
||||
final String type; // "url" | "qr" | "stripe"
|
||||
final String type; // "url" | "qr" | "stripe" | "apple_iap"
|
||||
final String? checkoutUrl;
|
||||
final KRStripePayment? stripe;
|
||||
final KRIpaPayment? ipa;
|
||||
|
||||
KRCheckoutResponse({
|
||||
required this.type,
|
||||
this.checkoutUrl,
|
||||
this.stripe,
|
||||
this.ipa,
|
||||
});
|
||||
|
||||
factory KRCheckoutResponse.fromJson(Map<String, dynamic> json) {
|
||||
@@ -39,6 +39,7 @@ class KRCheckoutResponse {
|
||||
stripe: json['stripe'] != null
|
||||
? KRStripePayment.fromJson(json['stripe'])
|
||||
: null,
|
||||
ipa: json['ipa'] != null ? KRIpaPayment.fromJson(json['ipa']) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -62,4 +63,25 @@ class KRStripePayment {
|
||||
publishableKey: json['publishable_key'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class KRIpaPayment {
|
||||
final String productId;
|
||||
final String? applicationUsername;
|
||||
final String? orderNo;
|
||||
|
||||
KRIpaPayment({
|
||||
required this.productId,
|
||||
this.applicationUsername,
|
||||
this.orderNo,
|
||||
});
|
||||
|
||||
factory KRIpaPayment.fromJson(Map<String, dynamic> json) {
|
||||
return KRIpaPayment(
|
||||
productId: json['product_id'] ?? json['productId'] ?? '',
|
||||
applicationUsername:
|
||||
json['application_username'] ?? json['applicationUsername'],
|
||||
orderNo: json['order_no'] ?? json['orderNo'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class KRUserAvailableSubscribeList {
|
||||
});
|
||||
|
||||
factory KRUserAvailableSubscribeList.fromJson(Map<String, dynamic> json) {
|
||||
KRLogUtil.kr_i('订阅json列表: ${json}', tag: 'KRUserAvailableSubscribeList');
|
||||
// KRLogUtil.kr_i('订阅json列表: ${json}', tag: 'KRUserAvailableSubscribeList');
|
||||
final List<dynamic> listData = (json['list'] as List<dynamic>?) ?? const [];
|
||||
return KRUserAvailableSubscribeList(
|
||||
list: listData
|
||||
|
||||
Reference in New Issue
Block a user