在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:netlify/gocommerce开源软件地址:https://github.com/netlify/gocommerce开源编程语言:Go 98.9%开源软件介绍:GoCommerceA small go based API for static e-commerce sites. It handles orders and payments. Integrates with Stripe for payments and will support international pricing and VAT verification. GoCommerce is released under the MIT License. Please make sure you understand its implications and guarantees. What your static site must supportEach product you want to sell from your static site must have unique URL where GoCommerce can find the meta data needed for calculating pricing and taxes in order to verify that the order is legitimate before using Stripe to charge the client. The metadata can be anywhere on the page, and goes in a script tag in this format: <script class="gocommerce-product" type="application/json">
{"sku": "my-product", "title": "My Product", "prices": [{"amount": "49.99", "currency": "USD"}], "type": "ebook"}
</script> The minimum required is the Sku, title and at least one "price". Default currency is USD if nothing else specified. VAT, Countries and RegionsGoCommerce will regularly check for a file called This file should have settings with rules for VAT or currency regions. This file is not required for GoCommerce to work, but will enable support for various advanced features. Currently it enables VAT calculations on a per country/product type basic. The reason we make you include the file in the static site, is that you'll need to do the same VAT calculations client side during checkout to be able to show this to the user. The commerce-js client library can help you with this. Here's an example settings file: {
"taxes": [{
"percentage": 20,
"product_types": ["ebook"],
"countries": ["Austria", "Bulgaria", "Estonia", "France", "Gibraltar", "Slovakia", "United Kingdom"]
}, {
"percentage": 7,
"product_types": ["book"],
"countries": ["Austria", "Belgium", "Bulgaria", "Croatia", "Cyprus", "Denmark", "Estonia"]
}]
} Based on these rules, if an order includes a product with "type" set to "ebook" in the product metadata on the site and the users billing Address is set to "Austria", GoCommerce will verify that a 20 percentage tax has been included in that product. JavaScript Client LibraryThe easiest way to use GoCommerce is with commerce-js. IMPORTANT: Since Release 1.8.0 of GoCommerce at least Version 5.0.0 of the JavaScript Client is required. Running the GoCommerce backendGoCommerce can be deployed to any server environment that runs Go. Minimum requirement for Go is version 1.11 since GoCommerce is using Go modules. The button below provides a quick way to get started by running on Heroku: ConfigurationYou may configure GoCommerce using either a configuration file named For local dev, the easiest way to get started is to copy the included Top-Level
The base URL your site is located at.
The shared secret with an operator (usually Netlify) for this microservice. Used to verify requests have been proxied through the operator and the payload values can be trusted. API
Hostname to listen on.
Port number to listen on. Defaults to
Controls what endpoint Netlify can access this API on. Database
Chooses what dialect of database you want. Choose from
Connection string for the database. See the gorm examples for more details.
Adds a prefix to all table names.
If enabled, creates missing tables and columns upon startup. Logging
Controls what log levels are output. Choose from
If you wish logs to be written to a file, set PaymentStripe
Whether Stripe is enabled as a payment provider or not.
The Stripe secret key used when authenticating with the Stripe API. PayPal
Whether PayPal is enabled as a payment provider or not.
The OAuth credentials PayPal issued to you. GoCommerce will use them to obtain an access token.
The PayPal environment to use. Choose from Downloads
The provider to use for downloads. Choose from
The authentication bearer token used to access the Netlify downloads API. Coupons
A URL that contains all the coupon information in JSON.
HTTP Basic Authentication information to use if required to access the coupon information. Webhooks
A URL to send a webhook to when the corresponding action has been performed.
A secret used to sign a JWT included in the JSON Web Tokens (JWT)
The secret used to verify JWT tokens with.
The name of the admin group (if enabled). Defaults to Sending email is not required, but is highly recommended. If enabled, you must provide the required values below.
The
The mail server hostname to send emails through.
The port number to connect to the mail server on.
If the mail server requires authentication, the username to use.
If the mail server requires authentication, the password to use.
Email subject to use for order confirmations. Defaults to
Email subject to use for orders sent to the store admin. Defaults to
URL path, relative to the Default Content (if template is unavailable): <h2>Thank you for your order!</h2>
<ul>
{{ range .Order.LineItems }}
<li>{{ .Title }} <strong>{{ .Quantity }} x {{ .Price }}</strong></li>
{{ end }}
</ul>
<p>Total amount: <strong>{{ .Order.Total }}</strong></p>
URL path, relative to the Default Content (if template is unavailable): <h2>Order Received From {{ .Order.Email }}</h2>
<ul>
{{ range .Order.LineItems }}
<li>{{ .Title }} <strong>{{ .Quantity }} x {{ .Price }}</strong></li>
{{ end }}
</ul>
<p>Total amount: <strong>{{ .Order.Total }}</strong></p> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论