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

Rename some properties for consistency #1430

Merged
merged 1 commit into from
Dec 13, 2018
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
12 changes: 10 additions & 2 deletions src/Stripe.net/Entities/Accounts/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ public class Account : StripeEntity, IHasId, IHasMetadata, IHasObject, IPaymentS
public string Object { get; set; }

#region Expandable BusinessLogo
public string BusinessLogoFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) A logo for this account (at least 128px x 128px).
/// <para>Expandable.</para>
/// </summary>
public string BusinessLogoId { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm Are we sure we want to get rid of the File part? This was a good way to infer something is the file id. The new name does not match the API name either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's internally inconsistent with how other expandable fields are named and how attributes are named in general.

That said, I can add XML comments to indicate that this is a file ID.


/// <summary>
/// (Expanded) A logo for this account (at least 128px x 128px).
/// </summary>
[JsonIgnore]
public File BusinessLogo { get; set; }

Expand All @@ -24,7 +32,7 @@ internal object InternalBusinessLogo
{
set
{
StringOrObject<File>.Map(value, s => this.BusinessLogoFileId = s, o => this.BusinessLogo = o);
StringOrObject<File>.Map(value, s => this.BusinessLogoId = s, o => this.BusinessLogo = o);
}
}
#endregion
Expand Down
24 changes: 22 additions & 2 deletions src/Stripe.net/Entities/Accounts/LegalEntityVerification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ public class LegalEntityVerification : StripeEntity
public string DetailsCode { get; set; }

#region Expandable Document

/// <summary>
/// (ID of a <see cref="File"/>) A photo (jpg or png) of the front of an identifying
/// document, either a passport or local ID card.
/// <para>Expandable.</para>
/// </summary>
public string DocumentId { get; set; }

/// <summary>
/// (Expanded) A photo (jpg or png) of the front of an identifying document, either a
/// passport or local ID card.
/// </summary>
[JsonIgnore]
public File Document { get; set; }

Expand All @@ -28,8 +38,18 @@ internal object InternalDocument
#endregion

#region Expandable Document Back
public string DocumentIdBack { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) A photo (jpg or png) of the back of an identifying
/// document, either a passport or local ID card.
/// <para>Expandable.</para>
/// </summary>
public string DocumentBackId { get; set; }

/// <summary>
/// (Expanded) A photo (jpg or png) of the back of an identifying document, either a
/// passport or local ID card.
/// </summary>
[JsonIgnore]
public File DocumentBack { get; set; }

Expand All @@ -38,7 +58,7 @@ internal object InternalDocumentBack
{
set
{
StringOrObject<File>.Map(value, s => this.DocumentIdBack = s, o => this.DocumentBack = o);
StringOrObject<File>.Map(value, s => this.DocumentBackId = s, o => this.DocumentBack = o);
}
}
#endregion
Expand Down
155 changes: 125 additions & 30 deletions src/Stripe.net/Entities/Disputes/Evidence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ public class Evidence : StripeEntity
public string BillingAddress { get; set; }

#region Expandable Cancellation Policy
public string CancellationPolicyFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Your subscription cancellation policy, as shown to the
/// customer.
/// <para>Expandable.</para>
/// </summary>
public string CancellationPolicyId { get; set; }

/// <summary>
/// (Expanded) Your subscription cancellation policy, as shown to the customer.
/// </summary>
[JsonIgnore]
public File CancellationPolicyFile { get; set; }
public File CancellationPolicy { get; set; }

[JsonProperty("cancellation_policy")]
internal object InternalCancellationPolicy
{
set
{
StringOrObject<File>.Map(value, s => this.CancellationPolicyFileId = s, o => this.CancellationPolicyFile = o);
StringOrObject<File>.Map(value, s => this.CancellationPolicyId = s, o => this.CancellationPolicy = o);
}
}
#endregion
Expand All @@ -34,17 +43,30 @@ internal object InternalCancellationPolicy
public string CancellationRebuttal { get; set; }

#region Expandable Customer Communication
public string CustomerCommunicationFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Any communication with the customer that you feel is
/// relevant to your case. Examples include emails proving that the customer received the
/// product or service, or demonstrating their use of or satisfaction with the product or
/// service.
/// <para>Expandable.</para>
/// </summary>
public string CustomerCommunicationId { get; set; }

/// <summary>
/// (Expanded) Any communication with the customer that you feel is relevant to your case.
/// Examples include emails proving that the customer received the product or service, or
/// demonstrating their use of or satisfaction with the product or service.
/// </summary>
[JsonIgnore]
public File CustomerCommunicationFile { get; set; }
public File CustomerCommunication { get; set; }

[JsonProperty("customer_communication")]
internal object InternalCustomerCommunication
{
set
{
StringOrObject<File>.Map(value, s => this.CustomerCommunicationFileId = s, o => this.CustomerCommunicationFile = o);
StringOrObject<File>.Map(value, s => this.CustomerCommunicationId = s, o => this.CustomerCommunication = o);
}
}
#endregion
Expand All @@ -59,33 +81,55 @@ internal object InternalCustomerCommunication
public string CustomerPurchaseIPAddress { get; set; }

#region Expandable Customer Signature
public string CustomerSignatureFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) A relevant document or contract showing the customer’s
/// signature.
/// <para>Expandable.</para>
/// </summary>
public string CustomerSignatureId { get; set; }

/// <summary>
/// (Expanded) A relevant document or contract showing the customer’s signature.
/// </summary>
[JsonIgnore]
public File CustomerSignatureFile { get; set; }
public File CustomerSignature { get; set; }

[JsonProperty("customer_signature")]
internal object InternalCustomerSignatureFile
internal object InternalCustomerSignature
{
set
{
StringOrObject<File>.Map(value, s => this.CustomerSignatureFileId = s, o => this.CustomerSignatureFile = o);
StringOrObject<File>.Map(value, s => this.CustomerSignatureId = s, o => this.CustomerSignature = o);
}
}
#endregion

#region Expandable Duplicate Charge Documentation
public string DuplicateChargeDocumentationFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Documentation for the prior charge that can uniquely
/// identify the charge, such as a receipt, shipping label, work order, etc. This document
/// should be paired with a similar document from the disputed payment that proves the two
/// payments are separate.
/// <para>Expandable.</para>
/// </summary>
public string DuplicateChargeDocumentationId { get; set; }

/// <summary>
/// (Expanded) Documentation for the prior charge that can uniquely identify the charge,
/// such as a receipt, shipping label, work order, etc. This document should be paired with
/// a similar document from the disputed payment that proves the two payments are separate.
/// </summary>
[JsonIgnore]
public File DuplicateChargeDocumentationFile { get; set; }
public File DuplicateChargeDocumentation { get; set; }

[JsonProperty("duplicate_charge_documentation")]
internal object InternalDuplicateChargeDocumentationFile
internal object InternalDuplicateChargeDocumentation
{
set
{
StringOrObject<File>.Map(value, s => this.DuplicateChargeDocumentationFileId = s, o => this.DuplicateChargeDocumentationFile = o);
StringOrObject<File>.Map(value, s => this.DuplicateChargeDocumentationId = s, o => this.DuplicateChargeDocumentation = o);
}
}
#endregion
Expand All @@ -100,33 +144,50 @@ internal object InternalDuplicateChargeDocumentationFile
public string ProductDescription { get; set; }

#region Expandable Receipt
public string ReceiptFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Any receipt or message sent to the customer notifying them
/// of the charge.
/// <para>Expandable.</para>
/// </summary>
public string ReceiptId { get; set; }

/// <summary>
/// (Expanded) Any receipt or message sent to the customer notifying them of the charge.
/// </summary>
[JsonIgnore]
public File ReceiptFile { get; set; }
public File Receipt { get; set; }

[JsonProperty("receipt")]
internal object InternalReceiptFile
internal object InternalReceipt
{
set
{
StringOrObject<File>.Map(value, s => this.ReceiptFileId = s, o => this.ReceiptFile = o);
StringOrObject<File>.Map(value, s => this.ReceiptId = s, o => this.Receipt = o);
}
}
#endregion

