Skip to content

Transactions Model Pro

The Transactions model logs individual payment attempts and gateway responses. It provides a detailed audit trail of financial interactions.

Attributes

AttributeTypeDescription
idbigintPrimary key
object_idbigintReference to the Order ID
object_typevarcharObject type (e.g., order, booking, subscription)
transaction_typevarcharone_time, subscription, refund
subscription_idintRelated subscription ID (nullable)
card_last_4intLast 4 digits of the card used (nullable)
card_brandvarcharCard brand e.g., Visa, Mastercard (nullable)
vendor_charge_idvarcharGateway-provided ID (e.g., Stripe ch_...)
payment_methodvarcharPayment gateway key (e.g., stripe, paypal)
payment_method_typevarcharFurther payment method details
statusvarcharsucceeded, failed, pending, refunded
totaldecimal(18,9)Transaction amount
ratedecimal(10,5)Currency conversion rate (default 1.00000)
uuidvarcharUnique identifier
metajsonJSON response from the payment gateway (auto-decoded to array)
created_attimestampRecord creation time
updated_attimestampRecord last update time

Usage Examples

Retrieving gateway metadata

php
use FluentBookingPro\App\Models\Transactions;

$transaction = Transactions::where('vendor_charge_id', 'ch_3N...')->first();
$gatewayData = $transaction->meta; // Decodes automatically to array

echo "Card Brand: " . $gatewayData['source']['brand'];