45 lines
1.1 KiB
Dart
45 lines
1.1 KiB
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
import 'package:mnemo_cards_common/src/deeplinks/deeplink.dart';
|
|
|
|
import '../dtos/payment/export.dart';
|
|
|
|
part 'purchase_check.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class PurchaseCheckDeeplink with MnemoCardsDeeplink {
|
|
final String id;
|
|
|
|
@JsonKey(
|
|
fromJson: MnemoCardsProductType.fromName,
|
|
toJson: MnemoCardsProductType.toName,
|
|
)
|
|
final MnemoCardsProductType productType;
|
|
|
|
// For yookassa - same as payment model id
|
|
final String token;
|
|
|
|
@JsonKey(unknownEnumValue: PaymentSystem.unknown)
|
|
final PaymentSystem paymentSystem;
|
|
|
|
static const deeplinkPath = 'check';
|
|
|
|
PurchaseCheckDeeplink({
|
|
required this.id,
|
|
required this.productType,
|
|
required this.token,
|
|
required this.paymentSystem,
|
|
});
|
|
|
|
@override
|
|
String get host => 'purchase';
|
|
|
|
@override
|
|
String get path => deeplinkPath;
|
|
|
|
@override
|
|
Map<String, dynamic>? get queryParameters =>
|
|
_$PurchaseCheckDeeplinkToJson(this);
|
|
|
|
factory PurchaseCheckDeeplink.parse(Uri uri) =>
|
|
_$PurchaseCheckDeeplinkFromJson(uri.queryParameters);
|
|
}
|