Skip to content

Commit 54b94a6

Browse files
authored
Merge pull request #40 from paytrail/PP6-119-Fix-Timestamp
Fix timestamp
2 parents 3997248 + e083949 commit 54b94a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Paytrail-dotnet-sdk/PayTrail.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public abstract class Paytrail
1515

1616
public Dictionary<string, string> GetHeaders(string method, string transactionId = null, string checkoutTokenizationId = null)
1717
{
18-
var datetime = new DateTime();
1918
var headers = new Dictionary<string, string>();
2019
try
2120
{
2221
headers["checkout-account"] = this.merchantId;
2322
headers["checkout-algorithm"] = "sha256";
2423
headers["checkout-method"] = method.ToUpper();
2524
headers["checkout-nonce"] = Guid.NewGuid().ToString();
26-
headers["checkout-timestamp"] = datetime.ToString("Y-m-d\\TH:i:s.u\\Z");
25+
string iso8601String = DateTimeOffset.Now.ToString("yyyy-MM-dd'T'HH:mm:ss.fffzzz");
26+
headers["checkout-timestamp"] = iso8601String;
2727
headers["platform-name"] = this.platformName;
2828
headers["content-type"] = "application/json; charset=utf-8";
2929

0 commit comments

Comments
 (0)