saved_card_module_input_data.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import '../models/amount.dart';
  2. import '../models/customization_settings.dart';
  3. import '../models/method_save_payment.dart';
  4. import '../models/test_mode_settings.dart';
  5. import '../models/host_parameters.dart';
  6. class SavedBankCardModuleInputData {
  7. String clientApplicationKey;
  8. String title;
  9. String subtitle;
  10. Amount amount;
  11. SavePaymentMethod savePaymentMethod;
  12. String shopId;
  13. String paymentMethodId;
  14. String? gatewayId;
  15. TestModeSettings? testModeSettings;
  16. String? returnUrl;
  17. bool isLoggingEnabled;
  18. CustomizationSettings customizationSettings;
  19. String? customerId;
  20. bool isSafeDeal;
  21. HostParameters? hostParameters;
  22. SavedBankCardModuleInputData(
  23. {required this.clientApplicationKey,
  24. required this.title,
  25. required this.subtitle,
  26. required this.amount,
  27. required this.savePaymentMethod,
  28. required this.shopId,
  29. required this.paymentMethodId,
  30. required this.isSafeDeal,
  31. this.gatewayId,
  32. this.testModeSettings,
  33. this.returnUrl,
  34. this.isLoggingEnabled = false,
  35. this.customizationSettings = const CustomizationSettings(),
  36. this.customerId,
  37. this.hostParameters});
  38. Map<String, dynamic> toJson() => {
  39. 'clientApplicationKey': clientApplicationKey,
  40. 'title': title,
  41. 'subtitle': subtitle,
  42. 'amount': amount.toJson(),
  43. 'savePaymentMethod': savePaymentMethod.toString(),
  44. 'gatewayId': gatewayId,
  45. 'testModeSettings': testModeSettings?.toJson(),
  46. 'shopId': shopId,
  47. 'returnUrl': returnUrl,
  48. 'isLoggingEnabled': isLoggingEnabled,
  49. 'customizationSettings': customizationSettings.toJson(),
  50. 'paymentMethodId': paymentMethodId,
  51. 'customerId': customerId,
  52. 'isSafeDeal': isSafeDeal,
  53. 'hostParameters': hostParameters?.toJson(),
  54. };
  55. }