mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
fix payment request redirect url (#617)
This commit is contained in:
committed by
Nicolas Dorier
parent
3728fdab3f
commit
13d72de82d
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user