Lesson 70: Building the Payment Page Foundation for Completed Auctions


Introduction

After successfully completing the auction lifecycle in the previous lessons, the next logical step is to allow auction winners to complete their purchase.

By the end of Lesson 69, Flipnzee Auctions was already capable of:

  • Creating and managing auctions
  • Automatically closing expired auctions
  • Determining the winning bidder
  • Recording transactions
  • Displaying transactions in the WordPress admin
  • Showing buyers their purchases
  • Displaying purchase details
  • Providing a Pay Now button for unpaid purchases

Although the Pay Now button existed, clicking it resulted in a 404 Page Not Found error because the payment page itself had not yet been implemented.

Lesson 70 focuses on solving this problem by creating the foundation of the payment workflow.


Why This Lesson Is Important

Every online marketplace requires a secure payment flow after an auction ends.

Instead of jumping directly into integrating a payment gateway like Stripe or PayPal, it is better to build the underlying architecture first.

This lesson concentrates on creating the page that receives the transaction, validates it, and displays the purchase before any actual payment processing takes place.

Building the foundation first makes later gateway integration much cleaner and easier.


Objectives

In this lesson we will:

  • Create the Payment Page shortcode
  • Build a dedicated Payment Page class
  • Register the shortcode with the plugin loader
  • Display transaction information
  • Validate transaction IDs
  • Handle missing or invalid transactions gracefully
  • Prepare the page for future payment gateway integration

Planned Workflow

To keep development safe and manageable, this lesson will be completed in several small checkpoints.

Checkpoint 1

Create the Payment Page class.


Checkpoint 2

Register the payment shortcode.


Checkpoint 3

Display transaction information.


Checkpoint 4

Handle invalid transactions.


Checkpoint 5

Test the page using existing auction transactions.


Checkpoint 6

Commit the completed lesson to Git.


Expected User Flow

Auction Ends
        │
        ▼
Winner Determined
        │
        ▼
Transaction Created
        │
        ▼
Buyer Visits "My Purchases"
        │
        ▼
Clicks "Pay Now"
        │
        ▼
Payment Page Opens
        │
        ▼
Transaction Validated
        │
        ▼
Ready for Payment Gateway

Development Strategy

One important improvement in our workflow is the use of small Git checkpoints.

At the beginning of this lesson, the entire project was restored to the stable Lesson 69 state and committed to GitHub. This provides a reliable rollback point before introducing the payment workflow.

Rather than implementing the complete payment system in one attempt, each stage will be developed, tested, and committed separately. This incremental approach reduces risk, simplifies debugging, and ensures that any issues can be isolated without affecting previously completed features.


What We’ll Build Next

By the end of Lesson 70, clicking the Pay Now button should no longer produce a 404 error. Instead, buyers will be taken to a dedicated payment page displaying the transaction details, confirming the amount due, and preparing the auction purchase for payment processing in the upcoming lessons.


Next Lesson: Implementing the Payment Page and Connecting the “Pay Now” Workflow.

Lesson 69: Adding a Payment Page and Payment Links for Auction Winners in the Flipnzee Auctions Plugin

As the Flipnzee Auctions plugin continues to evolve, one of the next logical improvements was to guide auction winners toward completing their purchase. In previous lessons, buyers could view their purchases and transaction details, but there was no dedicated page to begin the payment process.

In this lesson, a frontend payment page was introduced along with contextual payment links, creating a smoother purchasing experience for buyers.


Objective

The goal of this lesson was to:

  • Create a dedicated Payment page.
  • Add a new payment shortcode.
  • Display a Pay Now action for pending purchases.
  • Keep View Details available for completed purchases.
  • Build the foundation for integrating real payment gateways in future lessons.

Step 1: Created the Payment Page Class

A new file was added:

includes/class-payment-page.php

This class is responsible for rendering the payment page using a shortcode.

It retrieves the transaction ID from the URL, validates the request, and prepares the page for displaying payment-related information.


Step 2: Loaded the New Class

The main plugin file was updated to load the payment page class.

require_once FLIPNZEE_AUCTION_PATH .
    'includes/class-payment-page.php';

This ensures the payment functionality becomes available whenever the plugin loads.


Step 3: Registered a New Shortcode

A new shortcode was registered for the payment page.

Example:

[flipnzee_payment]

This shortcode can be placed on any WordPress page to create a dedicated payment screen.


Step 4: Created the Payment Page

Inside WordPress, a new page named:

Payment

was created.

Its content simply contains:

[flipnzee_payment]

This allows buyers to visit:

https://example.com/payment/

and access their payment page.


Step 5: Added Dynamic Payment Links

The My Purchases table was enhanced with conditional action links.

If a purchase is still pending:

Pay Now

is displayed.

If payment has already been completed:

View Details

is displayed.

This creates a cleaner and more intuitive workflow for buyers.


Step 6: Passed the Transaction ID

When the buyer clicks Pay Now, the transaction ID is automatically included in the URL.

