-
Notifications
You must be signed in to change notification settings - Fork 15
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
Omri Mosseri
committed
Sep 5, 2016
1 parent
4682cad
commit aa06929
Showing
7 changed files
with
351 additions
and
7 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
161 changes: 161 additions & 0 deletions
161
Riskified.SDK/Model/ChargebackElements/ChargebackDetails.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,161 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using Riskified.SDK.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Riskified.SDK.Model.ChargebackElements | ||
{ | ||
public class ChargebackDetails : IJsonSerializable | ||
{ | ||
public ChargebackDetails(string id = null, | ||
DateTime? charegbackAt = null, | ||
string chargebackCurrency = null, | ||
float? chargebackAmount = null, | ||
string reasonCode = null, | ||
string reasonDesc = null, | ||
string type = null, | ||
string mid = null, | ||
string arn = null, | ||
string creditCardCompany = null, | ||
DateTime? respondBy = null, | ||
float? feeAmount = null, | ||
string feeCurrency = null, | ||
string cardIssuer = null, | ||
string gateway = null, | ||
string cardholder = null, | ||
string message = null) | ||
{ | ||
this.Id = id; | ||
this.ChargebackAt = charegbackAt; | ||
this.ChargebackCurrency = chargebackCurrency; | ||
this.ChargebackAmount = chargebackAmount; | ||
this.ReasonCode = reasonCode; | ||
this.ReasonDescription = reasonDesc; | ||
this.Type = type; | ||
this.MID = mid; | ||
this.ARN = arn; | ||
this.CreditCardCompany = creditCardCompany; | ||
this.RespondBy = respondBy; | ||
this.FeeAmount = feeAmount; | ||
this.FeeCurrency = feeCurrency; | ||
this.CardIssuer = cardIssuer; | ||
this.Gateway = gateway; | ||
this.Cardholder = cardholder; | ||
this.Message = message; | ||
} | ||
|
||
public void Validate(Utils.Validations validationType = Validations.Weak) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// The chargeback notice id (if applicable). | ||
/// </summary> | ||
[JsonProperty(PropertyName = "id")] | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback date, as recieved from the acquirer. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "chargeback_at")] | ||
public DateTime? ChargebackAt { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback currency, ISO 4217. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "chargeback_currency")] | ||
public string ChargebackCurrency { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback amount as stated in the chargeback notice. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "chargeback_amount")] | ||
public float? ChargebackAmount { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback reason code, as recieved from the acquirer. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "reason_code")] | ||
public string ReasonCode { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback reason description, as recieved from the acquirer. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "reason_description")] | ||
public string ReasonDescription { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback transaction type, as received from the acquirer | ||
/// rfi - Request for Information. | ||
/// cb - Notification of Chargeback. | ||
/// cb2 - Second Chargeback. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "type")] | ||
public string Type { get; set; } | ||
|
||
/// <summary> | ||
/// The merchant account id at the payment gateway | ||
/// </summary> | ||
[JsonProperty(PropertyName = "mid")] | ||
public string MID { get; set; } | ||
|
||
/// <summary> | ||
/// Acquirer Reference Number (ARN) A unique number that tags a credit card transaction when it goes from the | ||
/// merchant's bank (the acquiring bank) through the card scheme to the cardholder's bank (the issuer). | ||
/// </summary> | ||
[JsonProperty(PropertyName = "arn")] | ||
public string ARN { get; set; } | ||
|
||
/// <summary> | ||
/// Credit card brand: VISA, Mastercard, AMEX, JCB, etc. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "credit_card_company")] | ||
public string CreditCardCompany { get; set; } | ||
|
||
/// <summary> | ||
/// Last date to challenge CHB | ||
/// </summary> | ||
[JsonProperty(PropertyName = "respond_by")] | ||
public DateTime? RespondBy { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback fee amount | ||
/// </summary> | ||
[JsonProperty(PropertyName = "fee_amount")] | ||
public float? FeeAmount { get; set; } | ||
|
||
/// <summary> | ||
/// The chargeback fee currency | ||
/// </summary> | ||
[JsonProperty(PropertyName = "fee_currency")] | ||
public string FeeCurrency { get; set; } | ||
|
||
/// <summary> | ||
/// The card issuer | ||
/// </summary> | ||
[JsonProperty(PropertyName = "card_issuer")] | ||
public string CardIssuer { get; set; } | ||
|
||
/// <summary> | ||
/// The payment gateway who processed the order | ||
/// </summary> | ||
[JsonProperty(PropertyName = "gateway")] | ||
public string Gateway { get; set; } | ||
|
||
/// <summary> | ||
/// The identifier of the person who submitted the CHB, as it appears on the chargeback notice | ||
/// </summary> | ||
[JsonProperty(PropertyName = "cardholder")] | ||
public string Cardholder { get; set; } | ||
|
||
/// <summary> | ||
/// Optional issuer message | ||
/// </summary> | ||
[JsonProperty(PropertyName = "message")] | ||
public string Message { 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,80 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using Riskified.SDK.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Riskified.SDK.Model.ChargebackElements | ||
{ | ||
public class DisputeDetails : IJsonSerializable | ||
{ | ||
|
||
public DisputeDetails(string caseId = null, | ||
string status = null, | ||
DateTime? disputedAt = null, | ||
DateTime? expectedResolutionDate = null, | ||
string disputeType = null, | ||
string issuerPocPhoneNumber = null) | ||
{ | ||
this.CaseId = caseId; | ||
this.Status = status; | ||
this.DisputedAt = disputedAt; | ||
this.ExpectedResolutionDate = expectedResolutionDate; | ||
this.DisputeType = disputeType; | ||
this.IssuerPocPhoneNumber = issuerPocPhoneNumber; | ||
} | ||
|
||
public void Validate(Utils.Validations validationType = Validations.Weak) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Dispute identifier as defined by the issuer/gateway | ||
/// </summary> | ||
[JsonProperty(PropertyName = "case_id")] | ||
public string CaseId { get; set; } | ||
|
||
/// <summary> | ||
/// One of the following: | ||
/// candidate | ||
/// ineligible | ||
/// pending | ||
/// won | ||
/// lost | ||
/// Note: we expect to update the api when the dispute status changes | ||
/// </summary> | ||
[JsonProperty(PropertyName = "status")] | ||
public string Status { get; set; } | ||
|
||
/// <summary> | ||
/// When was the dispute sent | ||
/// </summary> | ||
[JsonProperty(PropertyName = "disputed_at")] | ||
public DateTime? DisputedAt { get; set; } | ||
|
||
/// <summary> | ||
/// When should we expect a decision from the issuer (60-75 days usually) | ||
/// </summary> | ||
[JsonProperty(PropertyName = "expected_resolution_date")] | ||
public DateTime? ExpectedResolutionDate { get; set; } | ||
|
||
/// <summary> | ||
/// One of the following: | ||
/// first_dispute | ||
/// second_dispute | ||
/// arbitrary_court | ||
/// Note: we expect to update the api when the dispute status changes | ||
/// </summary> | ||
[JsonProperty(PropertyName = "dispute_type")] | ||
public string DisputeType { get; set; } | ||
|
||
/// <summary> | ||
/// Credit card issuer or gateway provider phone number | ||
/// </summary> | ||
[JsonProperty(PropertyName = "issuer_poc_phone_number")] | ||
public string IssuerPocPhoneNumber { 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,51 @@ | ||
using Newtonsoft.Json; | ||
using Riskified.SDK.Model.OrderElements; | ||
using Riskified.SDK.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Riskified.SDK.Model.ChargebackElements; | ||
|
||
namespace Riskified.SDK.Model | ||
{ | ||
public class OrderChargeback : OrderBase | ||
{ | ||
/// <summary> | ||
/// Creates a new order chargeback | ||
/// </summary> | ||
/// <param name="merchantOrderId">The unique id of the order at the merchant systems</param> | ||
public OrderChargeback(string merchantOrderId, ChargebackDetails chargebackDetails, FulfillmentDetails fulfillment, DisputeDetails disputeDetails) | ||
: base(merchantOrderId) | ||
{ | ||
this.Chargeback = chargebackDetails; | ||
this.Fulfillment = fulfillment; | ||
this.Dispute = disputeDetails; | ||
} | ||
|
||
public override void Validate(Validations validationType = Validations.Weak) | ||
{ | ||
base.Validate(validationType); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonProperty(PropertyName = "chargebackDetails")] | ||
public ChargebackDetails Chargeback { get; set; } | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonProperty(PropertyName = "fulfillmentDetails")] | ||
public FulfillmentDetails Fulfillment { get; set; } | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
[JsonProperty(PropertyName = "disputeDetails")] | ||
public DisputeDetails Dispute { 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
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
Oops, something went wrong.