mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-31 04:34:26 +01:00
Merge pull request #6666 from btcpayserver/bugfix/paymentrequest-interpolation
Bugfixing interpolation on Payment Request
This commit is contained in:
@@ -37,9 +37,13 @@ public class PaymentRequestWebhookDeliveryRequest : WebhookSender.WebhookDeliver
|
||||
|
||||
private string Interpolate(string str, Data.PaymentRequestData data)
|
||||
{
|
||||
var id = data.Id;
|
||||
string trimmedId = $"{id.Substring(0, 7)}...{id.Substring(id.Length - 7)}";
|
||||
|
||||
var blob = data.GetBlob();
|
||||
var res = str.Replace("{PaymentRequest.Id}", _evt.Data.Id)
|
||||
.Replace("{PaymentRequest.Price}", data.Amount.ToString(CultureInfo.InvariantCulture))
|
||||
var res = str.Replace("{PaymentRequest.Id}", id)
|
||||
.Replace("{PaymentRequest.TrimmedId}", trimmedId)
|
||||
.Replace("{PaymentRequest.Amount}", data.Amount.ToString(CultureInfo.InvariantCulture))
|
||||
.Replace("{PaymentRequest.Currency}", data.Currency)
|
||||
.Replace("{PaymentRequest.Title}", blob.Title)
|
||||
.Replace("{PaymentRequest.Description}", blob.Description)
|
||||
|
||||
@@ -89,7 +89,8 @@
|
||||
<th text-translate="true">Request</th>
|
||||
<td>
|
||||
<code>{PaymentRequest.Id}</code>,
|
||||
<code>{PaymentRequest.Price}</code>,
|
||||
<code>{PaymentRequest.TrimmedId}</code>,
|
||||
<code>{PaymentRequest.Amount}</code>,
|
||||
<code>{PaymentRequest.Currency}</code>,
|
||||
<code>{PaymentRequest.Title}</code>,
|
||||
<code>{PaymentRequest.Description}</code>,
|
||||
|
||||
Reference in New Issue
Block a user