mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-04 01:53:52 +01:00
fix payment request redirect url (#617)
This commit is contained in:
parent
3728fdab3f
commit
13d72de82d
2 changed files with 11 additions and 1 deletions
|
@ -295,7 +295,7 @@ namespace BTCPayServer.Controllers
|
||||||
Price = amount.GetValueOrDefault(result.AmountDue),
|
Price = amount.GetValueOrDefault(result.AmountDue),
|
||||||
FullNotifications = true,
|
FullNotifications = true,
|
||||||
BuyerEmail = result.Email,
|
BuyerEmail = result.Email,
|
||||||
RedirectURL = Request.GetDisplayUrl().Replace("/pay", "", StringComparison.InvariantCulture),
|
RedirectURL = Request.GetDisplayUrl().TrimEnd("/pay", StringComparison.InvariantCulture),
|
||||||
}, store, HttpContext.Request.GetAbsoluteRoot(), new List<string>() { PaymentRequestRepository.GetInternalTag(id) })).Data.Id;
|
}, store, HttpContext.Request.GetAbsoluteRoot(), new List<string>() { PaymentRequestRepository.GetInternalTag(id) })).Data.Id;
|
||||||
|
|
||||||
if (redirectToInvoice)
|
if (redirectToInvoice)
|
||||||
|
|
|
@ -315,5 +315,15 @@ namespace BTCPayServer
|
||||||
var res = JsonConvert.SerializeObject(o, Formatting.None, jsonSettings);
|
var res = JsonConvert.SerializeObject(o, Formatting.None, jsonSettings);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string TrimEnd(this string input, string suffixToRemove,
|
||||||
|
StringComparison comparisonType) {
|
||||||
|
|
||||||
|
if (input != null && suffixToRemove != null
|
||||||
|
&& input.EndsWith(suffixToRemove, comparisonType)) {
|
||||||
|
return input.Substring(0, input.Length - suffixToRemove.Length);
|
||||||
|
}
|
||||||
|
else return input;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue