Skip to content

Commit

Permalink
Revert "Add a fromJson method as a helper for deserialization (#1029)" (
Browse files Browse the repository at this point in the history
#1030)

This reverts commit ade01ba.
  • Loading branch information
DjoykeAbyah authored Jun 21, 2024
1 parent ade01ba commit bdf9b64
Show file tree
Hide file tree
Showing 83 changed files with 16 additions and 1,098 deletions.
9 changes: 0 additions & 9 deletions Adyen.Test/PaymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,6 @@ public void TestCaptureDelaySerialization()
Assert.IsTrue(jsonString.Contains("\"captureDelayHours\": 0,"));
Assert.IsFalse(jsonString.Contains("\"fraudOffset\": 0"));
}

[TestMethod]
public void TestCaptureDelayDeserializationWithFromJson()
{
var paymentRequest = MockPaymentData.CreateFullPaymentRequest3D();
string jsonString = paymentRequest.ToJson();
PaymentRequest3d paymentRequest3d = PaymentRequest3d.FromJson(jsonString);
Assert.AreEqual(paymentRequest, paymentRequest3d);
}

[TestMethod]
public void TestAuthenticationResult3ds1Success()
Expand Down
9 changes: 0 additions & 9 deletions Adyen/Model/Payment/AccountInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,15 +462,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AccountInfo object from the json payload
/// </summary>
/// <returns>AccountInfo</returns>
public static AccountInfo FromJson(string json)
{
return JsonConvert.DeserializeObject<AccountInfo>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down
9 changes: 0 additions & 9 deletions Adyen/Model/Payment/AcctInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AcctInfo object from the json payload
/// </summary>
/// <returns>AcctInfo</returns>
public static AcctInfo FromJson(string json)
{
return JsonConvert.DeserializeObject<AcctInfo>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down
9 changes: 0 additions & 9 deletions Adyen/Model/Payment/AdditionalData3DSecure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AdditionalData3DSecure object from the json payload
/// </summary>
/// <returns>AdditionalData3DSecure</returns>
public static AdditionalData3DSecure FromJson(string json)
{
return JsonConvert.DeserializeObject<AdditionalData3DSecure>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down
30 changes: 1 addition & 29 deletions Adyen/Model/Payment/AdditionalDataAirline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ protected AdditionalDataAirline() { }
/// <param name="airlineCustomerReferenceNumber">The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces.</param>
/// <param name="airlineDocumentType">A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket &#x3D; 01 * minLength: 2 characters * maxLength: 2 characters.</param>
/// <param name="airlineFlightDate">The flight departure date. Local time &#x60;(HH:mm)&#x60; is optional. * Date format: &#x60;yyyy-MM-dd&#x60; * Date and time format: &#x60;yyyy-MM-dd HH:mm&#x60; * minLength: 10 characters * maxLength: 16 characters.</param>
/// <param name="airlineIssueDate">The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD.</param>
/// <param name="airlineLegCarrierCode">The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM &#x3D; KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros..</param>
/// <param name="airlineLegClassOfTravel">A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces *Must not be all zeros..</param>
/// <param name="airlineLegDateOfTravel"> Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format &#x60;yyyy-MM-dd HH:mm&#x60;. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters.</param>
Expand All @@ -69,7 +68,7 @@ protected AdditionalDataAirline() { }
/// <param name="airlineTicketNumber">The ticket&#39;s unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces *Must not be all zeros..</param>
/// <param name="airlineTravelAgencyCode">The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces *Must not be all zeros..</param>
/// <param name="airlineTravelAgencyName">The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces *Must not be all zeros..</param>
public AdditionalDataAirline(string airlineAgencyInvoiceNumber = default(string), string airlineAgencyPlanName = default(string), string airlineAirlineCode = default(string), string airlineAirlineDesignatorCode = default(string), string airlineBoardingFee = default(string), string airlineComputerizedReservationSystem = default(string), string airlineCustomerReferenceNumber = default(string), string airlineDocumentType = default(string), string airlineFlightDate = default(string), string airlineIssueDate = default(string), string airlineLegCarrierCode = default(string), string airlineLegClassOfTravel = default(string), string airlineLegDateOfTravel = default(string), string airlineLegDepartAirport = default(string), string airlineLegDepartTax = default(string), string airlineLegDestinationCode = default(string), string airlineLegFareBaseCode = default(string), string airlineLegFlightNumber = default(string), string airlineLegStopOverCode = default(string), string airlinePassengerDateOfBirth = default(string), string airlinePassengerFirstName = default(string), string airlinePassengerLastName = default(string), string airlinePassengerTelephoneNumber = default(string), string airlinePassengerTravellerType = default(string), string airlinePassengerName = default(string), string airlineTicketIssueAddress = default(string), string airlineTicketNumber = default(string), string airlineTravelAgencyCode = default(string), string airlineTravelAgencyName = default(string))
public AdditionalDataAirline(string airlineAgencyInvoiceNumber = default(string), string airlineAgencyPlanName = default(string), string airlineAirlineCode = default(string), string airlineAirlineDesignatorCode = default(string), string airlineBoardingFee = default(string), string airlineComputerizedReservationSystem = default(string), string airlineCustomerReferenceNumber = default(string), string airlineDocumentType = default(string), string airlineFlightDate = default(string), string airlineLegCarrierCode = default(string), string airlineLegClassOfTravel = default(string), string airlineLegDateOfTravel = default(string), string airlineLegDepartAirport = default(string), string airlineLegDepartTax = default(string), string airlineLegDestinationCode = default(string), string airlineLegFareBaseCode = default(string), string airlineLegFlightNumber = default(string), string airlineLegStopOverCode = default(string), string airlinePassengerDateOfBirth = default(string), string airlinePassengerFirstName = default(string), string airlinePassengerLastName = default(string), string airlinePassengerTelephoneNumber = default(string), string airlinePassengerTravellerType = default(string), string airlinePassengerName = default(string), string airlineTicketIssueAddress = default(string), string airlineTicketNumber = default(string), string airlineTravelAgencyCode = default(string), string airlineTravelAgencyName = default(string))
{
this.AirlinePassengerName = airlinePassengerName;
this.AirlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber;
Expand All @@ -81,7 +80,6 @@ protected AdditionalDataAirline() { }
this.AirlineCustomerReferenceNumber = airlineCustomerReferenceNumber;
this.AirlineDocumentType = airlineDocumentType;
this.AirlineFlightDate = airlineFlightDate;
this.AirlineIssueDate = airlineIssueDate;
this.AirlineLegCarrierCode = airlineLegCarrierCode;
this.AirlineLegClassOfTravel = airlineLegClassOfTravel;
this.AirlineLegDateOfTravel = airlineLegDateOfTravel;
Expand Down Expand Up @@ -165,13 +163,6 @@ protected AdditionalDataAirline() { }
[DataMember(Name = "airline.flight_date", EmitDefaultValue = false)]
public string AirlineFlightDate { get; set; }

/// <summary>
/// The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD
/// </summary>
/// <value>The date that the ticket was issued to the passenger. * minLength: 6 characters * maxLength: 6 characters * Date format: YYMMDD</value>
[DataMember(Name = "airline.issue_date", EmitDefaultValue = false)]
public string AirlineIssueDate { get; set; }

/// <summary>
/// The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM &#x3D; KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros.
/// </summary>
Expand Down Expand Up @@ -322,7 +313,6 @@ public override string ToString()
sb.Append(" AirlineCustomerReferenceNumber: ").Append(AirlineCustomerReferenceNumber).Append("\n");
sb.Append(" AirlineDocumentType: ").Append(AirlineDocumentType).Append("\n");
sb.Append(" AirlineFlightDate: ").Append(AirlineFlightDate).Append("\n");
sb.Append(" AirlineIssueDate: ").Append(AirlineIssueDate).Append("\n");
sb.Append(" AirlineLegCarrierCode: ").Append(AirlineLegCarrierCode).Append("\n");
sb.Append(" AirlineLegClassOfTravel: ").Append(AirlineLegClassOfTravel).Append("\n");
sb.Append(" AirlineLegDateOfTravel: ").Append(AirlineLegDateOfTravel).Append("\n");
Expand Down Expand Up @@ -354,15 +344,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AdditionalDataAirline object from the json payload
/// </summary>
/// <returns>AdditionalDataAirline</returns>
public static AdditionalDataAirline FromJson(string json)
{
return JsonConvert.DeserializeObject<AdditionalDataAirline>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down Expand Up @@ -431,11 +412,6 @@ public bool Equals(AdditionalDataAirline input)
(this.AirlineFlightDate != null &&
this.AirlineFlightDate.Equals(input.AirlineFlightDate))
) &&
(
this.AirlineIssueDate == input.AirlineIssueDate ||
(this.AirlineIssueDate != null &&
this.AirlineIssueDate.Equals(input.AirlineIssueDate))
) &&
(
this.AirlineLegCarrierCode == input.AirlineLegCarrierCode ||
(this.AirlineLegCarrierCode != null &&
Expand Down Expand Up @@ -578,10 +554,6 @@ public override int GetHashCode()
{
hashCode = (hashCode * 59) + this.AirlineFlightDate.GetHashCode();
}
if (this.AirlineIssueDate != null)
{
hashCode = (hashCode * 59) + this.AirlineIssueDate.GetHashCode();
}
if (this.AirlineLegCarrierCode != null)
{
hashCode = (hashCode * 59) + this.AirlineLegCarrierCode.GetHashCode();
Expand Down
9 changes: 0 additions & 9 deletions Adyen/Model/Payment/AdditionalDataCarRental.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AdditionalDataCarRental object from the json payload
/// </summary>
/// <returns>AdditionalDataCarRental</returns>
public static AdditionalDataCarRental FromJson(string json)
{
return JsonConvert.DeserializeObject<AdditionalDataCarRental>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down
9 changes: 0 additions & 9 deletions Adyen/Model/Payment/AdditionalDataCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AdditionalDataCommon object from the json payload
/// </summary>
/// <returns>AdditionalDataCommon</returns>
public static AdditionalDataCommon FromJson(string json)
{
return JsonConvert.DeserializeObject<AdditionalDataCommon>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down
9 changes: 0 additions & 9 deletions Adyen/Model/Payment/AdditionalDataLevel23.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,6 @@ public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// Returns the AdditionalDataLevel23 object from the json payload
/// </summary>
/// <returns>AdditionalDataLevel23</returns>
public static AdditionalDataLevel23 FromJson(string json)
{
return JsonConvert.DeserializeObject<AdditionalDataLevel23>(json);
}

/// <summary>
/// Returns true if objects are equal
Expand Down
Loading

0 comments on commit bdf9b64

Please sign in to comment.