Git Product home page Git Product logo

gocommerce's Introduction

GoCommerce Build Status

A 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 support

Each 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 Regions

GoCommerce will regularly check for a file called https://example.com/gocommerce/settings.json

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 Library

The 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 backend

GoCommerce 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:

Deploy

Configuration

You may configure GoCommerce using either a configuration file named .env, environment variables, or a combination of both. Environment variables are prefixed with GOCOMMERCE_, and will always have precedence over values provided via file.

For local dev, the easiest way to get started is to copy the included example.env file to .env

Top-Level

GOCOMMERCE_SITE_URL=https://example.netlify.com/

SITE_URL - string required

The base URL your site is located at.

OPERATOR_TOKEN - string Multi-instance mode only

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

GOCOMMERCE_API_HOST=localhost
PORT=9999

API_HOST - string

Hostname to listen on.

PORT (no prefix) / API_PORT - number

Port number to listen on. Defaults to 8080.

API_ENDPOINT - string Multi-instance mode only

Controls what endpoint Netlify can access this API on.

Database

GOCOMMERCE_DB_DRIVER=sqlite3
DATABASE_URL=gotrue.db

DB_DRIVER - string required

Chooses what dialect of database you want. Choose from sqlite3, mysql, or postgres.

DATABASE_URL (no prefix) / DB_DATABASE_URL - string required

Connection string for the database. See the gorm examples for more details.

DB_NAMESPACE - string

Adds a prefix to all table names.

DB_AUTOMIGRATE - bool

If enabled, creates missing tables and columns upon startup.

Logging

LOG_LEVEL=debug

LOG_LEVEL - string

Controls what log levels are output. Choose from panic, fatal, error, warn, info, or debug. Defaults to info.

LOG_FILE - string

If you wish logs to be written to a file, set log_file to a valid file path.

Payment

Stripe

PAYMENT_STRIPE_ENABLED - bool

Whether Stripe is enabled as a payment provider or not.

PAYMENT_STRIPE_SECRET_KEY - string

The Stripe secret key used when authenticating with the Stripe API.

PayPal

PAYMENT_PAYPAL_ENABLED - bool

Whether PayPal is enabled as a payment provider or not.

PAYMENT_PAYPAL_CLIENT_ID - string PAYMENT_PAYPAL_SECRET - string

The OAuth credentials PayPal issued to you. GoCommerce will use them to obtain an access token.

PAYMENT_PAYPAL_ENV - string

The PayPal environment to use. Choose from production or sandbox.

Downloads

DOWNLOADS_PROVIDER - string

The provider to use for downloads. Choose from netlify or ``.

DOWNLOADS_NETLIFY_TOKEN - string

The authentication bearer token used to access the Netlify downloads API.

Coupons

COUPONS_URL - string

A URL that contains all the coupon information in JSON.

COUPONS_USER - string COUPONS_PASSWORD - string

HTTP Basic Authentication information to use if required to access the coupon information.

Webhooks

WEBHOOKS_ORDER - string WEBHOOKS_PAYMENT - string WEBHOOKS_UPDATE - string WEBHOOKS_REFUND - string

A URL to send a webhook to when the corresponding action has been performed.

WEBHOOKS_SECRET - string

A secret used to sign a JWT included in the X-Commerce-Signature header. This can be used to verify the webhook came from GoCommerce.

JSON Web Tokens (JWT)

GOCOMMERCE_JWT_SECRET=supersecretvalue

JWT_SECRET - string required

The secret used to verify JWT tokens with.

JWT_ADMIN_GROUP_NAME - string

The name of the admin group (if enabled). Defaults to admin.

E-Mail

Sending email is not required, but is highly recommended. If enabled, you must provide the required values below.

GOCOMMERCE_SMTP_HOST=smtp.mandrillapp.com
GOCOMMERCE_SMTP_PORT=587
[email protected]
GOCOMMERCE_SMTP_PASS=correcthorsebatterystaple
[email protected]
GOCOMMERCE_MAILER_SUBJECTS_ORDER_CONFIRMATION="Please confirm"

