Updated charge close to working
This commit is contained in:
21
app/classes/transactions.py
Normal file
21
app/classes/transactions.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from sqlalchemy import Column, Integer, String, Float, DateTime
|
||||
from app import db
|
||||
import datetime
|
||||
|
||||
|
||||
class Transaction(db.Model):
|
||||
__tablename__ = "transactions"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
preauthorize_amount = Column(Float, nullable=True) # Amount preauthorized (for auth transactions)
|
||||
charge_amount = Column(Float, nullable=True) # Final charge amount (for charge/capture transactions)
|
||||
transaction_type = Column(Integer) # 0 = charge, 1 = auth, 3 = capture
|
||||
status = Column(Integer) # 0 = approved, 1 = declined
|
||||
auth_net_transaction_id = Column(String, unique=True, index=True, nullable=True)
|
||||
customer_id = Column(Integer)
|
||||
service_id = Column(Integer, nullable=True) # Reference to Service_Service.id
|
||||
delivery_id = Column(Integer, nullable=True) # Reference to Delivery_Delivery.id
|
||||
card_id = Column(Integer, nullable=True) # Reference to credit card used for payment
|
||||
payment_gateway = Column(Integer, default=1) # 1 = Authorize.Net, 0 = Other
|
||||
rejection_reason = Column(String, nullable=True) # Detailed error message when payment is declined
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
Reference in New Issue
Block a user