Comments (5)
Should only be set when the payment goes through
from gocommerce.
Allow searching by this order number as well.
from gocommerce.
Fixed in #86
from gocommerce.
While going through the code I noticed this can still happen.
E.g. when a transaction is failing, the invoice number is increased anyways.
https://github.com/netlify/gocommerce/blob/master/api/payments.go#L159-L177
invoiceNumber, err := models.NextInvoiceNumber(tx, order.InstanceID)
if err != nil {
tx.Rollback()
return internalServerError("We failed to generate a valid invoice ID, please try again later: %v", err)
}
tr := models.NewTransaction(order)
processorID, err := charge(params.Amount, params.Currency, order, invoiceNumber)
tr.ProcessorID = processorID
tr.InvoiceNumber = invoiceNumber
if err != nil {
tr.FailureCode = strconv.FormatInt(http.StatusInternalServerError, 10)
tr.FailureDescription = err.Error()
tr.Status = models.FailedState
tx.Create(tr)
tx.Commit()
return internalServerError("There was an error charging your card: %v", err).WithInternalError(err)
}
The error case should rollback the invoice id. And the transaction should probably not get one if failed.
from gocommerce.
Fixed by #182
from gocommerce.
Related Issues (20)
- TBD and remaining issues HOT 2
- Install TLS certificate in GoCommerce instance HOT 3
- Bad pagination parameters HOT 1
- Database error on reports/products HOT 1
- Automate migration
- Indexes in postgresql are not namespaced HOT 1
- Make payment providers optional HOT 1
- No downloads returned. HOT 2
- Support Strong Customer Authentication using stripe HOT 3
- Rip out netlify-commons HOT 1
- transactions list endpoint fails with SQL error
- Invalid http body on /claim endpoint
- Placing an order with multiple digital products allows to download only files for the first added
- Fix invalid paypal transaction updates
- Fix intermittently failing test: TestOrderCreate/MultipleItemsWithDownloads
- How can I use it ? HOT 3
- not working on heroku it show something error in code HOT 2
- [security] Enforce Branch Protections
- BUG - Error douring deploy on Heroku by button
- Different pricing based on user role
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocommerce.