Skip to content

Commit 4d9b608

Browse files
Add constructor to DlocalSignature and integrate it into ForwardIntegrationTest (#487)
1 parent a2f7897 commit 4d9b608

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/CheckoutSdk/Forward/Requests/DestinationRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class DestinationRequest
2121
public string Body { get; set; }
2222

2323
/// <summary>
24-
/// Optional configuration to add a signature to the forwarded HTTP request (Optional).
24+
/// Optional configuration to add a signature to the forwarded HTTP request. (Optional)
2525
/// </summary>
2626
public AbstractSignature Signature { get; set; }
2727
}

src/CheckoutSdk/Forward/Requests/Signatures/DlocalSignature.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
namespace Checkout.Forward.Requests.Signatures
22
{
3-
public class DlocalSignature
3+
public class DlocalSignature : AbstractSignature
44
{
5+
/// <summary> Initializes a new instance of the DlocalSignature class. </summary>
6+
public DlocalSignature() : base(SignatureType.Dlocal) { }
7+
58
/// <summary>
69
/// The parameters required to generate an HMAC signature for the dLocal API. See their documentation for
710
/// details.

test/CheckoutSdkTest/Forward/ForwardIntegrationTest.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Checkout.Forward.Requests;
2+
using Checkout.Forward.Requests.Signatures;
23
using Checkout.Forward.Requests.Sources;
34
using Shouldly;
45
using System.Collections.Generic;
@@ -67,7 +68,14 @@ private ForwardRequest CreateForwardRequest()
6768
}
6869
},
6970
Body =
70-
"{\"amount\": 1000, \"currency\": \"USD\", \"reference\": \"some_reference\", \"source\": {\"type\": \"card\", \"number\": \"{{card_number}}\", \"expiry_month\": \"{{card_expiry_month}}\", \"expiry_year\": \"{{card_expiry_year_yyyy}}\", \"name\": \"Ali Farid\"}, \"payment_type\": \"Regular\", \"authorization_type\": \"Final\", \"capture\": true, \"processing_channel_id\": \"pc_xxxxxxxxxxx\", \"risk\": {\"enabled\": false}, \"merchant_initiated\": true}"
71+
"{\"amount\": 1000, \"currency\": \"USD\", \"reference\": \"some_reference\", \"source\": {\"type\": \"card\", \"number\": \"{{card_number}}\", \"expiry_month\": \"{{card_expiry_month}}\", \"expiry_year\": \"{{card_expiry_year_yyyy}}\", \"name\": \"Ali Farid\"}, \"payment_type\": \"Regular\", \"authorization_type\": \"Final\", \"capture\": true, \"processing_channel_id\": \"pc_xxxxxxxxxxx\", \"risk\": {\"enabled\": false}, \"merchant_initiated\": true}",
72+
Signature = new DlocalSignature
73+
{
74+
DlocalParameters = new DlocalParameters
75+
{
76+
SecretKey = "9f439fe1a9f96e67b047d3c1a28c33a2e"
77+
}
78+
}
7179
}
7280
};
7381
}

0 commit comments

Comments
 (0)