Isolate Bitpay's code outside of middleware inside BitpayClaimsFilter

This commit is contained in:
nicolas.dorier
2018-04-30 22:28:00 +09:00
parent 21bbf49640
commit eb975bf8fc
7 changed files with 221 additions and 169 deletions

View File

@@ -173,6 +173,16 @@ namespace BTCPayServer
obj is bool b && b;
}
public static void SetBitpayAuth(this HttpContext ctx, (string Signature, String Id, String Authorization) value)
{
NBitcoin.Extensions.TryAdd(ctx.Items, "BitpayAuth", value);
}
public static (string Signature, String Id, String Authorization) GetBitpayAuth(this HttpContext ctx)
{
ctx.Items.TryGetValue("BitpayAuth", out object obj);
return ((string Signature, String Id, String Authorization))obj;
}
public static StoreData GetStoreData(this HttpContext ctx)
{