PaymentCard.fromJson constructor
- Json p
Parses the payment object.
Implementation
factory PaymentCard.fromJson(Json p) => PaymentCard(
id: strOr(p, 'id'),
orderId: str(p, 'order_id'),
orderCode: str(p, 'order_code'),
amount: numOf(p, 'amount') ?? 0,
currency: strOr(p, 'currency', 'VND'),
checkoutUrl: strOr(p, 'checkout_url'),
qrImageUrl: strOr(p, 'qr_image_url'),
qrPayload: _nonEmpty(str(p, 'qr_payload') ?? str(mapOf(p, 'qr') ?? const {}, 'payload')),
code: strOr(p, 'code'),
expiresAt: dateOf(p, 'expires_at'),
status: strOr(p, 'status'),
);