Skip to content

Commit ee9b229

Browse files
authored
Merge pull request #143 from Mangopay/feature/Requested3DSVersion
added Requested3DSVersion and Applied3DSVersion
2 parents 2fd7009 + fe8d585 commit ee9b229

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

MangoPay.SDK.Tests/ApiCardPreAuthorizationsTest.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,44 @@ public async Task Test_CardPreAuthorization_Create_WithBilling()
7070
}
7171
}
7272

73+
[Test]
74+
public async Task Test_CardPreAuthorization_Create_WithRequested3DS()
75+
{
76+
try
77+
{
78+
var john = await GetJohn();
79+
CardPreAuthorizationPostDTO cardPreAuthorization = await GetPreAuthorization(john.Id);
80+
Billing billing = new Billing();
81+
Address address = new Address
82+
{
83+
City = "Test city",
84+
AddressLine1 = "Test address line 1",
85+
AddressLine2 = "Test address line 2",
86+
Country = CountryIso.RO,
87+
PostalCode = "65400"
88+
};
89+
billing.Address = address;
90+
billing.FirstName = "Joe";
91+
billing.LastName = "Doe";
92+
cardPreAuthorization.Billing = billing;
93+
cardPreAuthorization.Requested3DSVersion = "V1";
94+
95+
CardPreAuthorizationDTO cardPreAuthorizationPost = await this.Api.CardPreAuthorizations.CreateAsync(cardPreAuthorization);
96+
97+
Assert.IsNotNull(cardPreAuthorizationPost);
98+
Assert.IsNotNull(cardPreAuthorizationPost.Billing);
99+
Assert.IsNotNull(cardPreAuthorizationPost.SecurityInfo);
100+
Assert.IsNotNull(cardPreAuthorizationPost.SecurityInfo.AVSResult);
101+
Assert.AreEqual(cardPreAuthorizationPost.SecurityInfo.AVSResult, AVSResult.NO_CHECK);
102+
Assert.IsNotNull(cardPreAuthorizationPost.Requested3DSVersion);
103+
104+
}
105+
catch (Exception ex)
106+
{
107+
Assert.Fail(ex.Message);
108+
}
109+
}
110+
73111
[Test]
74112
public async Task Test_CardPreAuthorization_Get()
75113
{

MangoPay.SDK.Tests/ApiIdempotencyTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public async Task Test_Idempotency_PayinsCardDirectCreate()
147147
new Money {Amount = 1000, Currency = CurrencyIso.EUR},
148148
new Money {Amount = 0, Currency = CurrencyIso.EUR},
149149
johnsWallet.Id, "http://test.com", card.Id);
150+
payIn.Requested3DSVersion = "V1";
150151
payIn.CardType = card.CardType;
151152
await Api.PayIns.CreateCardDirectAsync(key, payIn);
152153

MangoPay.SDK/Entities/GET/CardPreAuthorizationDTO.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,9 @@ public class CardPreAuthorizationDTO : EntityBase
8181
public Boolean MultiCapture { get; set; }
8282

8383
public Shipping Shipping { get; set; }
84+
85+
public string Requested3DSVersion { get; set; }
86+
87+
public string Applied3DSVersion { get; set; }
8488
}
8589
}

MangoPay.SDK/Entities/POST/CardPreAuthorizationPostDTO.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ public CardPreAuthorizationPostDTO(string authorId, Money debitedFunds, SecureMo
5959
/// </summary>
6060
public string IpAddress { get; set; }
6161

62+
public string Requested3DSVersion { get; set; }
6263
}
6364
}

MangoPay.SDK/Entities/POST/PayInCardDirectPostDTO.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,7 @@ public PayInCardDirectPostDTO(string authorId, string creditedUserId, Money debi
6868
/// → Is mandatory when the flag “Use 3DSV2 Scenario” is active for (FORCE/DEFAULT/FRICTIONLESS both 3)
6969
/// </summary>
7070
public string IpAddress { get; set; }
71+
72+
public string Requested3DSVersion { get; set; }
7173
}
7274
}

0 commit comments

Comments
 (0)