public override async Task <ApiResult> FetchPaymentStatusAsync(PaymentProviderContext <BamboraCheckoutSettings> ctx)
        {
            try
            {
                var clientConfig = GetBamboraClientConfig(ctx.Settings);
                var client       = new BamboraClient(clientConfig);

                var transactionResp = await client.GetTransactionAsync(ctx.Order.TransactionInfo.TransactionId);

                if (transactionResp.Meta.Result)
                {
                    return(new ApiResult
                    {
                        TransactionInfo = new TransactionInfoUpdate()
                        {
                            TransactionId = transactionResp.Transaction.Id,
                            PaymentStatus = GetPaymentStatus(transactionResp.Transaction)
                        }
                    });
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Bambora - FetchPaymentStatus");
            }

            return(ApiResult.Empty);
        }
        public override async Task <CallbackResult> ProcessCallbackAsync(PaymentProviderContext <BamboraCheckoutSettings> ctx)
        {
            try
            {
                var clientConfig = GetBamboraClientConfig(ctx.Settings);
                var client       = new BamboraClient(clientConfig);

                if (client.ValidateRequest(ctx.Request, out var qs))
                {
                    var txnId   = qs["txnid"];
                    var orderId = qs["orderid"];
                    var amount  = int.Parse("0" + qs["amount"]);
                    var txnFee  = int.Parse("0" + qs["txnfee"]);

                    // Validate params
                    if (!string.IsNullOrWhiteSpace(txnId) &&
                        !string.IsNullOrWhiteSpace(orderId) &&
                        orderId == BamboraSafeOrderId(ctx.Order.OrderNumber) &&
                        amount > 0)
                    {
                        // Fetch the transaction details so that we can work out
                        // the status of the transaction as the querystring params
                        // are not enough on their own
                        var transactionResp = await client.GetTransactionAsync(txnId);

                        if (transactionResp.Meta.Result)
                        {
                            return(CallbackResult.Ok(new TransactionInfo
                            {
                                TransactionId = transactionResp.Transaction.Id,
                                AmountAuthorized = AmountFromMinorUnits(amount + txnFee),
                                TransactionFee = AmountFromMinorUnits(txnFee),
                                PaymentStatus = GetPaymentStatus(transactionResp.Transaction)
                            }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Bambora - ProcessCallback");
            }

            return(CallbackResult.BadRequest());
        }