-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: up to .net8 version in allinone
- Loading branch information
1 parent
758ce78
commit 9b5216a
Showing
51 changed files
with
2,924 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/ActionType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum ActionType | ||
{ | ||
C, | ||
R, | ||
E, | ||
N | ||
} | ||
} |
887 changes: 887 additions & 0 deletions
887
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/AllInOne.cs
Large diffs are not rendered by default.
Oops, something went wrong.
490 changes: 490 additions & 0 deletions
490
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/AllInOneMetadata.cs
Large diffs are not rendered by default.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/AllocateState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum AllocateState | ||
{ | ||
ALL = 9, | ||
NoAppropriations = 0, | ||
Appropriations = 1 | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/Attributes/TextAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace ECPay.Payment.Integration.Attributes | ||
{ | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] | ||
public class TextAttribute : Attribute | ||
{ | ||
public string? Name { get; set; } | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/BindingCardType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum BindingCardType | ||
{ | ||
Yes = 1, | ||
No = 0 | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/CharSetState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum CharSetState : byte | ||
{ | ||
Default, | ||
Big5, | ||
UTF8 | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/CommonMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace ECPay.Payment.Integration | ||
{ | ||
public abstract class CommonMetadata | ||
{ | ||
public abstract class BaseQueryArguments | ||
{ | ||
[Required(ErrorMessage = "{0} is required.")] | ||
[StringLength(20, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? MerchantTradeNo { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public int TimeStamp { get; private set; } | ||
|
||
public BaseQueryArguments() | ||
{ | ||
TimeStamp = Convert.ToInt32((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000L) / 10000000); | ||
} | ||
} | ||
|
||
public abstract class BaseSendArguments | ||
{ | ||
internal string _ItemName = string.Empty; | ||
|
||
internal string _ItemURL = string.Empty; | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
[StringLength(20, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? MerchantTradeNo { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public string? MerchantTradeDate { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
[StringLength(20, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? PaymentType { get; protected set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public decimal TotalAmount { get; set; } | ||
|
||
[StringLength(200, ErrorMessage = "{0} max langth as {1}.")] | ||
[Required(ErrorMessage = "{0} is required.")] | ||
public string? TradeDesc { get; set; } | ||
|
||
public string? ItemName => _ItemName; | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public ItemCollection Items { get; set; } = new ItemCollection(); | ||
|
||
[RegularExpression("^(?:http|https|ftp)://[a-zA-Z0-9\\.\\-]+(?:\\:\\d{1,5})?(?:[A-Za-z0-9\\.\\;\\:\\@\\&\\=\\+\\-\\$\\,\\?/_]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$", ErrorMessage = "{0} is not correct URL.")] | ||
[StringLength(200, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? ItemURL { get; set; } | ||
|
||
[StringLength(100, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? Remark { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
[RegularExpression("^(?:http|https|ftp)://[a-zA-Z0-9\\.\\-]+(?:\\:\\d{1,5})?(?:[A-Za-z0-9\\.\\;\\:\\@\\&\\=\\+\\-\\$\\,\\?/_]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$", ErrorMessage = "{0} is not correct URL.")] | ||
[StringLength(200, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? ReturnURL { get; set; } | ||
|
||
[RegularExpression("^(?:http|https|ftp)://[a-zA-Z0-9\\.\\-]+(?:\\:\\d{1,5})?(?:[A-Za-z0-9\\.\\;\\:\\@\\&\\=\\+\\-\\$\\,\\?/_]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$", ErrorMessage = "{0} is not correct URL.")] | ||
[StringLength(200, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? ClientBackURL { get; set; } | ||
|
||
public BaseSendArguments() | ||
{ | ||
Items = new ItemCollection(); | ||
} | ||
} | ||
|
||
[StringLength(200, ErrorMessage = "{0} max langth as {1}.")] | ||
[Required(ErrorMessage = "{0} is required.")] | ||
[RegularExpression("^(?:http|https|ftp)://[a-zA-Z0-9\\.\\-]+(?:\\:\\d{1,5})?(?:[A-Za-z0-9\\.\\;\\:\\@\\&\\=\\+\\-\\$\\,\\?/_]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$", ErrorMessage = "{0} is not correct URL.")] | ||
public string? ServiceURL { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public HttpMethod ServiceMethod { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public string? HashKey { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
public string? HashIV { get; set; } | ||
|
||
[Required(ErrorMessage = "{0} is required.")] | ||
[StringLength(10, ErrorMessage = "{0} max langth as {1}.")] | ||
public string? MerchantID { get; set; } | ||
|
||
public CommonMetadata() | ||
{ | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/CompareByPaymentMethodAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel; | ||
|
||
namespace ECPay.Payment.Integration | ||
{ | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = true)] | ||
public class CompareByPaymentMethodAttribute : RequiredAttribute | ||
{ | ||
public PaymentMethod PaymentMethod { get; set; } | ||
|
||
public string ConfirmPropertyNames { get; set; } | ||
|
||
public CompareByPaymentMethodAttribute(PaymentMethod paymentMethod, string confirmPropertyNames) | ||
{ | ||
PaymentMethod = paymentMethod; | ||
ConfirmPropertyNames = confirmPropertyNames ?? throw new ArgumentNullException("confirmPropertyNames is null."); | ||
} | ||
|
||
public override bool IsValid(object? value) | ||
{ | ||
object[]? array = value as object[]; | ||
_ = array?[0]; | ||
object? obj2 = array?[1]; | ||
object? component = array?[2]; | ||
_ = array?[3]; | ||
string[] array2 = ConfirmPropertyNames.Split('/'); | ||
PropertyDescriptorCollection propertyDescriptorCollection = TypeDescriptor.GetProperties(component); | ||
var value2 = propertyDescriptorCollection.Find("_PaymentMethod", ignoreCase: true).GetValue(component); | ||
if (PaymentMethod.Equals(value2) && IsValid(obj2) && !PeriodType.None.Equals(obj2)) | ||
{ | ||
string[] array3 = array2; | ||
foreach (string name in array3) | ||
{ | ||
var value3 = propertyDescriptorCollection.Find(name, ignoreCase: true).GetValue(component); | ||
if (!PeriodType.None.Equals(value3) && null != value3) | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/CustomsClearance.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum CustomsClearance | ||
{ | ||
None, | ||
CustomsExport, | ||
ECACustomsExport | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/DeviceType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum DeviceType | ||
{ | ||
PC, | ||
Mobile, | ||
None | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/DonatedInvoice.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum DonatedInvoice | ||
{ | ||
None, | ||
Yes, | ||
No | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/ECPay.Payment.Integration.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<PackageId>Unofficial_ECPayAIO_Net</PackageId> | ||
<Version>1.0.0</Version> | ||
<Authors>tingwei628</Authors> | ||
<Description>Unofficial_ECPayAIO_Net</Description> | ||
<PackageLicenseExpression>GPLv2</PackageLicenseExpression> | ||
<RepositoryUrl>https://github.com/0xc0dec0ffeelab/Unofficial_ECPayAIO_Net</RepositoryUrl> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
39 changes: 39 additions & 0 deletions
39
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/EqualsByPaymentMethodAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace ECPay.Payment.Integration | ||
{ | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = true)] | ||
public class EqualsByPaymentMethodAttribute : ValidationAttribute | ||
{ | ||
public override bool IsValid(object? value) | ||
{ | ||
object[]? array = value as object[]; | ||
_ = array?[0]; | ||
object? obj2 = array?[1]; | ||
_ = array?[2]; | ||
_ = array?[3]; | ||
string? text = obj2?.ToString(); | ||
if (!string.IsNullOrEmpty(text)) | ||
{ | ||
string[] array2 = text.Split('#'); | ||
string[] array3 = array2; | ||
foreach (string value2 in array3) | ||
{ | ||
try | ||
{ | ||
if ((PaymentMethod)Enum.Parse(typeof(PaymentMethod), value2) == PaymentMethod.ALL) | ||
{ | ||
return false; | ||
} | ||
} | ||
catch | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/ExtraPaymentInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum ExtraPaymentInfo | ||
{ | ||
Yes = 1, | ||
No = 0 | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/Helpers/CharSetHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Text; | ||
|
||
namespace ECPay.Payment.Integration.Helpers | ||
{ | ||
public class CharSetHelper | ||
{ | ||
public static Encoding GetCharSet(CharSetState CharSet) | ||
{ | ||
return CharSet switch | ||
{ | ||
CharSetState.Big5 => Encoding.GetEncoding("Big5"), | ||
CharSetState.UTF8 => Encoding.UTF8, | ||
_ => Encoding.Default, | ||
}; | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/HoldTradeType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum HoldTradeType | ||
{ | ||
Yes = 1, | ||
No = 0 | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/HttpMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum HttpMethod | ||
{ | ||
HttpGET, | ||
HttpPOST, | ||
ServerPOST | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/InvoiceState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum InvoiceState | ||
{ | ||
Yes = 1, | ||
No = 0 | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Unofficial_ECPayAIO_Net/ECPay.Payment.Integration/InvoiceVehicleType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public enum InvoiceVehicleType | ||
{ | ||
None, | ||
Member, | ||
NaturalPersonEvidence, | ||
PhoneBarcode | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace ECPay.Payment.Integration | ||
{ | ||
public class Item | ||
{ | ||
public string? Name { get; set; } | ||
|
||
public decimal Price { get; set; } | ||
|
||
public string? Currency { get; set; } | ||
|
||
public int Quantity { get; set; } | ||
|
||
[RequiredByInvoiceMark(ErrorMessage = "{0} is required.")] | ||
public string? Unit { get; set; } | ||
|
||
[RequiredByInvoiceMark(ErrorMessage = "{0} is required.")] | ||
public TaxationType TaxType { get; set; } | ||
|
||
public string? URL { get; set; } | ||
|
||
public Item() | ||
{ | ||
TaxType = TaxationType.None; | ||
} | ||
} | ||
} |
Oops, something went wrong.