[Greenfield] Document store API

This commit is contained in:
nicolas.dorier 2020-05-31 11:42:49 +09:00
parent ebc99adc58
commit ec4c346e0a
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
4 changed files with 52 additions and 32 deletions

View File

@ -29,11 +29,13 @@ namespace BTCPayServer.Client.Models
public double PaymentTolerance { get; set; } = 0; public double PaymentTolerance { get; set; } = 0;
public bool AnyoneCanCreateInvoice { get; set; } public bool AnyoneCanCreateInvoice { get; set; }
public bool ShowRecommendedFee { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public bool ShowRecommendedFee { get; set; } = true;
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public int RecommendedFeeBlockTarget { get; set; } = 1;
public int RecommendedFeeBlockTarget { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string DefaultLang { get; set; } = "en";
public string DefaultLang { get; set; }
public bool LightningAmountInSatoshi { get; set; } public bool LightningAmountInSatoshi { get; set; }
public string CustomLogo { get; set; } public string CustomLogo { get; set; }
@ -42,14 +44,13 @@ namespace BTCPayServer.Client.Models
public string HtmlTitle { get; set; } public string HtmlTitle { get; set; }
public bool AnyoneCanInvoice { get; set; }
public bool RedirectAutomatically { get; set; } public bool RedirectAutomatically { get; set; }
public bool RequiresRefundEmail { get; set; } public bool RequiresRefundEmail { get; set; }
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public NetworkFeeMode NetworkFeeMode { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public NetworkFeeMode NetworkFeeMode { get; set; } = NetworkFeeMode.Never;
public bool PayJoinEnabled { get; set; } public bool PayJoinEnabled { get; set; }
public bool LightningPrivateRouteHints { get; set; } public bool LightningPrivateRouteHints { get; set; }

View File

@ -219,5 +219,5 @@
<_ContentIncludedByDefault Remove="Views\Authorization\Authorize.cshtml" /> <_ContentIncludedByDefault Remove="Views\Authorization\Authorize.cshtml" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties wwwroot_4swagger_4v1_4swagger_1template_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json" wwwroot_4swagger_4v1_4swagger_1template_1serverinfo_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties wwwroot_4swagger_4v1_4swagger_1template_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json" wwwroot_4swagger_4v1_4swagger_1template_1serverinfo_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json" wwwroot_4swagger_4v1_4swagger_1template_1stores_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json" /></VisualStudio></ProjectExtensions>
</Project> </Project>

View File

@ -128,7 +128,7 @@ namespace BTCPayServer.Controllers.GreenField
CustomLogo = storeBlob.CustomLogo, CustomLogo = storeBlob.CustomLogo,
CustomCSS = storeBlob.CustomCSS, CustomCSS = storeBlob.CustomCSS,
HtmlTitle = storeBlob.HtmlTitle, HtmlTitle = storeBlob.HtmlTitle,
AnyoneCanInvoice = storeBlob.AnyoneCanInvoice, AnyoneCanCreateInvoice = storeBlob.AnyoneCanInvoice,
LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate, LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate,
PaymentTolerance = storeBlob.PaymentTolerance, PaymentTolerance = storeBlob.PaymentTolerance,
RedirectAutomatically = storeBlob.RedirectAutomatically, RedirectAutomatically = storeBlob.RedirectAutomatically,
@ -164,7 +164,7 @@ namespace BTCPayServer.Controllers.GreenField
blob.CustomLogo = restModel.CustomLogo; blob.CustomLogo = restModel.CustomLogo;
blob.CustomCSS = restModel.CustomCSS; blob.CustomCSS = restModel.CustomCSS;
blob.HtmlTitle = restModel.HtmlTitle; blob.HtmlTitle = restModel.HtmlTitle;
blob.AnyoneCanInvoice = restModel.AnyoneCanInvoice; blob.AnyoneCanInvoice = restModel.AnyoneCanCreateInvoice;
blob.LightningDescriptionTemplate = restModel.LightningDescriptionTemplate; blob.LightningDescriptionTemplate = restModel.LightningDescriptionTemplate;
blob.PaymentTolerance = restModel.PaymentTolerance; blob.PaymentTolerance = restModel.PaymentTolerance;
blob.RedirectAutomatically = restModel.RedirectAutomatically; blob.RedirectAutomatically = restModel.RedirectAutomatically;

View File

@ -276,14 +276,12 @@
"properties": { "properties": {
"name": { "name": {
"type": "string", "type": "string",
"description": "The name of the store", "description": "The name of the store"
"nullable": true
}, },
"website": { "website": {
"type": "string", "type": "string",
"description": "The absolute url of the store", "description": "The absolute url of the store",
"format": "url", "format": "url"
"nullable": true
}, },
"invoiceExpiration": { "invoiceExpiration": {
"type": "integer", "type": "integer",
@ -306,58 +304,79 @@
}, },
"lightningDescriptionTemplate": { "lightningDescriptionTemplate": {
"type": "string", "type": "string",
"nullable": true "nullable": true,
"description": "The BOLT11 description of the lightning invoice in the checkout. You can use placeholders '{StoreName}', '{ItemDescription}' and '{OrderId}'."
}, },
"paymentTolerance": { "paymentTolerance": {
"type": "number", "type": "number",
"format": "double" "format": "double",
"minimum": 0.0,
"maximum": 100.0,
"default": 0.0,
"description": "Consider an invoice fully paid, even if the payment is missing 'x' % of the full amount."
}, },
"anyoneCanCreateInvoice": { "anyoneCanCreateInvoice": {
"type": "boolean" "type": "boolean",
"default": false,
"description": "If true, then no authentication is needed to create invoices on this store."
}, },
"showRecommendedFee": { "showRecommendedFee": {
"type": "boolean" "type": "boolean",
"default": true
}, },
"recommendedFeeBlockTarget": { "recommendedFeeBlockTarget": {
"type": "integer", "type": "integer",
"format": "int32" "format": "int32",
"default": 1,
"description": "The fee rate recommendation in the checkout page for the on-chain payment to be confirmed after 'x' blocks."
}, },
"defaultLang": { "defaultLang": {
"type": "string", "type": "string",
"nullable": true "default": "en",
"description": "The default language to use in the checkout page. (The different translations available are listed [here](https://github.com/btcpayserver/btcpayserver/tree/master/BTCPayServer/wwwroot/locales)"
}, },
"lightningAmountInSatoshi": { "lightningAmountInSatoshi": {
"type": "boolean" "type": "boolean",
"default": false,
"description": "If true, lightning payment methods show amount in satoshi in the checkout page."
}, },
"customLogo": { "customLogo": {
"type": "string", "type": "string",
"nullable": true "nullable": true,
"description": "URL to a logo to include in the checkout page."
}, },
"customCSS": { "customCSS": {
"type": "string", "type": "string",
"nullable": true "nullable": true,
"description": "URL to a CSS stylesheet to include in the checkout page"
}, },
"htmlTitle": { "htmlTitle": {
"type": "string", "type": "string",
"nullable": true "nullable": true,
}, "description": "The HTML title of the checkout page (when you over the tab in your browser)"
"anyoneCanInvoice": {
"type": "boolean"
}, },
"redirectAutomatically": { "redirectAutomatically": {
"type": "boolean" "type": "boolean",
"default": false,
"description": "After successfull payment, should the checkout page redirect the user automatically to the redirect URL of the invoice?"
}, },
"requiresRefundEmail": { "requiresRefundEmail": {
"type": "boolean" "type": "boolean",
"default": false,
"description": "If true, the checkout page will ask to enter an email address before accessing payment information."
}, },
"networkFeeMode": { "networkFeeMode": {
"$ref": "#/components/schemas/NetworkFeeMode" "$ref": "#/components/schemas/NetworkFeeMode"
}, },
"payJoinEnabled": { "payJoinEnabled": {
"type": "boolean" "type": "boolean",
"default": false,
"description": "If true, payjoin will be proposed in the checkout page if possible. ([More information](https://docs.btcpayserver.org/Payjoin/#btcpay-server-payjoin-guide))"
}, },
"lightningPrivateRouteHints": { "lightningPrivateRouteHints": {
"type": "boolean" "type": "boolean",
"default": false,
"description": "Should private route hints be included in the lightning payment of the checkout page."
} }
} }
}, },
@ -379,7 +398,7 @@
}, },
"NetworkFeeMode": { "NetworkFeeMode": {
"type": "string", "type": "string",
"description": "", "description": "Check whether network fee should be added to the invoice if on-chain payment is used. ([More information](https://docs.btcpayserver.org/FAQ/FAQ-Stores/#add-network-fee-to-invoice-vary-with-mining-fees))",
"x-enumNames": [ "x-enumNames": [
"MultiplePaymentsOnly", "MultiplePaymentsOnly",
"Always", "Always",