Skip to content

Commit

Permalink
Merge pull request #228 from Mangopay/feature/bancontact-payment-flow…
Browse files Browse the repository at this point in the history
…-param

added PaymentFlow param to Bancontact PayIn
  • Loading branch information
iulian03 authored Oct 14, 2024
2 parents 61752b0 + 13f323f commit d4dc6e4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions MangoPay.SDK.Tests/ApiPayInsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ public async Task Test_PayIns_Create_BancontactWeb()
Assert.IsNotNull(fetched.Id);
Assert.AreEqual(CultureCode.NL, fetched.Culture);
Assert.AreEqual(false, fetched.Recurring);
Assert.AreEqual(PaymentFlow.APP, payIn.PaymentFlow);
}
catch (Exception ex)
{
Expand Down
3 changes: 2 additions & 1 deletion MangoPay.SDK.Tests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ protected async Task<PayInBancontactWebPostDTO> GetPayInBancontactWebPost()
null,
null,
false,
CultureCode.NL
CultureCode.NL,
PaymentFlow.APP
);

return payIn;
Expand Down
9 changes: 9 additions & 0 deletions MangoPay.SDK/Core/Enumerations/PaymentFlow.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

namespace MangoPay.SDK.Core.Enumerations
{
public enum PaymentFlow
{
WEB,
APP
}
}
4 changes: 4 additions & 0 deletions MangoPay.SDK/Entities/GET/PayInBancontactWebDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ public class PayInBancontactWebDTO : PayInDTO

/// <summary>Whether the Bancontact pay-ins are being made to be re-used in a recurring payment flow</summary>
public bool? Recurring { get; set; }

/// <summary>Payment flow (default WEB).</summary>
[JsonConverter(typeof(StringEnumConverter))]
public PaymentFlow? PaymentFlow { get; set; }
}
}
8 changes: 7 additions & 1 deletion MangoPay.SDK/Entities/POST/PayInBancontactWebPostDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace MangoPay.SDK.Entities.POST
public class PayInBancontactWebPostDTO : EntityPostBase
{
public PayInBancontactWebPostDTO(string authorId, Money debitedFunds, Money fees, string creditedWalletId,
string returnUrl, string tag = null, string statementDescriptor = null, bool? recurring = null, CultureCode? culture = null)
string returnUrl, string tag = null, string statementDescriptor = null, bool? recurring = null,
CultureCode? culture = null, PaymentFlow? paymentFlow = null)
{
AuthorId = authorId;
DebitedFunds = debitedFunds;
Expand All @@ -18,6 +19,7 @@ public PayInBancontactWebPostDTO(string authorId, Money debitedFunds, Money fees
Tag = tag;
Recurring = recurring;
Culture = culture;
PaymentFlow = paymentFlow;
}

/// <summary>Author identifier.</summary>
Expand All @@ -44,5 +46,9 @@ public PayInBancontactWebPostDTO(string authorId, Money debitedFunds, Money fees

/// <summary>Whether the Bancontact pay-ins are being made to be re-used in a recurring payment flow</summary>
public bool? Recurring { get; set; }

/// <summary>Payment flow (default WEB).</summary>
[JsonConverter(typeof(StringEnumConverter))]
public PaymentFlow? PaymentFlow { get; set; }
}
}

0 comments on commit d4dc6e4

Please sign in to comment.