1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

handle transactions on paypal webhook

This commit is contained in:
Kyle Spearrin
2019-02-01 22:22:08 -05:00
parent f3b5068aba
commit 44630e9728
11 changed files with 211 additions and 8 deletions

View File

@ -6,6 +6,7 @@ using Dapper;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using Bit.Core.Enums;
namespace Bit.Core.Repositories.SqlServer
{
@ -44,5 +45,18 @@ namespace Bit.Core.Repositories.SqlServer
return results.ToList();
}
}
public async Task<Transaction> GetByGatewayIdAsync(GatewayType gatewayType, string gatewayId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<Transaction>(
$"[{Schema}].[Transaction_ReadByGatewayId]",
new { Gateway = gatewayType, GatewayId = gatewayId },
commandType: CommandType.StoredProcedure);
return results.SingleOrDefault();
}
}
}
}