// To parse this JSON data, do
//
//     final paymentSuccess = paymentSuccessFromJson(jsonString);

import 'dart:convert';

PaymentSuccess paymentSuccessFromJson(String str) =>
    PaymentSuccess.fromJson(json.decode(str));

String paymentSuccessToJson(PaymentSuccess data) => json.encode(data.toJson());

class PaymentSuccess {
  String? orderKeyId;
  int? merchantKeyId;
  String? uniqueRequestId;
  String? orderType;
  int? orderAmount;
  dynamic orderId;
  String? orderStatus;
  int? orderPaymentStatus;
  dynamic orderPaymentStatusText;
  int? paymentStatus;
  dynamic paymentTransactionId;
  int? paymentResponseCode;
  dynamic paymentApprovalCode;
  dynamic paymentReasonCode;
  dynamic paymentTransactionRefNo;
  dynamic paymentResponseText;
  dynamic paymentMethod;
  dynamic paymentAccount;
  int? surchargeFees;
  int? surchargeGst;
  int? paymentAmount;
  int? orderRefundTransactionId;
  int? refundPaymentResponseCode;
  dynamic refundPaymentResponseText;
  dynamic refundDateTime;
  dynamic cardType;
  dynamic cardLevel;
  dynamic orderNotes;
  dynamic paymentDateTime;
  dynamic updatedDateTime;
  String? paymentProcessUrl;
  CustomerData? customerData;
  dynamic productData;
  OrderPaymentCustomerData? orderPaymentCustomerData;
  dynamic upiLink;
  dynamic orderPaymentTransactionDetail;
  UserDefinedData? userDefinedData;
  dynamic splitPaymentResponse;
  int? id;

  PaymentSuccess({
    this.orderKeyId,
    this.merchantKeyId,
    this.uniqueRequestId,
    this.orderType,
    this.orderAmount,
    this.orderId,
    this.orderStatus,
    this.orderPaymentStatus,
    this.orderPaymentStatusText,
    this.paymentStatus,
    this.paymentTransactionId,
    this.paymentResponseCode,
    this.paymentApprovalCode,
    this.paymentReasonCode,
    this.paymentTransactionRefNo,
    this.paymentResponseText,
    this.paymentMethod,
    this.paymentAccount,
    this.surchargeFees,
    this.surchargeGst,
    this.paymentAmount,
    this.orderRefundTransactionId,
    this.refundPaymentResponseCode,
    this.refundPaymentResponseText,
    this.refundDateTime,
    this.cardType,
    this.cardLevel,
    this.orderNotes,
    this.paymentDateTime,
    this.updatedDateTime,
    this.paymentProcessUrl,
    this.customerData,
    this.productData,
    this.orderPaymentCustomerData,
    this.upiLink,
    this.orderPaymentTransactionDetail,
    this.userDefinedData,
    this.splitPaymentResponse,
    this.id,
  });

  factory PaymentSuccess.fromJson(Map<String, dynamic> json) => PaymentSuccess(
    orderKeyId: json["OrderKeyId"],
    merchantKeyId: json["MerchantKeyId"],
    uniqueRequestId: json["UniqueRequestId"],
    orderType: json["OrderType"],
    orderAmount: json["OrderAmount"],
    orderId: json["OrderId"],
    orderStatus: json["OrderStatus"],
    orderPaymentStatus: json["OrderPaymentStatus"],
    orderPaymentStatusText: json["OrderPaymentStatusText"],
    paymentStatus: json["PaymentStatus"],
    paymentTransactionId: json["PaymentTransactionId"],
    paymentResponseCode: json["PaymentResponseCode"],
    paymentApprovalCode: json["PaymentApprovalCode"],
    paymentReasonCode: json["PaymentReasonCode"],
    paymentTransactionRefNo: json["PaymentTransactionRefNo"],
    paymentResponseText: json["PaymentResponseText"],
    paymentMethod: json["PaymentMethod"],
    paymentAccount: json["PaymentAccount"],
    surchargeFees: json["SurchargeFees"],
    surchargeGst: json["SurchargeGST"],
    paymentAmount: json["PaymentAmount"],
    orderRefundTransactionId: json["OrderRefundTransactionId"],
    refundPaymentResponseCode: json["RefundPaymentResponseCode"],
    refundPaymentResponseText: json["RefundPaymentResponseText"],
    refundDateTime: json["RefundDateTime"],
    cardType: json["CardType"],
    cardLevel: json["CardLevel"],
    orderNotes: json["OrderNotes"],
    paymentDateTime: json["PaymentDateTime"],
    updatedDateTime: json["UpdatedDateTime"],
    paymentProcessUrl: json["PaymentProcessUrl"],
    customerData: json["CustomerData"] == null
        ? null
        : CustomerData.fromJson(json["CustomerData"]),
    productData: json["ProductData"],
    orderPaymentCustomerData: json["OrderPaymentCustomerData"] == null
        ? null
        : OrderPaymentCustomerData.fromJson(json["OrderPaymentCustomerData"]),
    upiLink: json["UpiLink"],
    orderPaymentTransactionDetail: json["OrderPaymentTransactionDetail"],
    userDefinedData: json["UserDefinedData"] == null
        ? null
        : UserDefinedData.fromJson(json["UserDefinedData"]),
    splitPaymentResponse: json["SplitPaymentResponse"],
    id: json["Id"],
  );

