petsHero-AI/lib/features/recharge/models/unacknowledged_google_pay_purchase.dart
2026-03-13 20:09:50 +08:00

29 lines
1.1 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:in_app_purchase/in_app_purchase.dart';
import 'google_pay_verification_payload.dart';
/// 未核销(未确认)的谷歌支付订单。
/// 通过 [GooglePlayPurchaseService.getUnacknowledgedPurchases] 查询得到,
/// 可用于补发回调或本地展示。上报服务端时 federation 可用 [orderId](若服务端支持)或先 createPayment 再回调。
/// 补单成功后需对 [purchaseDetails] 调用 [InAppPurchase.instance.completePurchase] 完成核销。
class UnacknowledgedGooglePayPurchase {
const UnacknowledgedGooglePayPurchase({
required this.orderId,
required this.productId,
required this.payload,
required this.purchaseDetails,
});
/// Google Play 订单号purchase 内 orderId
final String orderId;
/// 商品 IDproductId
final String productId;
/// 凭据,用于 POST /v1/payment/googlepay 的 sample/merchantfederation/asset 由调用方填入。
final GooglePayVerificationPayload payload;
/// 原始购买详情,补单成功后用于 [InAppPurchase.instance.completePurchase]。
final PurchaseDetails purchaseDetails;
}