mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 22:11:48 +01:00
Expose buyer object to conform to bitpay API
This commit is contained in:
parent
dd7c4850f0
commit
9fc7f287d2
3 changed files with 13 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<Version>1.0.3.6</Version>
|
<Version>1.0.3.7</Version>
|
||||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -247,6 +247,8 @@ namespace BTCPayServer.Models
|
||||||
public Dictionary<string, string> Addresses { get; set; }
|
public Dictionary<string, string> Addresses { get; set; }
|
||||||
[JsonProperty("paymentCodes")]
|
[JsonProperty("paymentCodes")]
|
||||||
public Dictionary<string, NBitpayClient.InvoicePaymentUrls> PaymentCodes { get; set; }
|
public Dictionary<string, NBitpayClient.InvoicePaymentUrls> PaymentCodes { get; set; }
|
||||||
|
[JsonProperty("buyer")]
|
||||||
|
public JObject Buyer { get; set; }
|
||||||
}
|
}
|
||||||
public class Flags
|
public class Flags
|
||||||
{
|
{
|
||||||
|
|
|
@ -423,7 +423,16 @@ namespace BTCPayServer.Services.Invoices
|
||||||
|
|
||||||
#pragma warning restore CS0618
|
#pragma warning restore CS0618
|
||||||
dto.CryptoInfo.Add(cryptoInfo);
|
dto.CryptoInfo.Add(cryptoInfo);
|
||||||
|
dto.Buyer = new JObject();
|
||||||
|
dto.Buyer.Add(new JProperty("name", BuyerInformation.BuyerName));
|
||||||
|
dto.Buyer.Add(new JProperty("address1", BuyerInformation.BuyerAddress1));
|
||||||
|
dto.Buyer.Add(new JProperty("address2", BuyerInformation.BuyerAddress2));
|
||||||
|
dto.Buyer.Add(new JProperty("locality", BuyerInformation.BuyerCity));
|
||||||
|
dto.Buyer.Add(new JProperty("region", BuyerInformation.BuyerState));
|
||||||
|
dto.Buyer.Add(new JProperty("postalCode", BuyerInformation.BuyerZip));
|
||||||
|
dto.Buyer.Add(new JProperty("country", BuyerInformation.BuyerCountry));
|
||||||
|
dto.Buyer.Add(new JProperty("phone", BuyerInformation.BuyerPhone));
|
||||||
|
dto.Buyer.Add(new JProperty("email", BuyerInformation.BuyerEmail ?? RefundMail));
|
||||||
dto.PaymentCodes.Add(paymentId.ToString(), cryptoInfo.PaymentUrls);
|
dto.PaymentCodes.Add(paymentId.ToString(), cryptoInfo.PaymentUrls);
|
||||||
dto.PaymentSubtotals.Add(paymentId.ToString(), subtotalPrice.Satoshi);
|
dto.PaymentSubtotals.Add(paymentId.ToString(), subtotalPrice.Satoshi);
|
||||||
dto.PaymentTotals.Add(paymentId.ToString(), accounting.TotalDue.Satoshi);
|
dto.PaymentTotals.Add(paymentId.ToString(), accounting.TotalDue.Satoshi);
|
||||||
|
|
Loading…
Add table
Reference in a new issue