SMTP_ADMIN_EMAIL - string required

The From email address for all emails sent. Order receipts are also sent to this address.

SMTP_HOST - string required

The mail server hostname to send emails through.

SMTP_PORT - number required

The port number to connect to the mail server on.

SMTP_USER - string

If the mail server requires authentication, the username to use.

SMTP_PASS - string

If the mail server requires authentication, the password to use.

MAILER_SUBJECTS_ORDER_CONFIRMATION - string

Email subject to use for order confirmations. Defaults to Order Confirmation.

MAILER_SUBJECTS_ORDER_RECEIVED - string

Email subject to use for orders sent to the store admin. Defaults to Order Received From {{ .Order.Email }}.

MAILER_TEMPLATES_ORDER_CONFIRMATION - string

URL path, relative to the SITE_URL, of an email template to use when sending an order confirmation. Order and Transaction variables are available.

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>

MAILER_TEMPLATES_ORDER_RECEIVED - string

URL path, relative to the SITE_URL, of an email template to use when sending order details to the store admin. Order and Transaction variables are available.

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>

gocommerce's People

Contributors

bcomnes avatar bearcherian avatar biilmann avatar brycekahle avatar calavera avatar dustincrogers avatar eliwilliamson avatar erezrokah avatar gust1n avatar imorente avatar keiko713 avatar mraerino avatar mrdg avatar netlify-bot avatar rybit avatar sgirones avatar trhall avatar vbrown608 avatar verythorough avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gocommerce's Issues

Soft-delete instance related data when deleting an instance

- Do you want to request a feature or report a bug?

This would be a feature/improvement/rfc

- What is the current behavior?

When someone de-provisions an instance, we only soft-delete the instance data.

- What is the expected behavior?

We should soft-delete all related data.

Bulk delete multiple users

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
One user can be deleted per request

- What is the expected behavior?
New api to delete multiple users per request

Config

I am unclear how to get this working with GBP.

Where do I put the config.json file on my site? Or do I need to host my own gocommerce api?

Can anyone help?

cannot use r (type *router) as type "context".Context in argument to chi.ServerBaseContext

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
Unable to run install / run

- If the current behavior is a bug, please provide the steps to reproduce.

dev@DevX:[~]: go get -u github.com/netlify/gocommerce

go/src/github.com/netlify/gocommerce/api/api.go:145:57: cannot use r (type *router) as type "context".Context in argument to chi.ServerBaseContext:
	*router does not implement "context".Context (missing Deadline method)
go/src/github.com/netlify/gocommerce/api/api.go:145:57: cannot use ctx (type "context".Context) as type http.Handler in argument to chi.ServerBaseContext:
	"context".Context does not implement http.Handler (missing ServeHTTP method)

- What is the expected behavior?
Should be able to go get gocommerce

- Please mention your Go version, and operating system version.
Go 1.9 and 1.8.3, Ubuntu 16.04

Thanks

Pagination info for users endpoint is missing

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?
It is currently returning the following as a Link header in the response. The only value that changes is "per_page".
</users?page=1&per_page=1>; rel="last"
x-total-count is also always 1.

- If the current behavior is a bug, please provide the steps to reproduce.
Make a request to the /users endpoint.

- What is the expected behavior?
I expect the Link response header to be like the orders pagination information:
</users/all/orders?page=2&per_page=50>; rel="next", </users/all/orders?page=6&per_page=50>; rel="last"
And I expect x-total-count to return the correct total count.

Support PayPal refunds

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
refunds only work with stripe as the payment processor

- What is the expected behavior?
refunds work with stripe or paypal as the payment processor

Crashes at runtime if SMTP config is not provided in single-tenant mode

Note: Since I'm already hired to work on GoCommerce this is just a note for me to remember to fix this and how. I'm still open for suggestions on the best fix.


- Do you want to request a feature or report a bug?

Bug

- What is the current behavior?

