Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions 1.x/extending/payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -209,24 +209,24 @@ scenarios.
Lunar\Models\Transaction
```

| Field | Description | Example |
|:----------------------|:------------------------------------------------|:--------------------------------------------------------------------------------------------|
| id | |
| parent_transaction_id | The ID of the related transaction, nullable |
| order_id | The ID of the order this transaction relates to |
| success | Whether or not the transaction was successful | 1
| type | Whether `intent`,`capture` or `refund` | `intent`
| driver | The driver used i.e. `stripe` | `stripe`
| amount | The amount for the transaction in cents | `10000`
| reference | The reference for the driver to use | `STRIPE_123456`
| status | Usually populated from the payment provider | `success`
| notes | Any additional notes for the transaction |
| card_type | The card type | `visa`
| last_four | The last four digits of the card used | `1234`
| captured_at | The DateTime the transaction was captured |
| meta | Any additional meta info for the transaction | `{"cvc_check": "pass", "address_line1_check": "pass", "address_postal_code_check": "pass"}`
| created_at | |
| updated_at | |
| Field | Type | Description | Example |
| :----------------------- | :--------------------- | :----------------------------------------- | :-------------- |
| `id` | `bigint` | Primary key | |
| `parent_transaction_id` | `foreignId` `nullable` | The ID of the preceding transaction | |
| `order_id` | `foreignId` | The associated order | |
| `success` | `boolean` | Whether the transaction succeeded | `true` |
| `type` | `enum` | `intent`, `capture`, or `refund` | `capture` |
| `driver` | `string` | The payment driver | `stripe` |
| `amount` | `integer` | Amount in the currency's smallest unit | `10000` |
| `reference` | `string` | Provider reference | `STRIPE_123456` |
| `status` | `string` | Provider-specific status | `success` |
| `notes` | `string` `nullable` | Any additional notes for the transaction | |
| `card_type` | `string` `nullable` | Card brand | `visa` |
| `last_four` | `string` `nullable` | Last four digits of the card | |
| `meta` | `json` `nullable` | Additional provider data | |
| `created_at` | `timestamp` `nullable` | | |
| `updated_at` | `timestamp` `nullable` | | |
| `captured_at` | `timestamp` `nullable` | When the payment was captured | |

### Best Practices

Expand Down
34 changes: 18 additions & 16 deletions 1.x/guides/payment-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -411,22 +411,24 @@ A new transaction record with type `refund` is created automatically.

Every payment event is recorded as a `Lunar\Models\Transaction` on the order. Transactions provide a complete audit trail.

| Field | Type | Description |
|:---|:---|:---|
| `id` | `bigint` | Primary key |
| `order_id` | `foreignId` | The associated order |
| `success` | `boolean` | Whether the transaction succeeded |
| `type` | `string` | `intent`, `capture`, or `refund` |
| `driver` | `string` | The payment driver (e.g., `stripe`) |
| `amount` | `integer` | Amount in the currency's smallest unit |
| `reference` | `string` | Provider reference (e.g., Stripe charge ID) |
| `status` | `string` | Provider-specific status |
| `card_type` | `string` `nullable` | Card brand (e.g., `visa`, `mastercard`) |
| `last_four` | `string` `nullable` | Last four digits of the card |
| `captured_at` | `timestamp` `nullable` | When the payment was captured |
| `meta` | `json` `nullable` | Additional provider data |
| `created_at` | `timestamp` | |
| `updated_at` | `timestamp` | |
| Field | Type | Description |
| :----------------------- | :--------------------- | :------------------------------------------- |
| `id` | `bigint` | Primary key |
| `parent_transaction_id` | `foreignId` `nullable` | The ID of the preceding transaction |
| `order_id` | `foreignId` | The associated order |
| `success` | `boolean` | Whether the transaction succeeded |
| `type` | `string` | `intent`, `capture`, or `refund` |
| `driver` | `string` | The payment driver (e.g., `stripe`) |
| `amount` | `integer` | Amount in the currency's smallest unit |
| `reference` | `string` | Provider reference (e.g., Stripe charge ID) |
| `status` | `string` | Provider-specific status |
| `notes` | `string` `nullable` | Any additional notes for the transaction |
| `card_type` | `string` `nullable` | Card brand (e.g., `visa`, `mastercard`) |
| `last_four` | `string` `nullable` | Last four digits of the card |
| `meta` | `json` `nullable` | Additional provider data |
| `created_at` | `timestamp` `nullable` | |
| `updated_at` | `timestamp` `nullable` | |
| `captured_at` | `timestamp` `nullable` | |

### Displaying Transaction History

Expand Down