diff --git a/src/CheckoutSdk/Forward/Requests/DestinationRequest.cs b/src/CheckoutSdk/Forward/Requests/DestinationRequest.cs index 69cb5a2a..9d6ffd31 100644 --- a/src/CheckoutSdk/Forward/Requests/DestinationRequest.cs +++ b/src/CheckoutSdk/Forward/Requests/DestinationRequest.cs @@ -1,3 +1,5 @@ +using Checkout.Forward.Requests.Signatures; + namespace Checkout.Forward.Requests { public class DestinationRequest @@ -17,5 +19,10 @@ public class DestinationRequest /// payment instrument you specified. For example, {{card_number}} (Required, max 16384 characters) /// public string Body { get; set; } + + /// + /// Optional configuration to add a signature to the forwarded HTTP request (Optional). + /// + public AbstractSignature Signature { get; set; } } } \ No newline at end of file diff --git a/src/CheckoutSdk/Forward/Requests/Signatures/AbstractSignature.cs b/src/CheckoutSdk/Forward/Requests/Signatures/AbstractSignature.cs new file mode 100644 index 00000000..59095eef --- /dev/null +++ b/src/CheckoutSdk/Forward/Requests/Signatures/AbstractSignature.cs @@ -0,0 +1,13 @@ +namespace Checkout.Forward.Requests.Signatures +{ + public abstract class AbstractSignature + { + protected AbstractSignature(SignatureType type) { Type = type; } + + /// + /// The identifier of the supported signature generation method or a specific third-party service. + /// (Required) + /// + public SignatureType? Type { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Forward/Requests/Signatures/DlocalParameters.cs b/src/CheckoutSdk/Forward/Requests/Signatures/DlocalParameters.cs new file mode 100644 index 00000000..42fde523 --- /dev/null +++ b/src/CheckoutSdk/Forward/Requests/Signatures/DlocalParameters.cs @@ -0,0 +1,10 @@ +namespace Checkout.Forward.Requests.Signatures +{ + public class DlocalParameters + { + /// + /// The secret key used to generate the request signature. This is part of the dLocal API credentials. + /// + public string SecretKey { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Forward/Requests/Signatures/DlocalSignature.cs b/src/CheckoutSdk/Forward/Requests/Signatures/DlocalSignature.cs new file mode 100644 index 00000000..a7e4a2fa --- /dev/null +++ b/src/CheckoutSdk/Forward/Requests/Signatures/DlocalSignature.cs @@ -0,0 +1,14 @@ +namespace Checkout.Forward.Requests.Signatures +{ + public class DlocalSignature + { + /// + /// The parameters required to generate an HMAC signature for the dLocal API. See their documentation for + /// details. + /// This method requires you to provide the X-Login header value in the destination request headers. + /// When used, the Forward API appends the X-Date and Authorization headers to the outgoing HTTP request + /// before forwarding. + /// + public DlocalParameters DlocalParameters { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Forward/Requests/Signatures/SignatureType.cs b/src/CheckoutSdk/Forward/Requests/Signatures/SignatureType.cs new file mode 100644 index 00000000..52992c3c --- /dev/null +++ b/src/CheckoutSdk/Forward/Requests/Signatures/SignatureType.cs @@ -0,0 +1,10 @@ +using System.Runtime.Serialization; + +namespace Checkout.Forward.Requests.Signatures +{ + public enum SignatureType + { + [EnumMember(Value = "dlocal")] + Dlocal, + } +} \ No newline at end of file