Example:

/payment/?transaction_id=5

The payment page then knows exactly which purchase is being processed.


Step 7: Improved User Experience

Originally, the purchase details shortcode displayed:

Invalid transaction.

when no transaction ID was present.

This was changed so that the shortcode quietly returns nothing instead.

As a result:

  • The My Purchases page remains clean.
  • Purchase details only appear after selecting a specific transaction.

Step 8: Displayed Both Actions for Pending Purchases

To make the interface more useful, pending purchases now display both actions.

Pay Now

View Details

This allows buyers to review their purchase before completing payment.


Testing Performed

The following scenarios were successfully tested:

  • Plugin activation
  • Payment page loading
  • Payment shortcode rendering
  • Pending purchases displaying Pay Now
  • Paid purchases displaying View Details
  • Purchase Details page opening correctly
  • Transaction IDs passed correctly through URLs
  • No PHP syntax errors
  • No fatal errors after implementation

Result

The buyer journey has now become much more complete.

Auction Listing
        ↓
Place Bid
        ↓
Auction Ends
        ↓
Transaction Created
        ↓
My Purchases
        ↓
Pay Now
        ↓
Purchase Details

Although the payment page currently serves as a placeholder, it establishes the structure required for integrating payment gateways such as Stripe, Razorpay, PayPal, or WooCommerce Payments in future lessons.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


What I Learned

This lesson demonstrated several important WordPress plugin development concepts:

  • Creating additional frontend components using shortcodes.
  • Passing data securely through URL parameters.
  • Building conditional user interfaces based on transaction status.
  • Improving usability by displaying context-sensitive actions.
  • Designing a scalable workflow that can later support real payment gateways.

Conclusion

Lesson 69 transformed the Flipnzee Auctions plugin from simply tracking purchases into guiding buyers through the next stage of the auction process. By introducing a dedicated payment page and dynamic action links, the plugin now provides a more complete end-to-end purchasing experience while laying the groundwork for future payment gateway integration.

Lesson 69: Build the Buyer Payment Page


Why This Lesson?

A buyer can now:

  • Browse auctions.
  • Place bids.
  • Win an auction.
  • View purchases.
  • View transaction details.

The next logical step is allowing the buyer to proceed to payment.

Although payment gateways (Stripe, Razorpay, PayPal, etc.) will be integrated later, we should first build the payment page and workflow.


What We Will Build

A new frontend shortcode:

[flipnzee_payment]

This page will display:

Payment

Auction:
Wpnzee.com

Transaction ID:
#2

Winning Bid:
₹55,555,609.00

Status:
Pending

------------------------------------------------

Proceed to Payment

Initially, the button will simply display a placeholder message.

In later lessons it will connect to:

  • Stripe
  • Razorpay
  • PayPal

without redesigning the page.


New Workflow

My Purchases
      │
      ▼
View Details
      │
      ▼
Purchase Details
      │
      ▼
Proceed to Payment

Features

During this lesson we will:

  • Create a Payment shortcode.
  • Verify the buyer owns the transaction.
  • Retrieve transaction details.
  • Display payment summary.
  • Show a “Proceed to Payment” button.
  • Hide the button once the transaction is already marked as Paid.

Files Expected to Change

includes/class-payment.php
includes/class-shortcodes.php
flipnzee-auctions.php
includes/class-my-purchase-details.php

New Shortcode

[flipnzee_payment]

Payment Summary

The page will display:

FieldExample
Transaction ID#2
AuctionWpnzee.com
Winning Bid₹55,555,609.00
StatusPending

Button Behaviour

If:

Status = Pending

display

Proceed to Payment

If:

Status = Paid

display

✓ Payment Received

This provides immediate visual feedback and prevents duplicate payment attempts.


Skills You’ll Learn

During this lesson you’ll learn how to:

  • Build another reusable frontend shortcode.
  • Reuse secure transaction validation.
  • Conditionally display interface elements.
  • Create a payment-ready architecture.
  • Design pages that can later integrate with payment gateways without major refactoring.

Expected Outcome

By the end of Lesson 69, Flipnzee Auctions will have a complete post-purchase navigation flow:

Auction
      │
      ▼
Bid
      │
      ▼
Winner
      │
      ▼
My Purchases
      │
      ▼
Purchase Details
      │
      ▼
Payment Page

Although no real payment will be processed yet, the platform will be structurally ready for payment gateway integration in subsequent lessons.


Why this is a good next step

Instead of postponing payment until the end of development, we’re building the user journey in the same order a real buyer experiences it. When you later integrate Stripe, Razorpay, or another gateway, you’ll only need to replace the placeholder button action rather than redesign the buyer workflow. This keeps the development incremental and makes Version 1 feel complete from a user’s perspective.

Lesson 68 Implementation: Building a Secure Buyer Purchase Details Page in Flipnzee Auctions

