Skip to content

Commit

Permalink
Merge pull request #201 from Mangopay/improvement/add-reference-to-pa…
Browse files Browse the repository at this point in the history
…ypal

improvement/ Add reference to the new Paypal implementation
  • Loading branch information
iulian03 authored Nov 2, 2023
2 parents c5eefa8 + 35d21c4 commit 78f4005
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion MangoPay.SDK.Tests/ApiPayInsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public async Task Test_PayIns_Create_PayPalWeb()
},
"test",
// CultureCode.FR
shippingPreference: ShippingPreference.SET_PROVIDED_ADDRESS
shippingPreference: ShippingPreference.SET_PROVIDED_ADDRESS,
reference: "Reference"
);

var payIn = await this.Api.PayIns.CreatePayPalWebAsync(payInPost);
Expand Down
2 changes: 2 additions & 0 deletions MangoPay.SDK/Entities/GET/PayInPayPalWebDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public class PayInPayPalWebDTO : PayInDTO
///<summary> Shipping preference
[JsonConverter(typeof(StringEnumConverter))]
public ShippingPreference? ShippingPreference { get; set; }

public string Reference { get; set; }
}
}
2 changes: 2 additions & 0 deletions MangoPay.SDK/Entities/GET/RefundDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ public class RefundDTO : EntityBase

/// <summary>Contains info about the reason for refund.</summary>
public RefundReason RefundReason { get; set; }

public string Reference { get; set; }
}
}
6 changes: 5 additions & 1 deletion MangoPay.SDK/Entities/POST/PayInPayPalWebPostDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public PayInPayPalWebPostDTO(
Shipping shipping = null,
string statementDescriptor = null,
CultureCode? culture = null,
ShippingPreference? shippingPreference = null
ShippingPreference? shippingPreference = null,
string reference = null
)
{
AuthorId = authorId;
Expand All @@ -31,6 +32,7 @@ public PayInPayPalWebPostDTO(
StatementDescriptor = statementDescriptor;
Culture = culture;
ShippingPreference = shippingPreference;
Reference = reference;
}

/// <summary>Author identifier.</summary>
Expand Down Expand Up @@ -70,5 +72,7 @@ public PayInPayPalWebPostDTO(
/// Note that a particular bank may show more or less information.
/// </summary>
public string StatementDescriptor { get; set; }

public string Reference { get; set; }
}
}
5 changes: 4 additions & 1 deletion MangoPay.SDK/Entities/POST/RefundPayInPostDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ public RefundPayInPostDTO(string authorId)
AuthorId = authorId;
}

public RefundPayInPostDTO(string authorId, Money fees, Money debitedFunds)
public RefundPayInPostDTO(string authorId, Money fees, Money debitedFunds, string reference = null)
{
AuthorId = authorId;
Fees = fees;
DebitedFunds = debitedFunds;
Reference = reference;
}

/// <summary>Author identifier.</summary>
Expand All @@ -29,5 +30,7 @@ public RefundPayInPostDTO(string authorId, Money fees, Money debitedFunds)

/// <summary>Fees.</summary>
public Money Fees { get; set; }

public string Reference { get; set; }
}
}

0 comments on commit 78f4005

Please sign in to comment.