#region Expandable Refund Policy
public string RefundPolicyFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Your refund policy, as shown to the customer.
/// <para>Expandable.</para>
/// </summary>
public string RefundPolicyId { get; set; }

/// <summary>
/// (Expanded) Your refund policy, as shown to the customer.
/// </summary>
[JsonIgnore]
public File RefundPolicyFile { get; set; }
public File RefundPolicy { get; set; }

[JsonProperty("refund_policy")]
internal object InternalRefundPolicyFile
internal object InternalRefundPolicy
{
set
{
StringOrObject<File>.Map(value, s => this.RefundPolicyFileId = s, o => this.RefundPolicyFile = o);
StringOrObject<File>.Map(value, s => this.RefundPolicyId = s, o => this.RefundPolicy = o);
}
}
#endregion
Expand All @@ -141,17 +202,29 @@ internal object InternalRefundPolicyFile
public string ServiceDate { get; set; }

#region Expandable Service Documentation
public string ServiceDocumentationFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Documentation showing proof that a service was provided to
/// the customer. This could include a copy of a signed contract, work order, or other form
/// of written agreement.
/// <para>Expandable.</para>
/// </summary>
public string ServiceDocumentationId { get; set; }

/// <summary>
/// (Expanded) Documentation showing proof that a service was provided to the customer.
/// This could include a copy of a signed contract, work order, or other form of written
/// agreement.
/// </summary>
[JsonIgnore]
public File ServiceDocumentationFile { get; set; }
public File ServiceDocumentation { get; set; }

[JsonProperty("service_documentation")]
internal object InternalServiceDocumentationFile
internal object InternalServiceDocumentation
{
set
{
StringOrObject<File>.Map(value, s => this.ServiceDocumentationFileId = s, o => this.ServiceDocumentationFile = o);
StringOrObject<File>.Map(value, s => this.ServiceDocumentationId = s, o => this.ServiceDocumentation = o);
}
}
#endregion
Expand All @@ -166,17 +239,31 @@ internal object InternalServiceDocumentationFile
public string ShippingDate { get; set; }

#region Expandable Shipping Documentation
public string ShippingDocumentationFileId { get; set; }

/// <summary>
/// (ID of a <see cref="File"/>) Documentation showing proof that a product was shipped to
/// the customer at the same address the customer provided to you. This could include a copy
/// of the shipment receipt, shipping label, etc. It should show the customer’s full
/// shipping address, if possible.
/// <para>Expandable.</para>
/// </summary>
public string ShippingDocumentationId { get; set; }

/// <summary>
/// (Expanded) Documentation showing proof that a product was shipped to the customer at
/// the same address the customer provided to you. This could include a copy of the shipment
/// receipt, shipping label, etc. It should show the customer’s full shipping address, if
/// possible.
/// </summary>
[JsonIgnore]
public File ShippingDocumentationFile { get; set; }
public File ShippingDocumentation { get; set; }

[JsonProperty("shipping_documentation")]
internal object InternalShippingDocumentationFile
internal object InternalShippingDocumentation
{
set
{
StringOrObject<File>.Map(value, s => this.ShippingDocumentationFileId = s, o => this.ShippingDocumentationFile = o);
StringOrObject<File>.Map(value, s => this.ShippingDocumentationId = s, o => this.ShippingDocumentation = o);
}
}
#endregion
Expand All @@ -185,8 +272,16 @@ internal object InternalShippingDocumentationFile
public string ShippingTrackingNumber { get; set; }

#region Expandable Uncategorized File

/// <summary>
/// (ID of a <see cref="File"/>) Any additional evidence or statements.
/// <para>Expandable.</para>
/// </summary>
public string UncategorizedFileId { get; set; }

/// <summary>
/// (Expanded) Any additional evidence or statements.
/// </summary>
[JsonIgnore]
public File UncategorizedFile { get; set; }

Expand Down