In the previous lesson, buyers gained access to a My Purchases dashboard where they could see every website they had won through Flipnzee Auctions. While that was a major improvement, buyers still had no way to inspect an individual transaction.

Lesson 68 addresses this by introducing a dedicated Purchase Details page. Buyers can now click a transaction from their purchase history and securely view its complete details.


What We Built

During this lesson, a new frontend component was created specifically for buyers.

The new class:

Flipnzee_My_Purchase_Details

is responsible for displaying the details of a single purchase.

The page is powered by a new shortcode:

[flipnzee_purchase_details]

Creating the Purchase Details Class

A new file was added to the plugin:

includes/class-my-purchase-details.php

Initially, the class simply:

  • Prevented direct access.
  • Checked whether the visitor was logged in.
  • Displayed a placeholder heading.

Building the page incrementally allowed each stage to be tested before adding more functionality.


Loading the Class

The new class was loaded inside the main plugin file.

require_once FLIPNZEE_AUCTION_PATH .
	'includes/class-my-purchase-details.php';

After every modification, syntax was verified using:

php -l flipnzee-auctions.php

Registering the Shortcode

Next, the shortcode was registered inside the shortcode manager.

[flipnzee_purchase_details]

This allows the purchase details page to be inserted on any WordPress page using a shortcode, keeping the implementation flexible and reusable.


Reading the Transaction ID

Unlike the purchase history page, the details page must know which transaction to display.

The transaction ID is retrieved from the URL.

Example:

https://flipnzee.com/purchase-details/?transaction_id=2

The value is sanitised using:

absint()

If no transaction ID is supplied, a friendly error message is shown instead of attempting a database query.


Secure Database Lookup

One of the most important parts of this lesson was securing access to transaction data.

Instead of loading a transaction using only its ID, the query verifies both:

  • Transaction ID
  • Logged-in Buyer ID

The SQL query therefore ensures buyers can only access their own purchases.

Even if someone manually changes:

?transaction_id=1

to

?transaction_id=50

they cannot view another user’s transaction unless they are the rightful buyer.

This is an essential security practice for any marketplace application.


Building the Purchase Details Page

Once the transaction is retrieved successfully, the page displays a professional summary.

Information shown includes:

  • Transaction ID
  • Auction Title
  • Winning Bid
  • Transaction Status
  • Purchase Date

Instead of returning plain HTML strings, PHP output buffering was used.

ob_start();
...
return ob_get_clean();

This keeps the template much easier to read and maintain.


Adding Navigation from My Purchases

The purchase history table was then enhanced with a brand new Details column.

Each purchase now contains a View Details link.

Clicking the link automatically opens the Purchase Details page for the selected transaction.

The navigation flow now becomes:

My Purchases
      │
      ▼
View Details
      │
      ▼
Purchase Details

This creates a far more natural user experience than requiring buyers to manually edit URLs.


Testing

Several scenarios were tested during implementation.

Missing Transaction ID

Without a transaction ID:

/testing/

the page correctly displayed:

Invalid transaction.

Valid Transaction

When a valid transaction was supplied:

/testing/?transaction_id=2

the page successfully displayed the transaction details.


Invalid Transaction

Using an invalid transaction ID correctly returned:

Transaction not found.

This confirms the validation logic is working correctly.


Final Result

The completed Purchase Details page now displays information similar to:

FieldValue
Transaction ID2
AuctionWpnzee.com
Winning Bid₹55,555,609.00
StatusPaid
Purchased2026-07-06 05:42:05

The page is accessible directly from the buyer’s purchase history through the View Details link.


Lessons Learned

This lesson reinforced several important WordPress development concepts.

  • Building reusable shortcode-based pages.
  • Reading and sanitising URL parameters.
  • Using $wpdb->prepare() for secure database queries.
  • Verifying ownership before displaying private information.
  • Using output buffering to generate HTML templates.
  • Creating navigation between frontend pages.
  • Improving usability through contextual links.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Why This Feature Matters

Lesson 68 completes the buyer transaction workflow within Flipnzee Auctions.

Previously, buyers could only see a list of purchases. They can now drill down into individual transactions and review important information without needing administrator assistance.

Combined with the My Purchases dashboard introduced in Lesson 67, buyers now have a professional frontend experience that mirrors the functionality commonly found in commercial marketplace platforms.

As Flipnzee evolves, this page can be expanded further with payment confirmations, downloadable invoices, escrow status, support requests, digital asset delivery, and other post-purchase features. It provides a strong and secure foundation for the buyer experience while bringing the Flipnzee Auctions plugin another significant step closer to a production-ready Version 1 release.

Lesson 68: Build the Buyer Transaction Details Page


Why This Lesson?

In Lesson 67, buyers gained a My Purchases dashboard listing all their purchased websites.

The next logical step is allowing buyers to click a purchase and view complete transaction information, just as administrators can from the WordPress dashboard.

This improves transparency and prepares the platform for payment confirmation, invoices, and future escrow integration.


What We Will Build

Instead of showing only:

