Example #1
0
        async Task CanSendLightningPaymentCore(ServerTester tester, TestAccount user)
        {
            await Task.Delay(TimeSpan.FromSeconds(RandomUtils.GetUInt32() % 5));

            var invoice = await user.BitPay.CreateInvoiceAsync(new Invoice()
            {
                Price    = 0.01,
                Currency = "USD",
                PosData  = "posData",
                OrderId  = "orderId",
                ItemDesc = "Some description"
            });

            await tester.SendLightningPaymentAsync(invoice);

            await EventuallyAsync(async() =>
            {
                var localInvoice = await user.BitPay.GetInvoiceAsync(invoice.Id);
                Assert.Equal("complete", localInvoice.Status);
                Assert.Equal("False", localInvoice.ExceptionStatus.ToString());
            });
        }