The gocommerce server will always return an empty reply in single-tenant mode if an SMTP config is missing.

The following panic is logged for any request to the webserver:

2018/10/11 15:33:14 http: panic serving 172.23.0.1:60610: runtime error: invalid memory address or nil pointer dereference
goroutine 1741 [running]:
net/http.(*conn).serve.func1(0xc4205cae60)
     /usr/local/go/src/net/http/server.go:1721 +0xd0
panic(0xbfb6c0, 0x129e010)
     /usr/local/go/src/runtime/panic.go:489 +0x2cf
context.(*valueCtx).Value(0xc4205d2e10, 0xbe56c0, 0x129ddd0, 0xcd8501, 0x7f311d3c2960)
     /usr/local/go/src/context/context.go:478 +0x3f
context.(*valueCtx).Value(0xc4205d2e40, 0xbe56c0, 0x129ddd0, 0xc420039b80, 0x417938)
     /usr/local/go/src/context/context.go:478 +0x58
github.com/netlify/gocommerce/vendor/github.com/go-chi/chi.(*Mux).ServeHTTP(0xc420167570, 0x12b9a00, 0xc42028c0e0, 0xc4201ea600)
     /go/src/github.com/netlify/gocommerce/vendor/github.com/go-chi/chi/mux.go:67 +0x74
github.com/netlify/gocommerce/api.(*router).ServeHTTP(0xc420597720, 0x12b9a00, 0xc42028c0e0, 0xc4201ea600)
     /go/src/github.com/netlify/gocommerce/api/router.go:55 +0x54
github.com/netlify/gocommerce/vendor/github.com/go-chi/chi.ServerBaseContext.func1(0x12b9a00, 0xc42028c0e0, 0xc4201ea500)
     /go/src/github.com/netlify/gocommerce/vendor/github.com/go-chi/chi/context.go:126 +0x1de
net/http.HandlerFunc.ServeHTTP(0xc420211d40, 0x12b9a00, 0xc42028c0e0, 0xc4201ea500)
     /usr/local/go/src/net/http/server.go:1942 +0x44
github.com/netlify/gocommerce/vendor/github.com/rs/cors.(*Cors).Handler.func1(0x12b9a00, 0xc42028c0e0, 0xc4201ea500)
     /go/src/github.com/netlify/gocommerce/vendor/github.com/rs/cors/cors.go:200 +0xe9
net/http.HandlerFunc.ServeHTTP(0xc42059bac0, 0x12b9a00, 0xc42028c0e0, 0xc4201ea500)
     /usr/local/go/src/net/http/server.go:1942 +0x44
net/http.serverHandler.ServeHTTP(0xc42032ab00, 0x12b9a00, 0xc42028c0e0, 0xc4201ea500)
     /usr/local/go/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc4205cae60, 0x12ba380, 0xc42014a440)
     /usr/local/go/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
     /usr/local/go/src/net/http/server.go:2668 +0x2ce

- If the current behavior is a bug, please provide the steps to reproduce.

Create a docker container of gocommerce with the following environment variables:

GOCOMMERCE_OPERATOR_TOKEN: "123456"
GOCOMMERCE_SITE_URL: http://localhost:3000
GOCOMMERCE_API_ENDPOINT: http://localhost:9001
GOCOMMERCE_DB_DRIVER: postgres
GOCOMMERCE_DB_DATABASE_URL: postgres://gocommerce:gocommerce@gocommerce_db?sslmode=disable
GOCOMMERCE_DB_AUTOMIGRATE: 1

GoCommerce will not warn you that the SMTP config if missing when starting up.

When requesting any endpoint on the webserver, an empty reply will be returned and the panic logged.

Why does this happen?

When simply running the container the serve command is run.
It will try to integrate the global SMTP settings into a context object in cmd/serve_cmd.go:35. This does not result in an error and a context is created.

However, because of the missing config, this context has a bad pointer reference. So whenever the HTTP handler tries to access that context it will panic.

- What is the expected behavior?