AuctionWinning BidStatusPurchased

buyers will be able to click View Details and see a dedicated transaction page.

Example:

Transaction Details

Auction:
Wpnzee.com

Winning Bid:
₹55,555,609.00

Status:
Paid

Purchase Date:
6 July 2026

Seller:
Flipnzee

Buyer:
Rajeev Bagra

Transaction ID:
#2

Features

During this lesson we will:

  • Create a Buyer Transaction Details shortcode.
  • Pass the transaction ID securely.
  • Verify that the logged-in user owns the transaction.
  • Retrieve the transaction from the database.
  • Display all transaction information.
  • Prevent unauthorized users from viewing someone else’s purchases.

Files Expected to Change

includes/class-my-purchases.php
includes/class-my-purchase-details.php
includes/class-shortcodes.php
flipnzee-auctions.php

New Shortcode

[flipnzee_purchase_details]

New Workflow

Buyer Login
      │
      ▼
My Purchases
      │
      ▼
View Details
      │
      ▼
Purchase Details

Skills You’ll Learn

  • Passing IDs through URLs
  • Secure ownership verification
  • Database lookups using $wpdb->prepare()
  • Protecting private user data
  • Building frontend detail pages
  • Creating reusable shortcode-based pages

Expected Outcome

By the end of Lesson 68, every buyer will have:

  • A purchase history page (completed in Lesson 67).
  • A dedicated page for each purchase.
  • Secure access limited to their own transactions.
  • A foundation for future features such as payment receipts, invoices, escrow updates, download links, and support requests.

Why this is a better priority than a Seller Dashboard

Since Flipnzee Version 1 will only list websites sold by your own business, you already manage sales through the WordPress admin:

  • Listings
  • Bids
  • Transactions
  • Transaction Details
  • Activity Log

Your buyers, however, have no admin access. Enhancing their experience adds more value for Version 1 and lays the groundwork for future marketplace capabilities.

Lesson 67 Implementation: Building the Buyer Dashboard with the My Purchases Shortcode


One of the first features buyers expect after winning an auction is the ability to review their purchases. In Lesson 67, the Flipnzee Auctions plugin gained a dedicated buyer dashboard through a new shortcode called My Purchases.

Instead of forcing buyers to contact the administrator or search through emails, they can now view their completed and pending purchases directly from a WordPress page.


What We Built

During this lesson, a new class named Flipnzee_My_Purchases was created to handle the buyer dashboard.

The class:

  • Checks whether the visitor is logged in.
  • Retrieves transactions belonging to the current buyer.
  • Displays a friendly message if there are no purchases.
  • Outputs a purchase table using a shortcode.

The new shortcode is:

[flipnzee_my_purchases]

This allows the dashboard to be placed on any WordPress page.


Loading the New Class

A new file was created:

includes/class-my-purchases.php

The class was then loaded inside the main plugin file using require_once, ensuring it is available whenever the plugin loads.

As always, syntax was verified after making the change using:

php -l includes/class-my-purchases.php

Registering the Shortcode

The shortcode was registered inside the shortcode manager.

This makes the following shortcode available throughout WordPress:

[flipnzee_my_purchases]

From this point onwards, any page can become a buyer dashboard simply by inserting this shortcode.


Retrieving Buyer Transactions

The next task was querying the custom transactions table.

Only transactions belonging to the currently logged-in buyer are retrieved.

The query filters records using the current WordPress user ID and orders them from newest to oldest.

If no purchases exist, a friendly message is displayed instead of an empty table.


Displaying Purchase Information

Once the data was retrieved successfully, a responsive HTML table was generated.

Initially the table displayed:

  • Listing ID
  • Winning Bid
  • Status
  • Purchase Date

Testing confirmed that multiple purchases were displayed correctly.


Improving the User Experience

The Listing ID was later replaced with the actual listing title using WordPress functions.

Instead of displaying:

491

buyers now see something like:

Wpnzee.com

This makes the dashboard far easier to understand.


Making Listings Clickable

The listing title was then converted into a hyperlink.

Buyers can now click directly on the purchased website to revisit the listing page.

This small enhancement greatly improves navigation throughout the marketplace.


Formatting Currency

Winning bid values were originally displayed as raw numbers:

55555609.00

The output was improved using PHP’s number_format() function together with the Rupee symbol.

The dashboard now displays:

₹55,555,609.00

which is much more readable and professional.


Final Result

The completed buyer dashboard now displays:

AuctionWinning BidStatusPurchased
Wpnzee.com₹55,555,609.00Paid2026-07-06 05:42:05
Wpnzee.com₹55,555,609.00Pending2026-07-06 05:36:13

Each listing title links directly to its auction page.


Lessons Learned

A few important development practices were reinforced during this lesson:

  • Separate business logic into dedicated classes.
  • Keep database queries limited to the logged-in user.
  • Escape all displayed output using esc_html() and esc_url().
  • Prefer meaningful titles over internal database IDs.
  • Format monetary values for readability.
  • Test every incremental change before moving to the next step.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Why This Feature Matters

