Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update existing response fields to support 2019 api #98

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 27 additions & 39 deletions Omise/Models/Models.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
// Generated from /Omise/Models/Models.tt
// on 28/8/2567 พ.ศ. 15:16:04
// on 22/10/2567 พ.ศ. 00:48:35
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
Expand Down Expand Up @@ -356,8 +356,6 @@ public partial class Charge : ModelBase {
public DateTime PaidAt { get; set; }
[JsonProperty("transaction")]
public string Transaction { get; set; }
[JsonProperty("source_of_fund")]
public SourceOfFunds SourceOfFund { get; set; }
[JsonProperty("card")]
public Card Card { get; set; }
[JsonProperty("source")]
Expand All @@ -380,8 +378,6 @@ public partial class Charge : ModelBase {
public string ReturnURI { get; set; }
[JsonProperty("authorize_uri")]
public string AuthorizeURI { get; set; }
[JsonProperty("offsite")]
public OffsiteTypes Offsite { get; set; }
[JsonProperty("installment_terms")]
public int InstallmentTerms { get; set; }
[JsonProperty("platform_fee")]
Expand All @@ -407,7 +403,6 @@ public override bool Equals(object obj) {
object.Equals(this.Paid, another.Paid) &&
object.Equals(this.PaidAt, another.PaidAt) &&
object.Equals(this.Transaction, another.Transaction) &&
object.Equals(this.SourceOfFund, another.SourceOfFund) &&
object.Equals(this.Card, another.Card) &&
object.Equals(this.Source, another.Source) &&
object.Equals(this.RefundedAmount, another.RefundedAmount) &&
Expand All @@ -419,7 +414,6 @@ public override bool Equals(object obj) {
object.Equals(this.Dispute, another.Dispute) &&
object.Equals(this.ReturnURI, another.ReturnURI) &&
object.Equals(this.AuthorizeURI, another.AuthorizeURI) &&
object.Equals(this.Offsite, another.Offsite) &&
object.Equals(this.InstallmentTerms, another.InstallmentTerms) &&
object.Equals(this.PlatformFee, another.PlatformFee) &&
true;
Expand Down Expand Up @@ -470,9 +464,6 @@ public override int GetHashCode() {
if (Transaction != default(string)) {
hash = hash * 23 + Transaction.GetHashCode();
}
if (SourceOfFund != default(SourceOfFunds)) {
hash = hash * 23 + SourceOfFund.GetHashCode();
}
if (Card != default(Card)) {
hash = hash * 23 + Card.GetHashCode();
}
Expand Down Expand Up @@ -506,9 +497,6 @@ public override int GetHashCode() {
if (AuthorizeURI != default(string)) {
hash = hash * 23 + AuthorizeURI.GetHashCode();
}
if (Offsite != default(OffsiteTypes)) {
hash = hash * 23 + Offsite.GetHashCode();
}
if (InstallmentTerms != default(int)) {
hash = hash * 23 + InstallmentTerms.GetHashCode();
}
Expand Down Expand Up @@ -880,14 +868,14 @@ public override int GetHashCode() {
}

public partial class PaymentMethod : ModelBase {
[JsonProperty("type")]
public string Type { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("currencies")]
public List<string> Currencies { get; set; }
[JsonProperty("brands")]
public List<string> Brands { get; set; }
[JsonProperty("allowed_installment_terms")]
public List<int> AllowedInstallmentTerms { get; set; }
[JsonProperty("card_brands")]
public List<string> CardBrands { get; set; }
[JsonProperty("installment_terms")]
public List<int> InstallmentTerms { get; set; }
[JsonProperty("banks")]
public List<Bank> Banks { get; set; }

Expand All @@ -897,28 +885,28 @@ public override bool Equals(object obj) {
if (another == null) return false;

return base.Equals(obj) &&
object.Equals(this.Type, another.Type) &&
object.Equals(this.Name, another.Name) &&
object.Equals(this.Currencies, another.Currencies) &&
object.Equals(this.Brands, another.Brands) &&
object.Equals(this.AllowedInstallmentTerms, another.AllowedInstallmentTerms) &&
object.Equals(this.CardBrands, another.CardBrands) &&
object.Equals(this.InstallmentTerms, another.InstallmentTerms) &&
object.Equals(this.Banks, another.Banks) &&
true;
}

public override int GetHashCode() {
unchecked {
int hash = 17;
if (Type != default(string)) {
hash = hash * 23 + Type.GetHashCode();
if (Name != default(string)) {
hash = hash * 23 + Name.GetHashCode();
}
if (Currencies != default(List<string>)) {
hash = hash * 23 + Currencies.GetHashCode();
}
if (Brands != default(List<string>)) {
hash = hash * 23 + Brands.GetHashCode();
if (CardBrands != default(List<string>)) {
hash = hash * 23 + CardBrands.GetHashCode();
}
if (AllowedInstallmentTerms != default(List<int>)) {
hash = hash * 23 + AllowedInstallmentTerms.GetHashCode();
if (InstallmentTerms != default(List<int>)) {
hash = hash * 23 + InstallmentTerms.GetHashCode();
}
if (Banks != default(List<Bank>)) {
hash = hash * 23 + Banks.GetHashCode();
Expand Down Expand Up @@ -1532,10 +1520,10 @@ public partial class Schedule : ModelBase {
public ScheduleOn On { get; set; }
[JsonProperty("in_words")]
public String InWords { get; set; }
[JsonProperty("start_date")]
public DateTime StartDate { get; set; }
[JsonProperty("end_date")]
public DateTime EndDate { get; set; }
[JsonProperty("start_on")]
public DateTime StartOn { get; set; }
[JsonProperty("end_on")]
public DateTime EndOn { get; set; }
[JsonProperty("charge")]
public ChargeScheduling Charge { get; set; }
[JsonProperty("transfer")]
Expand All @@ -1556,8 +1544,8 @@ public override bool Equals(object obj) {
object.Equals(this.Period, another.Period) &&
object.Equals(this.On, another.On) &&
object.Equals(this.InWords, another.InWords) &&
object.Equals(this.StartDate, another.StartDate) &&
object.Equals(this.EndDate, another.EndDate) &&
object.Equals(this.StartOn, another.StartOn) &&
object.Equals(this.EndOn, another.EndOn) &&
object.Equals(this.Charge, another.Charge) &&
object.Equals(this.Transfer, another.Transfer) &&
object.Equals(this.Occurrences, another.Occurrences) &&
Expand All @@ -1583,11 +1571,11 @@ public override int GetHashCode() {
if (InWords != default(String)) {
hash = hash * 23 + InWords.GetHashCode();
}
if (StartDate != default(DateTime)) {
hash = hash * 23 + StartDate.GetHashCode();
if (StartOn != default(DateTime)) {
hash = hash * 23 + StartOn.GetHashCode();
}
if (EndDate != default(DateTime)) {
hash = hash * 23 + EndDate.GetHashCode();
if (EndOn != default(DateTime)) {
hash = hash * 23 + EndOn.GetHashCode();
}
if (Charge != default(ChargeScheduling)) {
hash = hash * 23 + Charge.GetHashCode();
Expand Down Expand Up @@ -1730,7 +1718,7 @@ public override int GetHashCode() {
public partial class Transfer : ModelBase {
[JsonProperty("recipient")]
public string Recipient { get; set; }
[JsonProperty("bankaccount")]
[JsonProperty("bank_account")]
public BankAccount BankAccount { get; set; }
[JsonProperty("sent")]
public bool Sent { get; set; }
Expand Down
14 changes: 6 additions & 8 deletions Omise/Models/Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Charge
Paid bool
PaidAt DateTime paid_at
Transaction string
SourceOfFund SourceOfFunds source_of_fund
Card Card
Source PaymentSource
RefundedAmount long refunded_amount
Expand All @@ -62,7 +61,6 @@ Charge
Dispute Dispute
ReturnURI string return_uri
AuthorizeURI string authorize_uri
Offsite OffsiteTypes
InstallmentTerms int installment_terms
PlatformFee PlatformFee platform_fee
PlatformFee
Expand Down Expand Up @@ -107,10 +105,10 @@ Occurrence
Message String
Result String
PaymentMethod
Type string
Name string
Currencies List<string>
Brands List<string>
AllowedInstallmentTerms List<int> allowed_installment_terms
CardBrands List<string> card_brands
InstallmentTerms List<int> installment_terms
Banks List<Bank>
PaymentReference
OmiseTaxId string
Expand Down Expand Up @@ -198,8 +196,8 @@ Schedule
Period SchedulePeriod
On ScheduleOn
InWords String in_words
StartDate DateTime start_date
EndDate DateTime end_date
StartOn DateTime start_on
EndOn DateTime end_on
Charge ChargeScheduling
Transfer TransferScheduling
Occurrences ScopedList<Occurrence>
Expand All @@ -219,7 +217,7 @@ Transaction
Transferable DateTime
Transfer
Recipient string
BankAccount BankAccount
BankAccount BankAccount bank_account
Sent bool
Paid bool
Fee long
Expand Down
1 change: 1 addition & 0 deletions Omise/Models/ScheduleStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Omise.Models
public enum ScheduleStatus
{
Active,
Paused,
Expiring,
Expired,
Deleted,
Expand Down
Loading