Skip to content

Commit ebd53ad

Browse files
tests: this commit introduces a mock for the payment gateway
1 parent c9d3a5f commit ebd53ad

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Comanda.Payments.TestSuite.Mocks;
2+
3+
public sealed class PaymentGatewayMock : IPaymentGateway
4+
{
5+
public Task<Result<CheckoutSession>> CreateCheckoutSessionAsync(
6+
CheckoutSessionCreationScheme parameters, Payment payment, CancellationToken cancellation = default)
7+
{
8+
var session = new CheckoutSession
9+
{
10+
Code = $"brcode_{Guid.NewGuid():N}",
11+
QrCode = $"qrcode_{Guid.NewGuid():N}"
12+
};
13+
14+
return Task.FromResult(Result<CheckoutSession>.Success(session));
15+
}
16+
}

0 commit comments

Comments
 (0)