From 7d9ab079e9c5a7fbad1c697eb9b2667dcd32360d Mon Sep 17 00:00:00 2001 From: Felipe Fiebig Date: Mon, 9 Nov 2020 15:35:32 -0300 Subject: [PATCH] Add missing headers to deferred tx --- Transbank/WebpayRest/WebpayPlus/DeferredTransaction.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Transbank/WebpayRest/WebpayPlus/DeferredTransaction.cs b/Transbank/WebpayRest/WebpayPlus/DeferredTransaction.cs index 253f5f5..4334ab1 100644 --- a/Transbank/WebpayRest/WebpayPlus/DeferredTransaction.cs +++ b/Transbank/WebpayRest/WebpayPlus/DeferredTransaction.cs @@ -14,6 +14,13 @@ public static class DeferredTransaction private static string _apiKey = "579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C"; private static WebpayIntegrationType _integrationType = WebpayIntegrationType.Test; + // Temporal patch so we don't break compatibility + // Proper fix: https://github.com/TransbankDevelopers/transbank-sdk-dotnet/pull/124 + private static string _commerceCodeHeaderName = "Tbk-Api-Key-Id"; + private static string _apiKeyHeaderName = "Tbk-Api-Key-Secret"; + + private static RequestServiceHeaders _headers = new RequestServiceHeaders(_apiKeyHeaderName, _commerceCodeHeaderName); + public static string CommerceCode { get => _commerceCode; @@ -40,7 +47,7 @@ public static WebpayIntegrationType IntegrationType public static Options DefaultOptions() { - return new Options(CommerceCode, ApiKey, IntegrationType, null); + return new Options(CommerceCode, ApiKey, IntegrationType, _headers); } public static CreateResponse Create(string buyOrder, string sessionId,