  Map<String, dynamic> toJson() => {
    "OrderKeyId": orderKeyId,
    "MerchantKeyId": merchantKeyId,
    "UniqueRequestId": uniqueRequestId,
    "OrderType": orderType,
    "OrderAmount": orderAmount,
    "OrderId": orderId,
    "OrderStatus": orderStatus,
    "OrderPaymentStatus": orderPaymentStatus,
    "OrderPaymentStatusText": orderPaymentStatusText,
    "PaymentStatus": paymentStatus,
    "PaymentTransactionId": paymentTransactionId,
    "PaymentResponseCode": paymentResponseCode,
    "PaymentApprovalCode": paymentApprovalCode,
    "PaymentReasonCode": paymentReasonCode,
    "PaymentTransactionRefNo": paymentTransactionRefNo,
    "PaymentResponseText": paymentResponseText,
    "PaymentMethod": paymentMethod,
    "PaymentAccount": paymentAccount,
    "SurchargeFees": surchargeFees,
    "SurchargeGST": surchargeGst,
    "PaymentAmount": paymentAmount,
    "OrderRefundTransactionId": orderRefundTransactionId,
    "RefundPaymentResponseCode": refundPaymentResponseCode,
    "RefundPaymentResponseText": refundPaymentResponseText,
    "RefundDateTime": refundDateTime,
    "CardType": cardType,
    "CardLevel": cardLevel,
    "OrderNotes": orderNotes,
    "PaymentDateTime": paymentDateTime,
    "UpdatedDateTime": updatedDateTime,
    "PaymentProcessUrl": paymentProcessUrl,
    "CustomerData": customerData?.toJson(),
    "ProductData": productData,
    "OrderPaymentCustomerData": orderPaymentCustomerData?.toJson(),
    "UpiLink": upiLink,
    "OrderPaymentTransactionDetail": orderPaymentTransactionDetail,
    "UserDefinedData": userDefinedData?.toJson(),
    "SplitPaymentResponse": splitPaymentResponse,
    "Id": id,
  };
}

class CustomerData {
  String? customerId;
  String? customerNotes;
  String? firstName;
  String? lastName;
  String? mobileNo;
  String? email;
  bool? emailReceipt;
  String? billingAddress;
  String? billingCity;
  String? billingState;
  String? billingCountry;
  String? billingZipCode;
  String? shippingFirstName;
  String? shippingLastName;
  String? shippingAddress;
  String? shippingCity;
  String? shippingState;
  String? shippingCountry;
  String? shippingZipCode;
  String? shippingMobileNo;

  CustomerData({
    this.customerId,
    this.customerNotes,
    this.firstName,
    this.lastName,
    this.mobileNo,
    this.email,
    this.emailReceipt,
    this.billingAddress,
    this.billingCity,
    this.billingState,
    this.billingCountry,
    this.billingZipCode,
    this.shippingFirstName,
    this.shippingLastName,
    this.shippingAddress,
    this.shippingCity,
    this.shippingState,
    this.shippingCountry,
    this.shippingZipCode,
    this.shippingMobileNo,
  });

  factory CustomerData.fromJson(Map<String, dynamic> json) => CustomerData(
    customerId: json["CustomerId"],
    customerNotes: json["CustomerNotes"],
    firstName: json["FirstName"],
    lastName: json["LastName"],
    mobileNo: json["MobileNo"],
    email: json["Email"],
    emailReceipt: json["EmailReceipt"],
    billingAddress: json["BillingAddress"],
    billingCity: json["BillingCity"],
    billingState: json["BillingState"],
    billingCountry: json["BillingCountry"],
    billingZipCode: json["BillingZipCode"],
    shippingFirstName: json["ShippingFirstName"],
    shippingLastName: json["ShippingLastName"],
    shippingAddress: json["ShippingAddress"],
    shippingCity: json["ShippingCity"],
    shippingState: json["ShippingState"],
    shippingCountry: json["ShippingCountry"],
    shippingZipCode: json["ShippingZipCode"],
    shippingMobileNo: json["ShippingMobileNo"],
  );

