// To parse this JSON data, do
//
//     final orderPaymnet = orderPaymnetFromJson(jsondynamic);

import 'dart:convert';

OrderPaymnet orderPaymnetFromJson(dynamic str) =>
    OrderPaymnet.fromJson(json.decode(str));

dynamic orderPaymnetToJson(OrderPaymnet data) => json.encode(data.toJson());

class OrderPaymnet {
  bool? success;
  dynamic code;
  dynamic message;
  PaymentData? data;

  OrderPaymnet({
    this.success,
    this.code,
    this.message,
    this.data,
  });

  factory OrderPaymnet.fromJson(Map<dynamic, dynamic> json) => OrderPaymnet(
        success: json["success"],
        code: json["code"],
        message: json["message"],
        data: PaymentData.fromJson(json["data"]),
      );

  Map<dynamic, dynamic> toJson() => {
        "success": success,
        "code": code,
        "message": message,
        "data": data!.toJson(),
      };
}

class PaymentData {
  dynamic merchantId;
  dynamic merchantTransactionId;
  InstrumentResponse? instrumentResponse;

  PaymentData({
    this.merchantId,
    this.merchantTransactionId,
    this.instrumentResponse,
  });

  factory PaymentData.fromJson(Map<dynamic, dynamic> json) => PaymentData(
        merchantId: json["merchantId"],
        merchantTransactionId: json["merchantTransactionId"],
        instrumentResponse:
            InstrumentResponse.fromJson(json["instrumentResponse"]),
      );

  Map<dynamic, dynamic> toJson() => {
        "merchantId": merchantId,
        "merchantTransactionId": merchantTransactionId,
        "instrumentResponse": instrumentResponse!.toJson(),
      };
}

class InstrumentResponse {
  dynamic type;
  RedirectInfo? redirectInfo;

  InstrumentResponse({
    this.type,
    this.redirectInfo,
  });

  factory InstrumentResponse.fromJson(Map<dynamic, dynamic> json) =>
      InstrumentResponse(
        type: json["type"],
        redirectInfo: RedirectInfo.fromJson(json["redirectInfo"]),
      );

  Map<dynamic, dynamic> toJson() => {
        "type": type,
        "redirectInfo": redirectInfo!.toJson(),
      };
}

class RedirectInfo {
  dynamic url;
  dynamic method;

  RedirectInfo({
    this.url,
    this.method,
  });

  factory RedirectInfo.fromJson(Map<dynamic, dynamic> json) => RedirectInfo(
        url: json["url"],
        method: json["method"],
      );

  Map<dynamic, dynamic> toJson() => {
        "url": url,
        "method": method,
      };
}
