[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 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; }
public string DefaultLang { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string DefaultLang { get; set; } = "en";
public bool LightningAmountInSatoshi { get; set; }
public string CustomLogo { get; set; }
@ -42,14 +44,13 @@ namespace BTCPayServer.Client.Models
public string HtmlTitle { get; set; }
public bool AnyoneCanInvoice { get; set; }
public bool RedirectAutomatically { get; set; }
public bool RequiresRefundEmail { get; set; }
[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 LightningPrivateRouteHints { get; set; }

View File

@ -219,5 +219,5 @@
<_ContentIncludedByDefault Remove="Views\Authorization\Authorize.cshtml" />
</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>

View File

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

View File

@ -276,14 +276,12 @@
"properties": {
"name": {
"type": "string",
"description": "The name of the store",
"nullable": true
"description": "The name of the store"
},
"website": {
"type": "string",
"description": "The absolute url of the store",
"format": "url",
"nullable": true
"format": "url"
},
"invoiceExpiration": {
"type": "integer",
@ -306,58 +304,79 @@
},
"lightningDescriptionTemplate": {
"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": {
"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": {
"type": "boolean"
"type": "boolean",
"default": false,
"description": "If true, then no authentication is needed to create invoices on this store."
},
"showRecommendedFee": {
"type": "boolean"
"type": "boolean",
"default": true
},
"recommendedFeeBlockTarget": {
"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": {
"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": {
"type": "boolean"
"type": "boolean",
"default": false,
"description": "If true, lightning payment methods show amount in satoshi in the checkout page."
},
"customLogo": {
"type": "string",
"nullable": true
"nullable": true,
"description": "URL to a logo to include in the checkout page."
},
"customCSS": {
"type": "string",
"nullable": true
"nullable": true,
"description": "URL to a CSS stylesheet to include in the checkout page"
},
"htmlTitle": {
"type": "string",
"nullable": true
},
"anyoneCanInvoice": {
"type": "boolean"
"nullable": true,
"description": "The HTML title of the checkout page (when you over the tab in your browser)"
},
"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": {
"type": "boolean"
"type": "boolean",
"default": false,
"description": "If true, the checkout page will ask to enter an email address before accessing payment information."
},
"networkFeeMode": {
"$ref": "#/components/schemas/NetworkFeeMode"
},
"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": {
"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": {
"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": [
"MultiplePaymentsOnly",
"Always",