Skip to content

Commit c798604

Browse files
Update payment request authentication (#438)
1 parent 395ac90 commit c798604

File tree

9 files changed

+84
-8
lines changed

9 files changed

+84
-8
lines changed

src/CheckoutSdk/Common/Exemption.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,32 @@ namespace Checkout.Common
44
{
55
public enum Exemption
66
{
7-
[EnumMember(Value = "3ds_outage")] ThreeDsOutage,
7+
[EnumMember(Value = "3ds_outage")]
8+
ThreeDsOutage,
89

910
[EnumMember(Value = "low_risk_program")]
1011
LowRiskProgram,
1112

12-
[EnumMember(Value = "low_value")] LowValue,
13-
[EnumMember(Value = "none")] None,
14-
[EnumMember(Value = "other")] Other,
13+
[EnumMember(Value = "low_value")]
14+
LowValue,
15+
16+
[EnumMember(Value = "none")]
17+
None,
18+
19+
[EnumMember(Value = "other")]
20+
Other,
1521

1622
[EnumMember(Value = "out_of_sca_scope")]
1723
OutOfScaScope,
1824

1925
[EnumMember(Value = "recurring_operation")]
2026
RecurringOperation,
2127

22-
[EnumMember(Value = "sca_delegation")] ScaDelegation,
28+
[EnumMember(Value = "data_share")]
29+
DataShare,
30+
31+
[EnumMember(Value = "sca_delegation")]
32+
ScaDelegation,
2333

2434
[EnumMember(Value = "secure_corporate_payment")]
2535
SecureCorporatePayment,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Checkout.Payments
4+
{
5+
public enum PreferredExperiences
6+
{
7+
[EnumMember(Value = "google_spa")]
8+
GoogleSpa,
9+
10+
[EnumMember(Value = "3ds")]
11+
ThreeDs,
12+
}
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.Collections.Generic;
2+
3+
namespace Checkout.Payments.Request
4+
{
5+
public class Authentication
6+
{
7+
public IList<PreferredExperiences> PreferredExperiences { get; set; }
8+
}
9+
}

src/CheckoutSdk/Payments/Request/PaymentRequest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class PaymentRequest
2626
public string Reference { get; set; }
2727

2828
public string Description { get; set; }
29+
30+
public Authentication Authentication { get; set; }
2931

3032
public AuthorizationType? AuthorizationType { get; set; }
3133

test/CheckoutSdkTest/Disputes/DisputesClientTest.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,24 @@ private async Task ShouldSubmitEvidence()
132132
response.ShouldNotBeNull();
133133
}
134134

135+
[Fact]
136+
private async Task ShouldSubmitArbitrationEvidence()
137+
{
138+
const string disputeId = "dsp_s5151531";
139+
140+
_apiClient.Setup(apiClient =>
141+
apiClient.Post<EmptyResponse>($"disputes/{disputeId}/evidence/arbitration", _authorization, null,
142+
CancellationToken.None,
143+
null))
144+
.ReturnsAsync(() => new EmptyResponse());
145+
146+
IDisputesClient client = new DisputesClient(_apiClient.Object, _configuration.Object);
147+
148+
var response = await client.SubmitArbitrationEvidence(disputeId);
149+
150+
response.ShouldNotBeNull();
151+
}
152+
135153
[Fact]
136154
private async Task ShouldGetCompiledSubmittedEvidence()
137155
{
@@ -148,6 +166,23 @@ private async Task ShouldGetCompiledSubmittedEvidence()
148166

149167
response.ShouldNotBeNull();
150168
}
169+
170+
[Fact]
171+
private async Task ShouldGetCompiledSubmittedArbitrationEvidence()
172+
{
173+
const string disputeId = "dispute_id";
174+
175+
_apiClient.Setup(apiClient =>
176+
apiClient.Get<DisputeCompiledSubmittedEvidenceResponse>($"disputes/{disputeId}/evidence/arbitration/submitted", _authorization,
177+
CancellationToken.None))
178+
.ReturnsAsync(() => new DisputeCompiledSubmittedEvidenceResponse());
179+
180+
IDisputesClient client = new DisputesClient(_apiClient.Object, _configuration.Object);
181+
182+
var response = await client.GetCompiledSubmittedArbitrationEvidence(disputeId);
183+
184+
response.ShouldNotBeNull();
185+
}
151186

152187
[Fact]
153188
private async Task ShouldGetDisputeSchemeFiles()

test/CheckoutSdkTest/Payments/Hosted/HostedPaymentsIntegrationTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ private async Task ShouldCreateAndGetHostedPayment()
2525
createResponse.Reference.ShouldNotBeNullOrEmpty();
2626
createResponse.Links.ShouldNotBeNull();
2727
createResponse.Links.ContainsKey("redirect").ShouldBeTrue();
28-
createResponse.Warnings.Count.ShouldBe(1);
2928

3029
var getResponse = await DefaultApi.HostedPaymentsClient().GetHostedPaymentsPageDetails(createResponse.Id);
3130

test/CheckoutSdkTest/Payments/Links/PaymentLinksIntegrationTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ private async Task ShouldCreateAndGetPaymentLink()
6060
response.Links.ShouldNotBeNull();
6161
response.Links.Count.ShouldBe(2);
6262
response.Reference.ShouldNotBeNull();
63-
response.Warnings.Count.ShouldBe(1);
6463

6564
var responseGet = await DefaultApi.PaymentLinksClient().Get(response.Id);
6665

test/CheckoutSdkTest/Payments/PaymentAuthorizationsIntegrationTest.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Checkout.Payments.Sender;
66
using Shouldly;
77
using System;
8+
using System.Collections.Generic;
89
using System.Threading.Tasks;
910
using Xunit;
1011

@@ -98,7 +99,15 @@ private async Task<PaymentResponse> MakeAuthorizationEstimatedPayment()
9899
PartialAuthorization = new PartialAuthorization
99100
{
100101
Enabled = true
102+
},
103+
Authentication = new Authentication
104+
{
105+
PreferredExperiences = new List<PreferredExperiences>
106+
{
107+
PreferredExperiences.GoogleSpa
108+
}
101109
}
110+
102111
};
103112

104113
var paymentResponse = await DefaultApi.PaymentsClient().RequestPayment(paymentRequest);

test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private async Task ShouldMakeIdealPayment()
8181
source.Type().ShouldBe(PaymentSourceType.Ideal);
8282
}
8383

84-
[Fact]
84+
[Fact(Skip = "payment method not supported")]
8585
private async Task ShouldMakeSofortPayment()
8686
{
8787
var sofortSource = new RequestSofortSource();

0 commit comments

Comments
 (0)