This lesson marks an important milestone for Flipnzee Auctions.

Until now, most development focused on the administrator’s workflow—creating auctions, recording bids, generating transactions, and managing activity logs.

Lesson 67 introduces the first dedicated buyer-facing dashboard, allowing users to monitor their purchases without administrator assistance.

As the platform grows, this dashboard can be expanded with payment history, downloadable invoices, escrow updates, transaction completion status, and buyer support tools.

Even in its current form, it provides a solid foundation for a professional auction marketplace and brings Flipnzee one step closer to a production-ready Version 1 release.

Lesson 67: Building the “My Purchases” Dashboard for Buyers


Overview

In the previous lessons, we completed the backend transaction workflow:

  • Auctions close automatically.
  • Winners are determined.
  • Transactions are created.
  • Administrators can manage transactions.
  • Administrators can inspect detailed transaction information.

However, buyers currently have no way to see the auctions they have won.

In this lesson, we will build the first user-facing transaction dashboard by introducing a My Purchases page.


Why This Lesson Matters

Imagine winning an auction on Flipnzee.com.

After placing the winning bid, you naturally expect to see:

  • What did I buy?
  • What was my winning bid?
  • Has the seller been notified?
  • Has payment been received?
  • Has the domain transfer started?

Without a buyer dashboard, users would need to contact support for every update.

The My Purchases page solves this problem.


Current Workflow

Auction

↓

Winner

↓

Transaction

↓

Administrator

New Workflow

Auction

↓

Winner

↓

Transaction

↓

Buyer Dashboard

What We’ll Build

A new shortcode:

[flipnzee_my_purchases]

When a logged-in buyer visits the page, they’ll see:

AuctionWinning BidStatusPurchased
PremiumDomain.com₹55,000Pending6 Jul 2026
ExampleSite.com₹25,000Paid3 Jul 2026

If the visitor is not logged in, they’ll see a friendly message asking them to sign in.


Files We’ll Modify

New

includes/class-my-purchases.php

Modify

flipnzee-auctions.php

Modify

includes/class-shortcodes.php

Reuse

includes/class-transaction-manager.php

Features

Step 1

Create the My Purchases class.


Step 2

Register the shortcode.


Step 3

Verify the user is logged in.


Step 4

Retrieve transactions where:

buyer_id = current_user_id()

Step 5

Display purchases in a WordPress table.


Step 6

Show:

  • Listing
  • Winning Bid
  • Status
  • Purchase Date

Step 7

Handle empty results gracefully.

Example:

You haven't purchased any auctions yet.

Expected Result

Logged-in buyers will see:

My Purchases

------------------------------------------------

Listing

PremiumDomain.com

Winning Bid

₹55,555

Status

Paid

Purchased

6 July 2026

------------------------------------------------

ExampleSite.com

Winning Bid

₹10,000

Status

Pending

Purchased

5 July 2026

Guests will see:

Please log in to view your purchases.

Future Enhancements

This page is intentionally designed to grow over time. Future lessons can extend it with:

  • View Transaction link
  • Escrow progress
  • Payment confirmation
  • Domain transfer status
  • Seller contact (when appropriate)
  • Transaction timeline
  • Download invoice
  • Email history

Skills You’ll Practice

  • WordPress shortcodes
  • User authentication
  • Current user retrieval
  • Database queries with prepared statements
  • Frontend table rendering
  • Secure output escaping
  • User dashboard design

Difficulty Level

Intermediate

This lesson introduces the first buyer-facing dashboard in the Flipnzee Auctions plugin. It connects the backend transaction system to the frontend, giving buyers immediate visibility into their purchases while establishing a reusable pattern for future user dashboards such as My Sales, My Auctions, and My Bids.


Why This Is the Right Next Step

From a marketplace perspective, this lesson provides immediate value to end users. Administrators already have the tools to manage auctions and transactions, but buyers need confidence that the platform is tracking their purchases. By introducing My Purchases, Flipnzee becomes more than an admin-managed auction system—it begins to function as a true online marketplace where users can monitor their own activity. This also lays the groundwork for future escrow updates, payment tracking, and ownership transfer notifications.

Lesson 66 Implementation: Building a Transaction Details Page for Completed Auctions

One of the biggest advantages of developing your own WordPress plugin is that you can continuously improve the user experience. In the previous lessons, the Flipnzee Auctions plugin was already creating transactions automatically after an auction ended and displaying them in a Transactions table. However, there was no way to inspect a transaction in detail.

In this lesson, a dedicated Transaction Details page was introduced. This page provides administrators with complete information about an individual auction transaction and lays the foundation for future features such as escrow management, payment verification, domain transfer tracking, and audit logs.


What We Built

Instead of only viewing a transaction inside a table, administrators can now click a View action to open a dedicated page displaying all transaction information.

