Saving more details, redirecting and simplifying the succeed handler
This commit is contained in:
@ -72,6 +72,8 @@ type Transaction struct {
|
||||
LastFour string `json:"last_four"`
|
||||
ExpiryMonth int `json:"expiry_month"`
|
||||
ExpiryYear int `json:"expiry_year"`
|
||||
PaymentIntent string `json:"payment_intent"`
|
||||
PaymentMethod string `json:"payment_method"`
|
||||
BankReturnCode string `json:"bank_return_code"`
|
||||
TransactionStatusID int `json:"transaction_status_id"`
|
||||
CreatedAt time.Time `json:"-"`
|
||||
@ -134,9 +136,9 @@ func (m *DBModel) InsertTransaction(txn Transaction) (int, error) {
|
||||
|
||||
stmt := `INSERT INTO transactions
|
||||
(amount, currency, last_four, expiry_month, expiry_year,
|
||||
bank_return_code,
|
||||
payment_intent, payment_method, bank_return_code,
|
||||
transaction_status_id, created_at, updated_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||
|
||||
result, err := m.DB.ExecContext(ctx, stmt,
|
||||
txn.Amount,
|
||||
@ -144,6 +146,8 @@ func (m *DBModel) InsertTransaction(txn Transaction) (int, error) {
|
||||
txn.LastFour,
|
||||
txn.ExpiryMonth,
|
||||
txn.ExpiryYear,
|
||||
txn.PaymentIntent,
|
||||
txn.PaymentMethod,
|
||||
txn.BankReturnCode,
|
||||
txn.TransactionStatusID,
|
||||
time.Now(),
|
||||
|
Reference in New Issue
Block a user