Permalink
Browse files

Add invoice number to transaction

  • Loading branch information...
biilmann committed Jan 16, 2018
1 parent 2ca0b10 commit cde172e70748b164f6d0b5ab3129a5be18ab4cb5
Showing with 6 additions and 4 deletions.
  1. +1 −0 api/payments.go
  2. +5 −4 models/transaction.go
View
@@ -164,6 +164,7 @@ func (a *API) PaymentCreate(w http.ResponseWriter, r *http.Request) error {
tr := models.NewTransaction(order)
processorID, err := charge(params.Amount, params.Currency)
tr.ProcessorID = processorID
tr.InvoiceNumber = invoiceNumber
if err != nil {
tr.FailureCode = strconv.FormatInt(http.StatusInternalServerError, 10)
View
@@ -15,10 +15,11 @@ const RefundTransactionType = "refund"
// Transaction is an transaction with a payment provider
type Transaction struct {
InstanceID string `json:"-"`
ID string `json:"id"`
Order *Order `json:"-"`
OrderID string `json:"order_id"`
InstanceID string `json:"-"`
ID string `json:"id"`
Order *Order `json:"-"`
OrderID string `json:"order_id"`
InvoiceNumber int64 `json:"invoice_number"`
ProcessorID string `json:"processor_id"`

0 comments on commit cde172e

Please sign in to comment.