Current information displayed includes:

  • Transaction ID
  • Auction ID
  • Listing ID
  • Seller ID
  • Buyer ID
  • Winning Bid
  • Transaction Status
  • Created Date
  • Updated Date

This provides a much cleaner workflow compared to searching through database records manually.


Step 1 – Creating the Transaction Details Admin Page

A new admin class was created:

admin/class-admin-transaction-details.php

This class is responsible for rendering the Transaction Details screen inside the WordPress admin dashboard.

Initially, the page only displayed a placeholder message while the routing and menu registration were tested.


Step 2 – Registering the Admin Page

The new page was registered inside the plugin’s admin menu.

Unlike normal menu pages, this page is hidden from the sidebar because it is accessed directly from the Transactions table using a URL similar to:

admin.php?page=flipnzee-transaction-details&transaction_id=2

This keeps the admin menu clean while still allowing administrators to access detailed information.


Step 3 – Loading Transaction Data

Inside the render_page() method, the transaction ID is safely retrieved using:

$transaction_id = isset( $_GET['transaction_id'] )
	? absint( $_GET['transaction_id'] )
	: 0;

Using absint() ensures only valid numeric IDs are accepted.

The transaction is then retrieved from the custom database table using a prepared SQL query.

This protects the plugin against SQL injection while ensuring the correct transaction is loaded.


Step 4 – Handling Invalid Transactions

Good plugins never assume that data always exists.

If an invalid transaction ID is supplied, the plugin now displays an error message instead of generating PHP warnings or fatal errors.

Example:

Transaction not found.

This small validation greatly improves the robustness of the plugin.


Step 5 – Displaying Transaction Information

After confirming that the transaction exists, the placeholder content was replaced with a professional information table.

The page now displays:

FieldDescription
IDInternal transaction ID
AuctionAuction record ID
ListingWordPress listing ID
SellerSeller user ID
BuyerBuyer user ID
Winning BidFinal auction amount
StatusCurrent transaction status
CreatedCreation timestamp
UpdatedLast update timestamp

This information is presented using a WordPress widefat striped table for a consistent admin experience.


Step 6 – Troubleshooting During Development

Like most real-world development sessions, implementation was not completely straightforward.

Several issues were encountered, including:

  • PHP parse errors caused by misplaced braces.
  • Accidental duplication of an if statement during copy-and-paste.
  • Mixed HTML and PHP tags while replacing placeholder content.
  • Leftover placeholder code causing unexpected output.
  • Additional syntax validation before uploading the plugin.

Each issue was resolved by:

  • Running PHP syntax checks:
php -l admin/class-admin-transaction-details.php
  • Carefully reviewing opening and closing braces.
  • Replacing only the affected code block instead of rewriting the entire file.
  • Testing after every small change.

This incremental debugging approach made it much easier to locate and resolve problems.


Final Result

The Flipnzee Auctions plugin now includes a dedicated Transaction Details page.

Administrators can:

  • Open a completed transaction
  • View all important transaction information
  • Verify buyer and seller IDs
  • Review the winning bid
  • Check the current transaction status
  • See creation and update timestamps

The page is now ready for future enhancements without requiring any structural redesign.


Why This Matters

Although this page currently displays basic information, it establishes the foundation for a complete transaction management system.

Future lessons can build upon this page by adding:

  • Buyer profile links
  • Seller profile links
  • Listing title instead of ID
  • Auction title
  • Escrow status
  • Payment history
  • Domain transfer progress
  • Shipping information (for physical products)
  • Internal administrator notes
  • Activity timeline
  • Email history
  • Downloadable invoices

Because the framework is already in place, adding these features will be much easier.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:


Lessons Learned

During this implementation, several important development practices were reinforced:

  • Build features incrementally rather than all at once.
  • Validate user input before querying the database.
  • Always use prepared SQL statements.
  • Check for missing records gracefully.
  • Run PHP syntax checks before uploading changes.
  • Test every modification immediately to catch errors early.
  • Use dedicated detail pages instead of overcrowding list tables.

Conclusion

Lesson 66 significantly improves the administrative experience of the Flipnzee Auctions plugin. Instead of viewing transactions only in a summary table, administrators can now inspect individual transactions on a dedicated page with all essential details.

More importantly, this page serves as the foundation for advanced transaction management features planned for future lessons, bringing the plugin another step closer to a production-ready auction platform.

Lesson 66: Building a Transaction Details Page for Flipnzee Auctions


Overview

In previous lessons, we built a complete transaction workflow:

  • Auctions close automatically.
  • Winners are determined.
  • Transactions are created automatically.
  • Administrators can view transactions.
  • Transaction statuses can be updated.

However, administrators still cannot inspect an individual transaction in detail.

In this lesson, we’ll build a dedicated Transaction Details page where administrators can view every aspect of a completed auction before moving on to escrow, payment, or ownership transfer.


What You Will Learn

