Skip to content

Commit e19cc76

Browse files
Add unreferenced refund support
1 parent fbae619 commit e19cc76

File tree

112 files changed

+4448
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+4448
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination
2+
{
3+
/// <summary>
4+
/// Abstract destination Class
5+
/// The destination of the unreferenced refund.
6+
/// </summary>
7+
public abstract class AbstractDestination
8+
{
9+
public DestinationType Type;
10+
11+
protected AbstractDestination(DestinationType type)
12+
{
13+
Type = type;
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
2+
AccountHolder;
3+
4+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.
5+
CardDestination
6+
{
7+
/// <summary>
8+
/// card destination Class
9+
/// The destination of the unreferenced refund.
10+
/// </summary>
11+
public class CardDestination : AbstractDestination
12+
{
13+
/// <summary>
14+
/// Initializes a new instance of the CardDestination class.
15+
/// </summary>
16+
public CardDestination() : base(DestinationType.Card)
17+
{
18+
}
19+
20+
/// <summary>
21+
/// The card number.
22+
/// [Required]
23+
/// <= 19
24+
/// </summary>
25+
public string Number { get; set; }
26+
27+
/// <summary>
28+
/// The card's expiration month.
29+
/// [Required]
30+
/// [ 1 .. 2 ] characters [ 1 .. 12 ]
31+
/// </summary>
32+
public int ExpiryMonth { get; set; }
33+
34+
/// <summary>
35+
/// The card's expiration year.
36+
/// [Required]
37+
/// 4 characters
38+
/// </summary>
39+
public int ExpiryYear { get; set; }
40+
41+
/// <summary>
42+
/// The unreferenced refund destination account holder.
43+
/// [Required]
44+
/// </summary>
45+
public AbstractAccountHolder AccountHolder { get; set; }
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
2+
AccountHolder
3+
{
4+
/// <summary>
5+
/// Abstract account_holder Class
6+
/// The unreferenced refund destination account holder.
7+
/// </summary>
8+
public abstract class AbstractAccountHolder
9+
{
10+
public AccountHolderType? Type;
11+
12+
protected AbstractAccountHolder(AccountHolderType type)
13+
{
14+
Type = type;
15+
}
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.AccountHolder
4+
{
5+
public enum AccountHolderType
6+
{
7+
[EnumMember(Value = "individual")]
8+
Individual,
9+
10+
[EnumMember(Value = "corporate")]
11+
Corporate,
12+
13+
[EnumMember(Value = "government")]
14+
Government,
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using Checkout.Common;
2+
3+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
4+
AccountHolder.Common.BillingAddress
5+
{
6+
/// <summary>
7+
/// billing_address
8+
/// The account holder's billing address.
9+
/// If your company is incorporated in the United States, this field is required for all unreferenced refunds you
10+
/// perform.
11+
/// </summary>
12+
public class BillingAddress
13+
{
14+
/// <summary>
15+
/// The first line of the address.
16+
/// [Optional]
17+
/// <= 200
18+
/// </summary>
19+
public string AddressLine1 { get; set; }
20+
21+
/// <summary>
22+
/// The second line of the address.
23+
/// [Optional]
24+
/// <= 200
25+
/// </summary>
26+
public string AddressLine2 { get; set; }
27+
28+
/// <summary>
29+
/// The address city.
30+
/// [Optional]
31+
/// <= 50
32+
/// </summary>
33+
public string City { get; set; }
34+
35+
/// <summary>
36+
/// The address state.
37+
/// [Optional]
38+
/// [ 2 .. 3 ] characters
39+
/// </summary>
40+
public string State { get; set; }
41+
42+
/// <summary>
43+
/// The address ZIP or postal code.
44+
/// You must provide US ZIPs in the format 00000, or 00000-0000.
45+
/// [Optional]
46+
/// <= 10
47+
/// </summary>
48+
public string Zip { get; set; }
49+
50+
/// <summary>
51+
/// The address country, as a two-letter ISO country code.
52+
/// [Optional]
53+
/// 2 characters
54+
/// </summary>
55+
public CountryCode? Country { get; set; }
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
2+
AccountHolder.Common.Identification
3+
{
4+
/// <summary>
5+
/// identification
6+
/// The account holder's identification.
7+
/// Providing identification details for the unreferenced refund recipient increases the likelihood of a successful
8+
/// unreferenced refund.
9+
/// </summary>
10+
public class Identification
11+
{
12+
/// <summary>
13+
/// The type of identification for the account holder.
14+
/// [Required]
15+
/// </summary>
16+
public Type Type { get; set; }
17+
18+
/// <summary>
19+
/// The account holder's identification number.
20+
/// [Required]
21+
/// <= 25
22+
/// </summary>
23+
public string Number { get; set; }
24+
25+
/// <summary>
26+
/// If applicable, the country that issued the account holder's identification, as a two-letter ISO country
27+
/// code.
28+
/// Providing issuing_country increases the likelihood of a successful identity verification.
29+
/// [Optional]
30+
/// 2 characters
31+
/// </summary>
32+
public string IssuingCountry { get; set; }
33+
34+
/// <summary>
35+
/// If applicable, the expiration date of the account holder's identification, in the format YYYY-MM-DD.
36+
/// Providing date_of_expiry increases the likelihood of a successful identity verification.
37+
/// [Optional]
38+
/// 10 characters
39+
/// </summary>
40+
public string DateOfExpiry { get; set; }
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.AccountHolder.Common.Identification
4+
{
5+
public enum Type
6+
{
7+
[EnumMember(Value = "passport")]
8+
Passport,
9+
10+
[EnumMember(Value = "driving_license")]
11+
DrivingLicense,
12+
13+
[EnumMember(Value = "national_id")]
14+
NationalId,
15+
16+
[EnumMember(Value = "company_registration")]
17+
CompanyRegistration,
18+
19+
[EnumMember(Value = "tax_id")]
20+
TaxId,
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Checkout.Common;
2+
3+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
4+
AccountHolder.Common.Phone
5+
{
6+
/// <summary>
7+
/// phone
8+
/// The account holder's phone number.
9+
/// </summary>
10+
public class Phone
11+
{
12+
/// <summary>
13+
/// The international dialing code for the account holder's address country, as an ITU-T E.164 code.
14+
/// [Required]
15+
/// [ 1 .. 7 ] characters
16+
/// </summary>
17+
public CountryCode? CountryCode { get; set; }
18+
19+
/// <summary>
20+
/// The digits of the phone number, not including the country_code.
21+
/// [Required]
22+
/// [ 6 .. 25 ] characters
23+
/// </summary>
24+
public string Number { get; set; }
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
2+
AccountHolder.Common.BillingAddress;
3+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
4+
AccountHolder.Common.Identification;
5+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
6+
AccountHolder.Common.Phone;
7+
8+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
9+
AccountHolder.CorporateAccountHolder
10+
{
11+
/// <summary>
12+
/// corporate account_holder Class
13+
/// The unreferenced refund destination account holder.
14+
/// </summary>
15+
public class CorporateAccountHolder : AbstractAccountHolder
16+
{
17+
/// <summary>
18+
/// Initializes a new instance of the CorporateAccountHolder class.
19+
/// </summary>
20+
public CorporateAccountHolder() : base(AccountHolderType.Corporate)
21+
{
22+
}
23+
24+
/// <summary>
25+
/// The corporate account holder's company name.
26+
/// This must be a valid legal name. The following formats for the company_name value will return a field
27+
/// validation error:
28+
/// a single character
29+
/// all numeric characters
30+
/// all punctuation characters
31+
/// [Required]
32+
/// <= 50
33+
/// </summary>
34+
public string CompanyName { get; set; }
35+
36+
/// <summary>
37+
/// The account holder's billing address.
38+
/// If your company is incorporated in the United States, this field is required for all unreferenced refunds
39+
/// you perform.
40+
/// [Optional]
41+
/// </summary>
42+
public BillingAddress BillingAddress { get; set; }
43+
44+
/// <summary>
45+
/// The account holder's phone number.
46+
/// [Optional]
47+
/// </summary>
48+
public Phone Phone { get; set; }
49+
50+
/// <summary>
51+
/// The account holder's identification.
52+
/// Providing identification details for the unreferenced refund recipient increases the likelihood of a
53+
/// successful unreferenced refund.
54+
/// [Optional]
55+
/// </summary>
56+
public Identification Identification { get; set; }
57+
58+
/// <summary>
59+
/// The account holder's email address.
60+
/// [Optional]
61+
/// <= 255
62+
/// </summary>
63+
public string Email { get; set; }
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
2+
AccountHolder.Common.BillingAddress;
3+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
4+
AccountHolder.Common.Identification;
5+
using Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
6+
AccountHolder.Common.Phone;
7+
8+
namespace Checkout.HandlePaymentsAndPayouts.Payments.POSTPayments.Requests.UnreferencedRefundRequest.Destination.Common.
9+
AccountHolder.GovernmentAccountHolder
10+
{
11+
/// <summary>
12+
/// government account_holder Class
13+
/// The unreferenced refund destination account holder.
14+
/// </summary>
15+
public class GovernmentAccountHolder : AbstractAccountHolder
16+
{
17+
/// <summary>
18+
/// Initializes a new instance of the GovernmentAccountHolder class.
19+
/// </summary>
20+
public GovernmentAccountHolder() : base(AccountHolderType.Government)
21+
{
22+
}
23+
24+
/// <summary>
25+
/// The account holder's company name.
26+
/// This must be a valid legal name. The following formats for the company_name value will return a field
27+
/// validation error:
28+
/// a single character
29+
/// all numeric characters
30+
/// all punctuation characters
31+
/// [Required]
32+
/// <= 50
33+
/// </summary>
34+
public string CompanyName { get; set; }
35+
36+
/// <summary>
37+
/// The account holder's billing address.
38+
/// If your company is incorporated in the United States, this field is required for all unreferenced refunds
39+
/// you perform.
40+
/// [Optional]
41+
/// </summary>
42+
public BillingAddress BillingAddress { get; set; }
43+
44+
/// <summary>
45+
/// The account holder's phone number.
46+
/// [Optional]
47+
/// </summary>
48+
public Phone Phone { get; set; }
49+
50+
/// <summary>
51+
/// The account holder's identification.
52+
/// Providing identification details for the unreferenced refund recipient increases the likelihood of a
53+
/// successful unreferenced refund.
54+
/// [Optional]
55+
/// </summary>
56+
public Identification Identification { get; set; }
57+
58+
/// <summary>
59+
/// The account holder's email address.
60+
/// [Optional]
61+
/// <= 255
62+
/// </summary>
63+
public string Email { get; set; }
64+
}
65+
}

0 commit comments

Comments
 (0)