Skip to content

Commit bf69a56

Browse files
Add constructor to DlocalSignature and integrate it into ForwardIntegrationTest
1 parent a2f7897 commit bf69a56

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

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)