-
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.
- Loading branch information
1 parent
3632476
commit 0ca9245
Showing
26 changed files
with
486 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -396,3 +396,4 @@ FodyWeavers.xsd | |
|
||
# JetBrains Rider | ||
*.sln.iml | ||
.idea/ |
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,24 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class Address | ||
{ | ||
[JsonPropertyName("address_line_1")] | ||
public string? AddressLine1 { get; set; } | ||
|
||
[JsonPropertyName("address_line_2")] | ||
public string? AddressLine2 { get; set; } | ||
|
||
[JsonPropertyName("admin_area_1")] | ||
public string? AdminArea1 { get; set; } | ||
|
||
[JsonPropertyName("admin_area_2")] | ||
public string? AdminArea2 { get; set; } | ||
|
||
[JsonPropertyName("postal_code")] | ||
public string? PostalCode { get; set; } | ||
|
||
[JsonPropertyName("country_code")] | ||
public string? CountryCode { get; set; } | ||
} |
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,33 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class AmountWithBreakdown : AmountWithCurrencyCodeOptional | ||
{ | ||
public class Breakdown | ||
{ | ||
[JsonPropertyName("item_total")] | ||
public AmountWithCurrencyCode? ItemTotal { get; set; } | ||
|
||
[JsonPropertyName("shipping")] | ||
public AmountWithCurrencyCode? Shipping { get; set; } | ||
|
||
[JsonPropertyName("handling")] | ||
public AmountWithCurrencyCode? Handling { get; set; } | ||
|
||
[JsonPropertyName("tax_total")] | ||
public AmountWithCurrencyCode? TaxTotal { get; set; } | ||
|
||
[JsonPropertyName("insurance")] | ||
public AmountWithCurrencyCode? Insurance { get; set; } | ||
|
||
[JsonPropertyName("shipping_discount")] | ||
public AmountWithCurrencyCode? ShippingDiscount { get; set; } | ||
|
||
[JsonPropertyName("discount")] | ||
public AmountWithCurrencyCode? Discount { get; set; } | ||
} | ||
|
||
[JsonPropertyName("breakdown")] | ||
public Breakdown? BreakdownInfo { get; set; } | ||
} |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class AmountWithCurrencyCode | ||
{ | ||
[JsonPropertyName("currency_code")] | ||
public string? CurrencyCode { get; set; } | ||
|
||
[JsonPropertyName("value")] | ||
public string? Value { get; set; } // Assuming value is a string representing a number, else adjust the type accordingly | ||
} |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class AmountWithCurrencyCodeOptional | ||
{ | ||
[JsonPropertyName("currency_code")] | ||
public string? CurrencyCode { get; set; } | ||
|
||
[JsonPropertyName("value")] | ||
public string? Value { get; set; } | ||
} |
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Text.Json" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,21 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class CreateOrderRequestBody | ||
{ | ||
[JsonPropertyName("intent")] | ||
public string? Intent { get; set; } | ||
|
||
[JsonPropertyName("purchase_units")] | ||
public List<PurchaseUnit>? PurchaseUnits { get; set; } | ||
|
||
[JsonPropertyName("payer")] | ||
public Payer? Payer { get; set; } | ||
|
||
[JsonPropertyName("application_context")] | ||
public OrderApplicationContext? ApplicationContext { get; set; } | ||
|
||
[JsonPropertyName("payment_source")] | ||
public Dictionary<string, object>? PaymentSource { get; set; } | ||
} |
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,21 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class CreditFinancingOffer | ||
{ | ||
[JsonPropertyName("issuer")] | ||
public string? Issuer { get; set; } | ||
|
||
[JsonPropertyName("total_payment")] | ||
public AmountWithCurrencyCodeOptional? TotalPayment { get; set; } | ||
|
||
[JsonPropertyName("total_interest")] | ||
public AmountWithCurrencyCodeOptional? TotalInterest { get; set; } | ||
|
||
[JsonPropertyName("installment_details")] | ||
public InstallmentDetails? InstallmentDetails { get; set; } | ||
|
||
[JsonPropertyName("term")] | ||
public int Term { get; set; } | ||
} |
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,15 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class InstallmentDetails | ||
{ | ||
[JsonPropertyName("period")] | ||
public string? Period { get; set; } | ||
|
||
[JsonPropertyName("interval_duration")] | ||
public string? IntervalDuration { get; set; } | ||
|
||
[JsonPropertyName("payment_due")] | ||
public AmountWithCurrencyCodeOptional? PaymentDue { get; set; } | ||
} |
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,15 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class LinkDescription | ||
{ | ||
[JsonPropertyName("href")] | ||
public string? Href { get; set; } | ||
|
||
[JsonPropertyName("rel")] | ||
public string? Rel { get; set; } | ||
|
||
[JsonPropertyName("method")] | ||
public string? Method { get; set; } | ||
} |
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,21 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class OrderApplicationContext | ||
{ | ||
[JsonPropertyName("brand_name")] | ||
public string? BrandName { get; set; } | ||
|
||
[JsonPropertyName("locale")] | ||
public string? Locale { get; set; } | ||
|
||
[JsonPropertyName("shipping_preference")] | ||
public string? ShippingPreference { get; set; } | ||
|
||
[JsonPropertyName("user_action")] | ||
public string? UserAction { get; set; } | ||
|
||
[JsonPropertyName("payment_method")] | ||
public PaymentMethod? PaymentMethod { get; set; } | ||
} |
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,33 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class OrderResponseBody : OrderResponseBodyMinimal | ||
{ | ||
[JsonPropertyName("create_time")] | ||
public string? CreateTime { get; set; } | ||
|
||
[JsonPropertyName("update_time")] | ||
public string? UpdateTime { get; set; } | ||
|
||
[JsonPropertyName("intent")] | ||
public string? Intent { get; set; } | ||
|
||
[JsonPropertyName("payer")] | ||
public Payer? Payer { get; set; } | ||
|
||
[JsonPropertyName("purchase_units")] | ||
public List<PurchaseUnit>? PurchaseUnits { get; set; } | ||
|
||
[JsonPropertyName("processing_instruction")] | ||
public string? ProcessingInstruction { get; set; } | ||
|
||
[JsonPropertyName("payment_source")] | ||
public Dictionary<string, object>? PaymentSource { get; set; } | ||
|
||
[JsonPropertyName("expiration_time")] | ||
public string? ExpirationTime { get; set; } | ||
|
||
[JsonPropertyName("credit_financing_offer")] | ||
public CreditFinancingOffer? CreditFinancingOffer { get; set; } | ||
} |
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,15 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class OrderResponseBodyMinimal | ||
{ | ||
[JsonPropertyName("id")] | ||
public string? Id { get; set; } | ||
|
||
[JsonPropertyName("status")] | ||
public string? Status { get; set; } | ||
|
||
[JsonPropertyName("links")] | ||
public List<LinkDescription>? Links { get; set; } | ||
} |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class Payee | ||
{ | ||
[JsonPropertyName("merchant_id")] | ||
public string? MerchantId { get; set; } | ||
|
||
[JsonPropertyName("email_address")] | ||
public string? EmailAddress { get; set; } | ||
} |
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,66 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class Payer | ||
{ | ||
public class Name | ||
{ | ||
[JsonPropertyName("given_name")] | ||
[MaxLength(140)] | ||
public string? GivenName { get; set; } | ||
|
||
[JsonPropertyName("surname")] | ||
[MaxLength(140)] | ||
public string? Surname { get; set; } | ||
} | ||
|
||
public class Phone | ||
{ | ||
[JsonPropertyName("phone_type")] | ||
public string? PhoneType { get; set; } | ||
|
||
[JsonPropertyName("phone_number")] | ||
public PhoneNumberType? PhoneNumber { get; set; } | ||
} | ||
|
||
public class PhoneNumberType | ||
{ | ||
[JsonPropertyName("national_number")] | ||
public string? NationalNumber { get; set; } | ||
} | ||
|
||
public class TaxInfo | ||
{ | ||
[JsonPropertyName("tax_id")] | ||
public string? TaxId { get; set; } | ||
|
||
[JsonPropertyName("tax_id_type")] | ||
public string? TaxIdType { get; set; } | ||
} | ||
|
||
[JsonPropertyName("name")] | ||
public Name? NameInfo { get; set; } | ||
|
||
[JsonPropertyName("email_address")] | ||
public string? EmailAddress { get; set; } | ||
|
||
[JsonPropertyName("payer_id")] | ||
public string? PayerId { get; set; } | ||
|
||
[JsonPropertyName("phone")] | ||
public Phone? PhoneInfo { get; set; } | ||
|
||
[JsonPropertyName("birth_date")] | ||
public string? BirthDate { get; set; } | ||
|
||
[JsonPropertyName("tax_info")] | ||
public TaxInfo? TaxInformation { get; set; } | ||
|
||
[JsonPropertyName("address")] | ||
public Address? Address { get; set; } | ||
|
||
[JsonPropertyName("tenant")] | ||
public string? Tenant { get; set; } | ||
} |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class PaymentInstruction | ||
{ | ||
[JsonPropertyName("platform_fees")] | ||
public List<PlatformFee>? PlatformFees { get; set; } | ||
|
||
[JsonPropertyName("disbursement_mode")] | ||
public string? DisbursementMode { get; set; } // Could also be an enum | ||
} |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class PaymentMethod | ||
{ | ||
[JsonPropertyName("payer_selected")] | ||
public string? PayerSelected { get; set; } | ||
|
||
[JsonPropertyName("payee_preferred")] | ||
public string? PayeePreferred { get; set; } | ||
} |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Blazor.PayPal; | ||
|
||
public class PlatformFee | ||
{ | ||
[JsonPropertyName("amount")] | ||
public AmountWithCurrencyCodeOptional? Amount { get; set; } | ||
|
||
[JsonPropertyName("payee")] | ||
public Payee? PayeeInfo { get; set; } | ||
} |
Oops, something went wrong.