GoCommerce should fail to start with a missing SMTP config when not started with gocommerce multi.

- Please mention your Go version, and operating system version.

I used the Dockerfile coming with the repo.

Discounts` Admin UI

Hi @biilmann ,

As discussed in the Netlify office, here's my take on how an ideal Discounts Admin UI should be structured:

Discount Code:

  • Input field

Conditions:

  • Percentage value
  • or Absolute value (with values for EUR & USD)

For:

  • All Orders
  • Orders Over ...
  • Product Category
  • Product

Usage Limits:

  • Unlimited
  • Limited number of uses
  • 1 use only (tracked by customer's email)

  • Date range: Start date, End date, No end date

2017-04-14

render orders with different types

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
Doesn't exist

- What is the expected behavior?
I want to be able to hit an endpoint explicitly dedicated to template rendering for an order and provide a template to return.
Like this:

GET /order/:id/template?template=email-reciept

That would then hit the configured site's template directly (e.g. /.netlify/gocommerce/templates/email-receipt) and run it through the template engine. We would return the resulting HTML (or whatever you write...).

This is very similar to the flow for doing confirmation emails.

The reasoning is that this allows us to provide 'permanent' urls that would return things like reciepts or PDFs (eventually...) for different use cases. This is like setting the 'accepts' headers to render JSON vs XML vs HTML.

Yes, this could be handled on the frontend. It could just hit the order endpoint and render the returned JSON into something via JS/CSS/etc. But it would mean that the consumer would have to write in multiple formats/specifications. Now they just write/render all the templates in the same lang.

Make the mailer optional

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
it will fail if a mailer isn't specified

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
we should make it so that if you don't configure a mailer, we have a noop mailer that will do nothing.

GOCOMMERCE_SMTP_ADMIN_EMAIL (and GOCOMMERCE_MAILER_ADMIN_EMAIL) are ignored

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?
Although both GOCOMMERCE_SMTP_ADMIN_EMAIL and GOCOMMERCE_MAILER_ADMIN_EMAIL are set, order confirmation emails go from [email protected] [email protected]

- If the current behavior is a bug, please provide the steps to reproduce.
Deploy gocommerce to Heroku, set GOCOMMERCE_SMTP_ADMIN_EMAIL and make an order.

- What is the expected behavior?
GOCOMMERCE_SMTP_ADMIN_EMAIL contains "From" field email./

Make golint pass an enable it in Travis to ensure the code remains consistent

- Do you want to request a feature or report a bug?

This is an enhancement to improve code quality.

- What is the current behavior?

Right now we're ignoring Go's linter rules.

- What is the expected behavior?

We should make sure the project passes the linter rules and enable make lint in Travis.

- Please mention your Go version, and operating system version.

Go 1.8 and up.

multitenancy support based on an instance ID

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
Currently, a single instance of gocommerce is for a single site.

- What is the expected behavior?
We should have allow for a single instance of gocommerce to support multiple different sites base on the aud in the JWT token.

I am not sure how this will work with anonymous checkouts, but it should be explored.

unclear parts of the config

in the config && example config there is an empty paypal struct{} and I am unclear on the mail_subjects. They seem to be documented as a struct with a single field, but the config shows a map[string]string

Continuous Order Number

For accounting reasons we need a continuous order number for each sale, that we can use in invoices.

We'll still keep the UUID for each order (since it's useful for linking to the order when handling anonymous orders), but introduce and incrementing field as well.

gocommerceapi.org ERR_CERT_COMMON_NAME_INVALID

I'm reporting an SSL certificate issue when trying to access: www.gocommerceapi.org

Your connection is not private

Attackers might be trying to steal your information from www.gocommerceapi.org (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_COMMON_NAME_INVALID
Subject: *.netlify.com
Issuer: AlphaSSL CA - SHA256 - G2
Expires on: Nov 24, 2018
Current date: Dec 2, 2017

Retroactive order history

- Do you want to request a feature or report a bug?
Feature.

- What is the current behavior?
If user signs up with an email used for some other orders previously, these orders do not show up in API response.

- What is the expected behavior?
See also orders made previously for this email.

- Please mention your Go version, and operating system version.

Add additional filtering capabilities to orders api

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
We can filter by shipping country and if an order includes tax.

- What is the expected behavior?

To filter orders by:
- Date to and from
- Billing status
- Shipping status
- Product type
- EU Counties
- Not EU Countries
image

Support multiple filters for listing orders

- Do you want to request a feature or report a bug?
feature

- What is the current behavior?
We support some filters.

- What is the expected behavior?
Support filtering by all of these:

  • email
  • item
  • country
  • customer name
  • coupon name
  • order date range
  • order vat %
  • product type (physical product / bundle product / eBooks / Tickets / Subscription)

All of them need to support case insensitive searching. The product type one is a bit harder to see exactly, but should become clear quickly.

- Please mention your Go version, and operating system version.

Product Variations

We're running into some cases where we have multiple variations of a product (ie, Physical Book vs Ebook).

Right now Netlify Commerce assumes that a product has a detail page with a script tag like this:

<script id="netlify-commerce-product" type="application/json">
{"title": "A Book", "prices":[{"amount":"39.00","currency":"USD"}], "sku":"my-book", "type":"Book"}
</script>

We should start optionally supporting multiple product variations on the same detail page. This would look like:

<script class="netlify-commerce-product" type="application/json">
{"title": "A Book", "prices":[{"amount":"39.00","currency":"USD"}], "sku":"my-book-physical", "type":"Book"}
</script>

<script class="netlify-commerce-product" type="application/json">
{"title": "A Book", "prices":[{"amount":"15.00","currency":"USD"}], "sku":"my-book-ebook", "type":"Ebook"}
</script>

For each line item, Netlify Commerce should look for all instances of ".netlify-commerce-product". If there's only 1 product definition, use that one, if there's more than one, require a "sku" in the order params for the line item to identify the right variation.

Unknown error "Error processing line item"

  • Do you want to request a feature or report a bug?
    Bug

  • What is the current behavior?
    When POST a order, just receive a message "Error processing line item", but not says what is the error.

  • What is the expected behavior?
    Says exactly whats the problem to proccess the item.

Tax calculation disregards discounts [CRITICAL]

- Do you want to request a feature or report a bug?
Bug.

- What is the current behavior?
The total tax stays the same even if a discount code is applied
(while it actually should be based to the final price, including the
discount)

- What is the expected behavior?
Tax calculation should be based to the final price, including the
discount

Duplicate of netlify/gocommerce-js#16

Add default URLs for mail templates

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
Mail template paths must be configured.

- What is the expected behavior?
Mail templates fallback to a default path, and if those are missing, fallback to the hard-coded defaults.

Any insights how the install setup in a Ubuntu AWS Instance of GoCommerce?

Hi everyone.

I`m wondering use GoCommerce in a new JAMStack e-commerce project using Hugo. So, my question is: have some step guide to install in a Ubuntu instance to serve the API for a Netlify hosting frontend?