  Map<String, dynamic> toJson() => {
    "CustomerId": customerId,
    "CustomerNotes": customerNotes,
    "FirstName": firstName,
    "LastName": lastName,
    "MobileNo": mobileNo,
    "Email": email,
    "EmailReceipt": emailReceipt,
    "BillingAddress": billingAddress,
    "BillingCity": billingCity,
    "BillingState": billingState,
    "BillingCountry": billingCountry,
    "BillingZipCode": billingZipCode,
    "ShippingFirstName": shippingFirstName,
    "ShippingLastName": shippingLastName,
    "ShippingAddress": shippingAddress,
    "ShippingCity": shippingCity,
    "ShippingState": shippingState,
    "ShippingCountry": shippingCountry,
    "ShippingZipCode": shippingZipCode,
    "ShippingMobileNo": shippingMobileNo,
  };
}

class OrderPaymentCustomerData {
  String? firstName;
  dynamic lastName;
  dynamic address;
  dynamic city;
  dynamic state;
  dynamic zipCode;
  dynamic country;
  String? mobileNo;
  String? email;
  dynamic userId;
  dynamic ipAddress;

  OrderPaymentCustomerData({
    this.firstName,
    this.lastName,
    this.address,
    this.city,
    this.state,
    this.zipCode,
    this.country,
    this.mobileNo,
    this.email,
    this.userId,
    this.ipAddress,
  });

  factory OrderPaymentCustomerData.fromJson(Map<String, dynamic> json) =>
      OrderPaymentCustomerData(
        firstName: json["FirstName"],
        lastName: json["LastName"],
        address: json["Address"],
        city: json["City"],
        state: json["State"],
        zipCode: json["ZipCode"],
        country: json["Country"],
        mobileNo: json["MobileNo"],
        email: json["Email"],
        userId: json["UserId"],
        ipAddress: json["IpAddress"],
      );

  Map<String, dynamic> toJson() => {
    "FirstName": firstName,
    "LastName": lastName,
    "Address": address,
    "City": city,
    "State": state,
    "ZipCode": zipCode,
    "Country": country,
    "MobileNo": mobileNo,
    "Email": email,
    "UserId": userId,
    "IpAddress": ipAddress,
  };
}

class UserDefinedData {
  String? userDefined1;
  dynamic userDefined2;
  dynamic userDefined3;
  dynamic userDefined4;
  dynamic userDefined5;
  dynamic userDefined6;
  dynamic userDefined7;
  dynamic userDefined8;
  dynamic userDefined9;
  dynamic userDefined10;
  dynamic userDefined11;
  dynamic userDefined12;
  dynamic userDefined13;
  dynamic userDefined14;
  dynamic userDefined15;
  dynamic userDefined16;
  dynamic userDefined17;
  dynamic userDefined18;
  dynamic userDefined19;
  dynamic userDefined20;

  UserDefinedData({
    this.userDefined1,
    this.userDefined2,
    this.userDefined3,
    this.userDefined4,
    this.userDefined5,
    this.userDefined6,
    this.userDefined7,
    this.userDefined8,
    this.userDefined9,
    this.userDefined10,
    this.userDefined11,
    this.userDefined12,
    this.userDefined13,
    this.userDefined14,
    this.userDefined15,
    this.userDefined16,
    this.userDefined17,
    this.userDefined18,
    this.userDefined19,
    this.userDefined20,
  });

  factory UserDefinedData.fromJson(Map<String, dynamic> json) =>
      UserDefinedData(
        userDefined1: json["UserDefined1"],
        userDefined2: json["UserDefined2"],
        userDefined3: json["UserDefined3"],
        userDefined4: json["UserDefined4"],
        userDefined5: json["UserDefined5"],
        userDefined6: json["UserDefined6"],
        userDefined7: json["UserDefined7"],
        userDefined8: json["UserDefined8"],
        userDefined9: json["UserDefined9"],
        userDefined10: json["UserDefined10"],
        userDefined11: json["UserDefined11"],
        userDefined12: json["UserDefined12"],
        userDefined13: json["UserDefined13"],
        userDefined14: json["UserDefined14"],
        userDefined15: json["UserDefined15"],
        userDefined16: json["UserDefined16"],
        userDefined17: json["UserDefined17"],
        userDefined18: json["UserDefined18"],
        userDefined19: json["UserDefined19"],
        userDefined20: json["UserDefined20"],
      );

  Map<String, dynamic> toJson() => {
    "UserDefined1": userDefined1,
    "UserDefined2": userDefined2,
    "UserDefined3": userDefined3,
    "UserDefined4": userDefined4,
    "UserDefined5": userDefined5,
    "UserDefined6": userDefined6,
    "UserDefined7": userDefined7,
    "UserDefined8": userDefined8,
    "UserDefined9": userDefined9,
    "UserDefined10": userDefined10,
    "UserDefined11": userDefined11,
    "UserDefined12": userDefined12,
    "UserDefined13": userDefined13,
    "UserDefined14": userDefined14,
    "UserDefined15": userDefined15,
    "UserDefined16": userDefined16,
    "UserDefined17": userDefined17,
    "UserDefined18": userDefined18,
    "UserDefined19": userDefined19,
    "UserDefined20": userDefined20,
  };
}
