Skip to content

Commit

Permalink
Merge pull request #125 from TransbankDevelopers/bug/add-missing-head…
Browse files Browse the repository at this point in the history
…ers-deferred-tx

Add missing headers to deferred tx
  • Loading branch information
Felipe Fiebig authored Nov 9, 2020
2 parents 07a2174 + 7d9ab07 commit 417d902
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Transbank/WebpayRest/WebpayPlus/DeferredTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 417d902

Please sign in to comment.