I`m with a lot of problems to install the package in the instance and not running at all.

Thanks anyway,

Error 500 without say what is the problem on process the order

  • Do you want to request a feature or report a bug?
    Bug

  • What is the current behavior?
    When POST a order, just receive a message "Error processing line item", but not says what is the error.

  • What is the expected behavior?
    Says exactly whats the problem to proccess the item.

Cannot build the software on linux

Hi there i'm just trying out gommerce but having some issue with building the binary...
my operating system is Ubuntu 17.04
my steps are

  1. git clone https://github.com/netlify/gocommerce in my home directory
  2. cd into gocommerce
  3. make deps (got everything downloaded)
  4. make package_linux

my go related env

export GOROOT=/usr/local/go
export GOPATH=$HOME/gocommerce
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

seems like the test can't run for some reason

If i take out the test from the make file

i get this error

Making gocommerce for linux/amd64
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/netlify/gocommerce/cmd.Version=`git rev-parse HEAD`"
main.go:7:2: cannot find package "github.com/netlify/gocommerce/cmd" in any of:
	/usr/local/opt/go/libexec/src/github.com/netlify/gocommerce/cmd (from $GOROOT)
	/Users/andrew/projects/gocommerce/src/github.com/netlify/gocommerce/cmd (from $GOPATH)
make: *** [build] Error 1

Error with test

can't load package: package _/root/go/github.com/netlify: cannot find package "_/root/go/github.com/netlify" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/api: cannot find package "_/root/go/github.com/netlify/api" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/api (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/api (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/assetstores: cannot find package "_/root/go/github.com/netlify/assetstores" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/assetstores (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/assetstores (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/calculator: cannot find package "_/root/go/github.com/netlify/calculator" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/calculator (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/calculator (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/claims: cannot find package "_/root/go/github.com/netlify/claims" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/claims (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/claims (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/cmd: cannot find package "_/root/go/github.com/netlify/cmd" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/cmd (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/cmd (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/conf: cannot find package "_/root/go/github.com/netlify/conf" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/conf (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/conf (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/context: cannot find package "_/root/go/github.com/netlify/context" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/context (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/context (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/coupons: cannot find package "_/root/go/github.com/netlify/coupons" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/coupons (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/coupons (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/mailer: cannot find package "_/root/go/github.com/netlify/mailer" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/mailer (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/mailer (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/models: cannot find package "_/root/go/github.com/netlify/models" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/models (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/models (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/payments: cannot find package "_/root/go/github.com/netlify/payments" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/payments (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/payments (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/payments/paypal: cannot find package "_/root/go/github.com/netlify/payments/paypal" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/payments/paypal (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/payments/paypal (from $GOPATH)
can't load package: package _/root/go/github.com/netlify/payments/stripe: cannot find package "_/root/go/github.com/netlify/payments/stripe" in any of:
	/usr/local/go/src/_/root/go/github.com/netlify/payments/stripe (from $GOROOT)
	/root/go/src/_/root/go/github.com/netlify/payments/stripe (from $GOPATH)

Thanks in advance
Cheers!
A

Errors while saving `created_at`

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
This is getting logged after some saves. Not sure where nor why

(/go/src/github.com/netlify/gocommerce/api/order.go:401)
[2017-11-18 00:51:42]  Error 1292: Incorrect datetime value: '0000-00-00' for column 'created_at' at row 1

(/go/src/github.com/netlify/gocommerce/api/order.go:401)
[2017-11-18 00:51:42]  Error 1292: Incorrect datetime value: '0000-00-00' for column 'created_at' at row 1

(/go/src/github.com/netlify/gocommerce/api/order.go:401)
[2017-11-18 00:51:42]  Error 1292: Incorrect datetime value: '0000-00-00' for column 'created_at' at row 1

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
Not have an error

- Please mention your Go version, and operating system version.
go1.8

implement the admin API

// order controls

  • an admin can adjust order info
    • only when the state allows (e.g. can't update the billing address after the order has been paid)
    • the address can only be modified by creating a new one, or linking to an existing one
  • handle distributed locking of an order so update and processing don't collide
  • an admin can view the orders of a different user
  • an admin can see any specific order

// user control

  • an admin can remove a user (DELETE /users/:id)
  • an admin can update a user's email (POST /users/:id)
    • this could effect previous orders
  • an admin can remove an address for a user (DELETE /users/:id/addresses/:id)
  • an admin can add an address for a user (POST /users)
  • an admin can modify an address for a user (POST /users/:id)

// transactions

  • an admin can list the transaction(s) for a user (GET /users/:id/transactions[/:id])
  • an admin can refund a transaction for a user

Supporting Bundled Products in VAT calcuations

We currently support VAT calculations based on product type. Some products however are bundles that can contain different product types.

A common case is a bundle that has a Physical Book + an Ebook which typically fall into different VAT brackets.

Currently a product definition looks like this:

<script id="netlify-commerce-product" type="application/json">
{"title": "A Book", "prices":[{"amount":"39.00","currency":"USD"}], "sku":"my-book", "type":"Book"}
</script>

We should allow specifying that a price is based on multiple product types:

<script id="netlify-commerce-product" type="application/json">
{"title": "A Book", "prices":[{"amount":"39.00","currency":"USD", items: [{"amount": "24.00", "type": "Book"}, {"amount": "15.00", "type": "Ebook"}], ], "sku":"my-book", "type":"Book"}
</script>

And take this optional "items" definition into account when calculating VAT.

Do not log health check requests

- Do you want to request a feature or report a bug?
feature
- What is the current behavior?
gocommerce logs all requests to health check endpoint
- What is the expected behavior?
gocommerce does not log health check requests.

See netlify/gotrue#99

Discount per line item

- Do you want to request a feature or report a bug?
Feature. Duplicate of netlify/gocommerce-js#15.

- What is the current behavior?
Overall discount amount returned.

- If the current behavior is a bug, please provide the steps to reproduce.
No.

- What is the expected behavior?
Adding a discount amount calculated to each of line items

- Please mention your Go version, and operating system version.
Any.

remove mongo db support

using mongoDB is not necessary. It muddies up the code. And b/c mongodb doesn't support transactions on a DB level, it is not a good choice for a commerce backend.

Completely override config on update

- Do you want to request a feature or report a bug?
feature
- What is the current behavior?
configuration is merged. This does not allow setting back to zero values.
- What is the expected behavior?
configuration is overridden completely.

See netlify/gotrue#75

PayPal email receipt contains no product information and no seller info

- Do you want to request a feature or report a bug?
Bug.

- What is the current behavior?
PayPal email receipt contains no product information. Product name and seller info is empty.

- If the current behavior is a bug, please provide the steps to reproduce.
Purchase any product using paypal and see generated receipt mailed. See example attached.
c_users_ingee_appdata_local_packages_microsoft skypeapp_kzf8qxf38zg5c_localstate_3bd58306-5c4e-4ede-a5a1-c351dc32961e

- What is the expected behavior?
Product names and seller info are filled out.

- Please mention your Go version, and operating system version.
Any.

Add totalOrders field to the sales report api

func (a *API) SalesReport(w http.ResponseWriter, r *http.Request) error {

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
Current response:
0:{total: 710624, subtotal: 662322, taxes: 107951, currency: "EUR"}

- What is the expected behavior?
To have the total number of orders to be returned in the response as well.

remove configuration override

- Do you want to request a feature or report a bug?
feature removal

- What is the current behavior?
based on the env provided in the JWS header we will load a different configuration. Allowing for overrides.

- What is the expected behavior?
remove all of this. There is only one configuration for an instance. For different 'environments' you'd use different configurations.

Allow decimals in tax calculations

We're running into a case where France has a 5.5% tax, and currently all tax settings are read and processed as integers.

We should update the calculator to allow reading taxes with decimals and adjust all calculations accordingly.

Add additional searching capabilities to orders api

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
We can currently search orders by item and email

- What is the expected behavior?
To search all order fields:

  • ID
  • Date
  • Type
  • Subtotal
  • Taxes
  • Total
  • Customer name
  • Billing status
  • Billing address
  • Billing country
  • Billing company
  • VAT ID
  • Shipping status
  • Shipping address
  • Shipping country
  • Shipping company

image

Products feed

I've read that for products "The metadata can be anywhere on the page". How do you recommend storing/getting the products? What is the best practice? I mean, should they be on another endpoint and one fetches them from there? Most likely they are in a database

Retroactive order uploads update

- Do you want to request a feature or report a bug?
Feature

- What is the current behavior?
User doesn't see any product uploads (or changes) if they were added after the actual purchase.

- If the current behavior is a bug, please provide the steps to reproduce.
Purchase a digital product, then add another upload to it. User won't see it.

- What is the expected behavior?
Product uploads are retroactively propagated to all orders.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.