In this lesson you will learn how to:

  • Create an admin details page.
  • Read a single transaction securely.
  • Display auction information.
  • Display buyer and seller information.
  • Display listing information.
  • Display winning bid information.
  • Display transaction timeline.
  • Prepare the page for escrow integration.

Why This Lesson Matters

Imagine receiving an email from a buyer asking:

“Has my payment been received?”

Currently an administrator would need to search several database tables.

Instead, we’ll provide a dedicated transaction page showing everything in one place.


Current Workflow

Auction

↓

Winner

↓

Transaction

↓

Transactions Table

New Workflow

Auction

↓

Winner

↓

Transaction

↓

Transactions Table

↓

Transaction Details

What We’ll Build

Each transaction will have a View action.

Example:

ID      Status

31      Pending

View

Clicking View opens:

Transaction #31

Auction
-----------------------------------
Auction ID
Listing
Winning Bid

Buyer
-----------------------------------
Username
Email

Seller
-----------------------------------
Username
Email

Status
-----------------------------------
Pending

Created

Last Updated

Files We’ll Modify

New

admin/class-admin-transaction-details.php

Modify

admin/class-admin-transactions.php

Modify

admin/class-transactions-table.php

Reuse

includes/class-transaction-manager.php

Features

Step 1

Create Transaction Details page.


Step 2

Register submenu page.


Step 3

Add View action.


Step 4

Load transaction.


Step 5

Display buyer details.


Step 6

Display seller details.


Step 7

Display auction details.


Step 8

Display transaction status.


Step 9

Display timestamps.


Step 10

Prepare escrow section placeholder.


Example Page

------------------------------------------------

Transaction #12

Status
Pending

-----------------------------------------------

Auction

Auction ID: 31

Listing:
PremiumDomain.com

Winning Bid:
₹55,555,609

-----------------------------------------------

Buyer

Username:
John

Email:
[email protected]

-----------------------------------------------

Seller

Username:
Rajeev

Email:
[email protected]

-----------------------------------------------

Created

2026-07-06 14:25

Updated

2026-07-06 14:31

------------------------------------------------

Future Escrow Section

The page will intentionally leave space for:

Escrow Provider

Payment Status

Escrow ID

Release Funds

Release Domain

Complete Transaction

These features will be implemented in later lessons without redesigning the page.


Skills You’ll Practice

  • WordPress admin pages
  • Secure URL parameters
  • Database lookups
  • WordPress user functions
  • Data presentation
  • Preparing for escrow integration
  • Clean admin UI design

Difficulty Level

Intermediate

This lesson combines custom admin pages, database retrieval, and structured data presentation. It also establishes the administrative workflow that will support escrow services, payment processing, and domain or website transfers in future lessons.


Final Thoughts

Lesson 66 marks another important milestone in the Flipnzee Auctions plugin. Instead of treating transactions as simple database records, administrators will be able to inspect every completed auction from a single screen. This improves usability, simplifies support, and creates the ideal foundation for integrating escrow providers, payment gateways, email notifications, and ownership transfer workflows as the plugin moves closer to powering live auctions on Flipnzee.com.

Lesson 65 Implementation: Adding Transaction Status Management to Flipnzee Auctions

After building the Transactions dashboard in the previous lesson, the next improvement was to make the transactions interactive. Instead of simply displaying transaction records, administrators should be able to manage the progress of each transaction as the auction moves through its post-sale lifecycle.

In this lesson, we implemented the foundation for transaction status management, allowing administrators to update transaction statuses securely from the WordPress admin area while recording every status change in the activity log.


Objective

The goal of this lesson was to transform the Transactions page from a read-only report into the beginning of a transaction management system.

Instead of every transaction remaining permanently in a Pending state, administrators can now move transactions through different stages.


Initial Workflow

Before this lesson, every completed auction produced a transaction like this:

TransactionStatus
#1Pending
#2Pending

Although transactions were stored correctly, there was no mechanism to update their progress.


Step 1 — Extend the Transaction Manager

The first task was adding a reusable method responsible for updating transaction status.

File modified:

includes/class-transaction-manager.php

Method added:

/**
 * Update a transaction status.
 *
 * @param int    $transaction_id Transaction ID.
 * @param string $status         New status.
 * @return bool
 */
public static function update_status(
	$transaction_id,
	$status
) {

	global $wpdb;

	$table = $wpdb->prefix . 'flipnzee_transactions';

	$updated = $wpdb->update(
		$table,
		array(
			'status' => sanitize_text_field( $status ),
		),
		array(
			'id' => absint( $transaction_id ),
		),
		array(
			'%s',
		),
		array(
			'%d',
		)
	);

	if ( class_exists( 'Flipnzee_Activity_Log' ) ) {

		Flipnzee_Activity_Log::log(
			'transaction_status_updated',
			0,
			get_current_user_id(),
			sprintf(
				'Transaction #%d marked as %s.',
				$transaction_id,
				$status
			)
		);
	}

	return false !== $updated;
}

This method centralizes all transaction status updates in one location.


Step 2 — Register an Admin Action

To process status changes securely, a new WordPress admin action was registered.

File modified:

flipnzee-auctions.php

Code added:

add_action(
	'admin_post_flipnzee_update_transaction_status',
	array(
		'Flipnzee_Transaction_Manager',
		'handle_status_update',
	)
);

This allows WordPress to execute a custom handler whenever an administrator clicks a transaction action link.


Step 3 — Handle Status Updates Securely

Next, a dedicated handler method was implemented.

public static function handle_status_update() {

	if ( ! current_user_can( 'manage_options' ) ) {
		wp_die( 'Permission denied.' );
	}

	check_admin_referer(
		'flipnzee_update_transaction'
	);

	$transaction_id = isset( $_GET['transaction_id'] )
		? absint( $_GET['transaction_id'] )
		: 0;

	$status = isset( $_GET['status'] )
		? sanitize_text_field(
			wp_unslash( $_GET['status'] )
		)
		: '';

	if ( $transaction_id && $status ) {

		self::update_status(
			$transaction_id,
			$status
		);
	}

	wp_safe_redirect(
		admin_url(
			'admin.php?page=flipnzee-transactions'
		)
	);

	exit;
}

The handler performs several important tasks:

  • verifies administrator permissions,
  • validates the WordPress nonce,
  • sanitizes user input,
  • updates the transaction,
  • redirects back to the Transactions page.

Step 4 — Add Status Action Links

The Transactions table was enhanced by creating a custom renderer for the Status column.

File modified:

admin/class-transactions-table.php

Method added:

public function column_status( $item ) {

	$status = esc_html( ucfirst( $item['status'] ) );

	$actions = array();

	if ( 'pending' === $item['status'] ) {

		$url = wp_nonce_url(
			admin_url(
				'admin-post.php?action=flipnzee_update_transaction_status'
				. '&transaction_id=' . $item['id']
				. '&status=paid'
			),
			'flipnzee_update_transaction'
		);

		$actions['paid'] =
			'<a href="' . esc_url( $url ) . '">Mark Paid</a>';

	} elseif ( 'paid' === $item['status'] ) {

		$url = wp_nonce_url(
			admin_url(
				'admin-post.php?action=flipnzee_update_transaction_status'
				. '&transaction_id=' . $item['id']
				. '&status=completed'
			),
			'flipnzee_update_transaction'
		);

		$actions['completed'] =
			'<a href="' . esc_url( $url ) . '">Mark Completed</a>';
	}

	return sprintf(
		'%1$s %2$s',
		$status,
		$this->row_actions( $actions )
	);
}

This introduces workflow-oriented actions directly into the Transactions page.


Step 5 — Testing the Workflow

After uploading the updated plugin, several scenarios were tested.

Successful observations included:

  • Transaction status changed from Pending to Paid.
  • The database updated correctly.
  • The Activity Log recorded the status change.
  • Administrators were redirected back to the Transactions page after the update.

This confirmed that the backend workflow was functioning as intended.


Challenges Encountered

During implementation, several issues arose that provided valuable learning opportunities.

Duplicate Methods

While extending the Transaction Manager, a duplicate update_status() method was accidentally created, resulting in a fatal PHP error. Removing the duplicate resolved the issue and reinforced the importance of keeping classes organized.

PHP Syntax Errors

While adding new methods, braces were temporarily misplaced, causing syntax errors. Incremental syntax checking with:

php -l includes/class-transaction-manager.php

helped identify and correct these mistakes before deployment.

Transactions Table Rendering

The custom Transactions table successfully displayed transaction data and action links. Status updates from Pending to Paid worked correctly, and the database reflected the changes. However, the “Mark Completed” action did not appear after a transaction entered the Paid state.

This did not affect the underlying transaction workflow or status updates, but highlighted a rendering issue within the current WP_List_Table implementation. Since the core transaction management functionality was already operational, further refinement of the table interface was deferred to a future lesson focused on polishing the admin experience.


Lessons Learned

This lesson demonstrated several important WordPress development practices:

  • Separate business logic from user interface rendering.
  • Protect administrative actions with nonces.
  • Verify user capabilities before processing requests.
  • Centralize database updates inside dedicated manager classes.
  • Record important business events in an activity log.
  • Test functionality incrementally after every major change.

Download Source Code

Download the starting version of the plugin before the lesson:

Download the completed version after this lesson:

Final Outcome

By the end of Lesson 65, the Flipnzee Auctions plugin evolved beyond simply storing transactions. Administrators can now begin managing the transaction lifecycle by updating statuses securely through the WordPress admin interface. Although some interface refinements remain for future lessons, the underlying architecture for transaction status management is now in place.

This implementation provides a solid foundation for the next phase of development, where transaction status changes will be connected to buyer and seller notifications, escrow integration, payment workflows, and ownership transfer processes, bringing the plugin closer to supporting real-world online auctions on Flipnzee.com.