Lesson 126: Preparing Escrow.com API Credentials and Environment Configuration

Overview

In Lesson 125, Flipnzee Auctions introduced a dedicated Escrow API Client that separates API communication from the rest of the auction workflow. The client currently operates entirely in simulation mode, allowing the plugin to behave like a production system without contacting Escrow.com’s servers.

The next step is to prepare the plugin for real-world integration by introducing configurable API credentials and environment settings.

Rather than hardcoding URLs, usernames, or API keys into the source code, professional software stores these values in a secure configuration interface. This lesson lays that foundation.


Why This Lesson Matters

A production plugin should never contain credentials inside PHP files.

Instead, administrators should be able to configure:

  • Escrow Environment
  • Sandbox credentials
  • Live credentials
  • API username
  • API key
  • Enable/Disable simulation mode

This makes the plugin:

  • safer
  • easier to deploy
  • easier to migrate
  • suitable for multiple environments

Objectives

During this lesson we will:

  • create an Escrow Settings page
  • register plugin options
  • securely store credentials in WordPress options
  • allow Sandbox vs Live selection
  • update the API Client to read configuration instead of hardcoded values
  • continue operating in simulation mode by default

No live API requests will be made yet.


What Will Be Added

A new administration page:

Flipnzee Auctions
    └── Escrow Settings

It will contain fields such as:

  • Environment
Simulation
Sandbox
Production
  • Sandbox API Username
  • Sandbox API Key
  • Live API Username
  • Live API Key
  • Enable Debug Logging

Simulation Remains the Default

Even after credentials are introduced, the plugin will continue using simulation mode.

This is intentional.

The goal is to verify:

  • settings storage
  • configuration loading
  • environment switching

before sending any real HTTP requests.


Updating the API Client

Currently the API client contains values similar to:

const SANDBOX_URL = 'https://api.escrow-sandbox.com/2017-09-01';
const LIVE_URL    = 'https://api.escrow.com/2017-09-01';

After this lesson it will also retrieve:

  • username
  • API key
  • environment
  • simulation flag

from the plugin settings instead of hardcoded values.

This means future lessons can switch between Simulation, Sandbox, and Production without changing any PHP code.


Benefits

After Lesson 126 the Escrow subsystem becomes much more flexible.

Instead of editing source files, administrators will simply configure credentials through WordPress.

The API Client becomes environment-aware while remaining completely isolated from the rest of the payment workflow.

This mirrors how mature commercial plugins manage third-party integrations.


Looking Ahead

Lesson 126 prepares the configuration layer.

The next lessons will build on it:

  • Lesson 127 – Sending the First Real HTTP Request Using the WordPress HTTP API (initially to a safe endpoint or authentication check).
  • Lesson 128 – Creating Live Escrow Sandbox Transactions.
  • Lesson 129 – Synchronizing Transaction Status from Escrow.com.
  • Lesson 130 – Automatic Status Updates and Administrative Monitoring.

Conclusion

Lesson 126 moves Flipnzee Auctions another step toward production readiness by introducing configurable Escrow.com settings. Although the plugin continues to operate in simulation mode, the underlying architecture is now prepared to support Sandbox and Production environments without modifying the source code. This configuration-first approach improves security, simplifies deployment, nd provides a stable foundation for live API communication in the lessons that follow.

Lesson 125: Building an Escrow API Client Architecture for Future Live Integration

One of the biggest goals of Flipnzee Auctions has always been to support a professional transaction workflow for buying and selling websites. While previous lessons introduced the External Provider Manager and simulated Escrow transactions, the plugin was still tightly coupled to a single provider implementation.

In this lesson, the architecture takes an important step forward by introducing a dedicated Escrow API Client. Although it currently operates in simulation mode, it establishes the same separation of responsibilities used by production software and prepares the plugin for future communication with the live Escrow.com REST API.


Why Introduce an API Client?

Earlier lessons allowed the Escrow Provider to simulate transaction creation directly. While functional, that approach meant the provider class was responsible for both business logic and external communication.

As the project grows, this becomes increasingly difficult to maintain.

By introducing an API client, responsibilities become much clearer:

  • Escrow Provider
    • Handles auction payment workflow.
    • Decides when an escrow transaction should be created.
    • Stores provider information in the database.
  • Escrow API Client
    • Handles all communication with Escrow.com.
    • Manages API endpoints.
    • Prepares authentication.
    • Builds request payloads.
    • Parses API responses.

This separation makes each component easier to understand, test and replace.


Studying the Escrow.com API

Before writing any code, the official Escrow.com developer documentation was reviewed to understand how their software works.

The research focused on:

  • Sandbox environment
  • Live API endpoint
  • REST request structure
  • Authentication model
  • Transaction lifecycle
  • Status values
  • Buyer and seller roles

Rather than attempting to integrate every feature immediately, the goal of Lesson 125 is to establish the architecture that future lessons will expand.


Creating the Escrow API Client

A new class was introduced:

includes/class-escrow-api-client.php

This class becomes the single location responsible for interacting with Escrow.com.

Instead of allowing multiple classes to communicate directly with the API, every request will eventually pass through this client.

The class currently contains:

  • Sandbox endpoint
  • Live endpoint
  • API version
  • Simulation mode
  • Transaction creation method

Although responses are simulated today, replacing them with real HTTP requests later will require minimal changes elsewhere in the plugin.


Simulation Mode

During development it is undesirable to create real escrow transactions.

Instead, the client currently returns realistic responses such as:

  • success
  • provider reference
  • status
  • timestamps

This allows every surrounding component to behave exactly as it would during a live transaction without contacting the Escrow.com servers.


Refactoring the Escrow Provider

The existing provider no longer creates references itself.

Instead it now delegates that responsibility:

Escrow Provider
        ↓
Escrow API Client
        ↓
Response
        ↓
External Provider Manager

The provider now simply:

  1. Creates the API client.
  2. Requests a transaction.
  3. Receives the response.
  4. Stores provider details.
  5. Returns the reference.

This greatly reduces complexity inside the provider.


Provider Persistence

After receiving the simulated response, the provider stores:

  • Transaction ID
  • Provider name
  • Escrow reference
  • Provider status
  • Notes
  • Created date
  • Updated date

using the existing External Provider Manager introduced in previous lessons.

This ensures the transaction history remains identical whether responses originate from simulation mode or the live API in future versions.


Logging Improvements

Additional logging was added throughout the workflow.

Typical log output now resembles:

FLIPNZEE ESCROW: Starting escrow transaction...
FLIPNZEE API CLIENT: Simulation mode enabled.
FLIPNZEE API CLIENT: Returning simulated response.
FLIPNZEE EXTERNAL PROVIDER INSERT SUCCEEDED
FLIPNZEE ESCROW: Provider record created.
FLIPNZEE ESCROW: Escrow reference created.

These logs provide a complete picture of the transaction lifecycle and make debugging considerably easier.


Benefits of This Architecture

Introducing the API client provides several advantages:

  • Cleaner separation of responsibilities.
  • Easier testing.
  • Simpler debugging.
  • Reduced coupling.
  • Future API integration requires minimal changes.
  • Other payment providers can adopt the same pattern.

Most importantly, the remainder of the plugin no longer needs to know whether responses come from simulation mode or from the real Escrow.com servers.


Looking Ahead

With the architecture now in place, the plugin is ready to move beyond simulation.

Future lessons will focus on:

  • API authentication
  • Secure credential storage
  • Real HTTP requests using the WordPress HTTP API
  • Creating live Escrow.com transactions
  • Synchronizing provider status
  • Automatic transaction updates
  • Webhook support where available
  • Improved administrative monitoring

By establishing the API client first, these enhancements can be introduced incrementally without rewriting the payment workflow.


Conclusion

Lesson 125 represents an important architectural milestone for Flipnzee Auctions. Rather than jumping directly into live API integration, the plugin now adopts a layered design that separates business logic from external communication. This makes the codebase easier to maintain, easier to test, and well positioned for future integration with the Escrow.com REST API while preserving the existing transaction workflow.

https://github.com/SplendidDigital/flipnzee-auctions/releases/tag/lesson-125-stable

Lesson 125: Designing the Escrow.com Integration Architecture


Overview

With the transaction management workflow now established, the next objective is to replace the simulated Escrow provider with a production-ready integration.

Rather than treating Escrow.com as simply another payment gateway, Flipnzee Auctions will use it as the central transaction platform responsible for securely managing website sales between buyers and sellers.

This lesson focuses on designing that integration before implementing live API communication.


Why Escrow.com?

Unlike Stripe or PayPal, Escrow.com is designed for high-value transactions where assets are transferred after payment conditions have been satisfied.

Website and domain sales fit this model almost perfectly.

The buyer wants assurance that ownership will be transferred.

The seller wants assurance that payment has been secured.

Escrow.com acts as the trusted intermediary throughout that process. (escrow.com)


Current Plugin Workflow

Today the plugin works like this:

Auction Ends

↓

Transaction Created

↓

Payment Completed

↓

Ownership Transfer

↓

Transaction Closed

This is ideal for simulation, but it doesn’t yet involve Escrow.com.


Future Workflow

With API integration the workflow becomes:

Auction Ends

↓

Flipnzee Creates Transaction

↓

Escrow.com Transaction Created

↓

Buyer Agrees

↓

Buyer Funds Escrow

↓

Escrow Confirms Funds

↓

Seller Transfers Website

↓

Buyer Accepts Website

↓

Escrow Releases Funds

↓

Transaction Completed

The Flipnzee plugin becomes the orchestration layer, while Escrow.com manages the escrow lifecycle. (escrow.com)


Components We Will Build

The architecture will evolve as follows:

Flipnzee Auctions

│

├── Auction Manager

├── Transaction Manager

├── Payment Manager

├── External Provider Manager

│

└── Escrow Provider

        │

        ▼

Escrow API Client

        │

        ▼

Escrow.com REST API

The existing Flipnzee_Escrow_Provider becomes responsible for communicating with the live API instead of generating simulated references.


API Responsibilities

The Escrow API Client will eventually support operations such as:

  • Create Escrow transaction
  • Retrieve transaction details
  • Synchronize provider status
  • Generate agreement links
  • Monitor funding status
  • Track inspection periods
  • Detect completion
  • Detect cancellation
  • Record disputes

This logic will remain isolated from the rest of the plugin.


Mapping Plugin Data

Most of the information required by Escrow.com already exists inside Flipnzee Auctions.

FlipnzeeEscrow.com
AuctionTransaction
ListingItem
BuyerBuyer
SellerSeller
Winning BidAmount
Transaction IDReference
Ownership TransferInspection & Acceptance

Very little additional data will be required.


Website Sales as Milestone Transactions

One particularly interesting discovery is that Escrow.com recommends Milestone Transactions for services and website/domain sales involving staged delivery. This maps well to your plugin because ownership transfer already has multiple steps that can be represented as milestones rather than a single “completed” event. (escrow.com)

A future transaction could look like:

Payment Funded

↓

Website Files Delivered

↓

Database Delivered

↓

Domain Transferred

↓

Buyer Verification

↓

Escrow Releases Funds

Your existing Ownership Transfer feature already provides the beginnings of this model.


Keeping Responsibilities Separate

One design principle remains unchanged:

  • Transaction Manager manages marketplace transactions.
  • External Provider Manager stores provider records.
  • Escrow Provider communicates with Escrow.com.
  • Escrow API Client performs HTTP requests.

Each class retains a single responsibility, making the integration easier to maintain and test.


Immediate Goal

The next implementation lessons will focus on introducing a dedicated API client and configuration rather than making live requests immediately.

A sensible progression would be:

  • Lesson 126 — Build an Escrow_API_Client class (authentication, HTTP abstraction, sandbox support).
  • Lesson 127 — Add Escrow API settings (API key, email, sandbox/live mode).
  • Lesson 128 — Create live transactions from Flipnzee Auctions.
  • Lesson 129 — Synchronize transaction status from Escrow.com.
  • Lesson 130 — Handle agreement links, funding, and milestone updates.

This staged approach lets us test each layer independently before enabling real financial transactions.


One recommendation

I also noticed from your screenshot that you’re already using Escrow.com “Buy It Now” and “Make an Offer” buttons on your listings. That’s a smart transitional solution because it gives buyers a trusted path today while the plugin evolves.

When the API integration is complete, those external buttons can be replaced by plugin-driven actions:

  • Buy with Escrow
  • Make Offer
  • Proceed to Escrow

These buttons would create and manage Escrow.com transactions automatically while keeping the user inside the Flipnzee workflow until it’s time to complete the secure escrow process. That will make Flipnzee feel like a complete marketplace rather than a site that links out to Escrow.com.

Lesson 124: Improving the Transaction Details Interface with a Transaction Summary

As the Flipnzee Auctions plugin continues to mature, the administrative interface has become just as important as the underlying business logic. Administrators need to review payment information, monitor external providers, and coordinate ownership transfers efficiently. Presenting this information in a clear and organized manner is therefore essential.

In this lesson, the focus shifted away from backend functionality and towards improving the usability of the Transaction Details page. Rather than introducing new transaction processing logic, the goal was to make existing information easier to understand and manage.


Why This Change Was Needed

By previous lessons, the Transaction Details page had already become the operational center for completed auctions. It included:

  • Payment Management
  • External Provider information
  • Ownership Transfer progress

Although all the required information was available, administrators had to scroll through multiple sections before gaining an overall understanding of a transaction.

This lesson introduces a dedicated Transaction Summary section that presents the most important information immediately upon opening the page.


Objectives

The objectives for Lesson 124 were to:

  • Improve the administrator experience.
  • Introduce a high-level transaction overview.
  • Reduce unnecessary scrolling.
  • Organize information more logically.
  • Prepare the interface for future enhancements.

Adding a Transaction Summary

The most visible enhancement in this lesson is the addition of a Transaction Summary card positioned at the top of the page.

The summary consolidates commonly referenced information into a single table, including:

  • Transaction ID
  • Auction ID
  • Listing ID
  • Seller
  • Buyer
  • Winning Bid
  • Payment Status
  • Payment Gateway
  • Creation Date
  • Last Updated

Instead of navigating between multiple sections, administrators can now understand the overall transaction at a glance.


Improving Page Hierarchy

The page now follows a more logical workflow:

Transaction Summary

↓

Payment Management

↓

External Provider

↓

Ownership Transfer

This ordering reflects the natural lifecycle of an auction transaction, making the interface easier to navigate.


Preserving Existing Business Logic

An important design decision during this lesson was to improve the presentation layer without modifying the underlying transaction workflow.

No changes were made to:

  • Payment processing
  • External Provider Manager
  • Escrow Provider integration
  • Ownership Transfer logic
  • Database schema
  • Transaction processing

Only the user interface was enhanced.

This separation between presentation and business logic reduces implementation risk while making the codebase easier to maintain.


Better Administrative Experience

With the addition of the summary section, administrators no longer need to search through multiple forms to locate basic transaction details.

Typical workflow:

Open Transaction

↓

Review Summary

↓

Update Payment Status

↓

Review Provider Information

↓

Continue Ownership Transfer

The page now better supports the day-to-day management of completed auctions.


Preparing for Future Features

The new Transaction Summary also provides a natural location for additional information that will be introduced in later lessons, including:

  • Provider synchronization status
  • Transaction activity timeline
  • Escrow synchronization timestamp
  • Buyer and seller notifications
  • Digital asset transfer progress
  • Transaction reports

By introducing the summary first, these future enhancements can be integrated without redesigning the page structure again.


Lessons Learned

This lesson demonstrates that improving software is not always about adding new functionality.

A well-organized interface can significantly improve administrator productivity without requiring changes to the underlying business logic.

Separating presentation from application logic also makes future development safer and easier, allowing interface improvements to be implemented independently of transaction processing.


Conclusion

Lesson 124 focused on enhancing the usability of the Transaction Details page by introducing a Transaction Summary and improving the overall page organization. While the plugin’s core transaction workflow remained unchanged, administrators now have a clearer, more structured overview of each completed auction.

With a stronger administrative foundation now in place, the Flipnzee Auctions plugin is well positioned for the next phase of development, where attention will return to functional enhancements such as transaction activity tracking, provider synchronization, and deeper Escrow integration.

https://github.com/SplendidDigital/flipnzee-auctions/releases/tag/lesson-124-stable

Lesson 124: Improving Transaction Navigation and User Experience


Overview

As the Flipnzee Auctions plugin has evolved, the transaction management interface has become significantly more capable. Administrators can now manage payments, monitor ownership transfers, and inspect external provider information from a single screen.

However, one aspect of the user experience can still be improved.

The Transaction Details page currently exists as a standalone administration page, even though it is only meaningful when viewing a specific transaction. This creates unnecessary clutter in the WordPress administration menu and makes navigation less intuitive.

In this lesson, we will refine the transaction management workflow by improving navigation and aligning the plugin more closely with common WordPress administration patterns.


Why Improve Navigation?

The Transaction Details screen represents a detail view, not a destination in its own right.

Administrators typically follow this workflow:

Transactions

        │

        ▼

Select Transaction

        │

        ▼

Transaction Details

        │

        ▼

Payment Management

        │

        ▼

External Provider

        │

        ▼

Ownership Transfer

The page should therefore be accessed from the Transactions list rather than appearing as a permanent menu item.


Objectives

By the end of this lesson we will:

  • Hide the Transaction Details page from the WordPress sidebar.
  • Continue allowing direct access through secure admin URLs.
  • Improve navigation between the Transactions list and individual transactions.
  • Add contextual navigation for administrators.
  • Prepare the interface for future transaction actions.

Current Navigation

Today the administrator sees:

Flipnzee Auctions

Dashboard

Add Auction

Auctions

Payments

Transactions

Transaction Details

Settings

The final item is only useful when a specific transaction has been selected.


Desired Navigation

After this lesson the administration menu becomes:

Flipnzee Auctions

Dashboard

Add Auction

Auctions

Payments

Transactions

Settings

The Transaction Details page still exists, but it becomes a hidden administrative page accessed only when needed.


Improved Workflow

Instead of manually navigating to Transaction Details, the administrator simply clicks View from the Transactions list.

The flow becomes:

Transactions

        │

        ▼

View Transaction

        │

        ▼

Transaction Details

        │

        ├── Payment

        ├── External Provider

        └── Ownership Transfer

This mirrors the user experience provided by many established WordPress plugins.


Contextual Navigation

To make navigation clearer, the Transaction Details page will also introduce contextual controls such as:

← Back to Transactions

and a simple breadcrumb:

Transactions
        >
Transaction #34

These additions help administrators understand where they are within the transaction management workflow.


Architectural Benefits

This lesson is primarily about user experience rather than backend functionality, but it still reinforces good architectural principles.

The page hierarchy becomes:

Transactions

        │

        ▼

Transaction Details

        │

        ├── Payment Management

        ├── External Provider

        └── Ownership Transfer

Each screen now has a clear responsibility.


Future Expansion

This refined navigation also prepares the interface for future transaction actions, including:

  • Refresh Provider Status
  • View Activity History
  • Retry Provider Synchronization
  • Open Escrow Dashboard
  • Generate Transaction Report
  • Archive Completed Transaction

These features will naturally belong within the Transaction Details page rather than cluttering the main Transactions list.


Benefits

Completing this lesson provides several improvements:

  • Cleaner WordPress administration menu.
  • Better navigation between list and detail views.
  • Improved administrator workflow.
  • More intuitive transaction management.
  • Better alignment with WordPress administration conventions.
  • A stronger foundation for future transaction management features.

Looking Ahead

With the transaction workflow becoming easier to navigate, future lessons can focus on enriching the transaction experience rather than reorganizing it.

Upcoming work may include:

  • Provider status synchronization.
  • Transaction activity timelines.
  • Administrator action buttons.
  • Escrow API integration.
  • Automated provider updates.
  • Transaction reporting.

By refining the navigation before introducing these capabilities, the Flipnzee Auctions plugin continues its progression from a collection of independent management pages toward a cohesive, production-ready marketplace administration system.

Lesson 123: Displaying External Provider Information in the Transaction Details Screen

In the previous lesson, the Flipnzee Auctions plugin introduced persistent storage for external provider transactions. Whenever a payment reached the completed stage, the Escrow provider generated a provider reference and stored important information such as provider status, timestamps, and notes within a dedicated database table.

Although this information was now permanently stored, it was only accessible by inspecting the database directly.

In this lesson, that changes.

The Transaction Details page is enhanced to display external provider information directly within the WordPress administration area, giving administrators immediate visibility into the provider responsible for processing a transaction.


Why Display Provider Information?

Once a website sale enters the payment stage, the auction transaction is no longer the only entity involved.

An external provider—such as Escrow.com in our simulated implementation—maintains its own transaction lifecycle.

Administrators frequently need answers to questions such as:

  • Which provider is handling this transaction?
  • What is the provider reference number?
  • Has the provider transaction been created?
  • What is the current provider status?
  • Are there any provider notes?

Without displaying this information inside WordPress, administrators must inspect database records manually, making day-to-day transaction management unnecessarily difficult.


Bringing the Provider Layer into the User Interface

The Transaction Details screen now retrieves provider information using the External Provider Manager rather than performing direct database queries.

The page requests the provider record associated with the current transaction and displays the information in a dedicated section beneath Payment Management.

Conceptually, the flow now looks like this:

Transaction Details
        │
        ▼
External Provider Manager
        │
        ▼
Latest Provider Record
        │
        ▼
Display Provider Information

This preserves the plugin’s object-oriented architecture by separating presentation logic from data access.


Information Displayed

The new External Provider section includes:

  • Provider name
  • Provider reference
  • Current provider status
  • Started timestamp
  • Completed timestamp
  • Provider notes

A typical provider record appears as follows:

FieldExample
ProviderEscrow.com
ReferenceESCROW-20260724010512-34
StatusCreated
Started2026-07-24 06:35:12
Completed
NotesSimulated escrow transaction created.

This allows administrators to monitor provider activity without leaving the WordPress dashboard.


Graceful Handling of Missing Provider Records

Not every transaction will necessarily have an associated provider.

For example:

  • Historical transactions created before provider persistence was introduced.
  • Transactions that have not yet reached the payment completion stage.
  • Future transactions using alternative payment methods.

Instead of generating errors or displaying incomplete information, the page now detects the absence of a provider record and displays a clear message indicating that no provider information is available.

This improves both usability and robustness.


Maintaining Separation of Responsibilities

One of the primary objectives of the refactoring effort has been reducing coupling between components.

The Transaction Details page now communicates exclusively with the Flipnzee_External_Provider_Manager.

Responsibilities are clearly divided:

  • Escrow Provider creates provider records.
  • External Provider Manager retrieves provider information.
  • Transaction Details presents the information.
  • Transaction Lifecycle Manager coordinates the overall workflow.

Each component remains responsible for a single concern, making the codebase easier to understand, maintain, and extend.


Improving Administrative Visibility

The addition of provider information significantly improves the administrative workflow.

An administrator reviewing a completed transaction can now immediately determine:

  • Which provider created the transaction.
  • The external provider reference.
  • The provider’s current status.
  • When the provider transaction started.
  • Whether additional provider information has been recorded.

This reduces reliance on database inspection while providing a clearer operational overview of website sales.


Preparing for Future Integrations

Although the current provider implementation continues to simulate Escrow.com, the user interface has now been designed with future integrations in mind.

When a live Escrow.com API is introduced, the same section can display:

  • Live provider status.
  • Escrow milestones.
  • Buyer and seller verification.
  • Payment confirmation.
  • Domain transfer progress.
  • Provider synchronization timestamps.

Because the display layer is already connected to the provider abstraction rather than the provider implementation, future integrations can be introduced with minimal changes to the administration interface.


Benefits of This Lesson

The improvements introduced in this lesson provide several practical advantages:

  • External provider information is available directly within WordPress.
  • Administrators no longer need to inspect the database for provider details.
  • The transaction management interface becomes more informative.
  • Presentation logic remains independent from database operations.
  • The architecture remains fully extensible for future payment and escrow providers.

Most importantly, the Transaction Details page now serves as a unified view of the complete website sale process, combining auction information, payment management, ownership transfer, and external provider details in a single location.


Looking Ahead

Displaying provider information is only the first step toward comprehensive provider management.

Future lessons will continue building upon this foundation by introducing:

  • Improved transaction navigation.
  • Enhanced provider user interface components.
  • Provider status synchronization.
  • External API communication.
  • Webhook processing.
  • Live Escrow.com integration.

With external provider information now visible alongside payment and ownership transfer details, the Flipnzee Auctions plugin takes another significant step toward becoming a complete transaction management platform for buying and selling websites.

https://github.com/SplendidDigital/flipnzee-auctions/releases/tag/lesson-123-stable

Lesson 123: Displaying External Provider Information in the Transaction Details Screen


Overview

In the previous lesson, we introduced persistent storage for external provider transactions. Every completed payment now creates a provider record containing the provider name, escrow reference, timestamps, status, and notes.

However, this information is only available by directly inspecting the database.

In this lesson, we’ll integrate the External Provider Manager with the WordPress administration interface so administrators can view provider information directly from the Transaction Details page.

This represents an important shift from building backend infrastructure to exposing meaningful operational information through the plugin’s user interface.


Why this lesson?

At the moment, an administrator managing a website sale has no immediate visibility into the external provider handling the transaction.

To answer questions such as:

  • Which provider is managing this payment?
  • What is the escrow reference?
  • Has the provider transaction been created?
  • What status is the provider reporting?
  • Were any notes recorded?

the administrator must manually inspect the database.

The goal of this lesson is to eliminate that requirement.


Objectives

By the end of this lesson we will:

  • Retrieve provider information using Flipnzee_External_Provider_Manager
  • Associate provider records with auction transactions
  • Display provider details inside the Transaction Details page
  • Gracefully handle transactions without a provider record
  • Lay the foundation for future provider actions and status synchronization

Planned Interface

The Transaction Details page will gain a new section similar to:

──────────────────────────────────────────
External Provider
──────────────────────────────────────────

Provider
Escrow.com

Reference
ESCROW-20260724010512-34

Status
Created

Started
24 Jul 2026 06:35

Completed
—

Notes
Simulated escrow transaction created.

If no provider record exists, the interface will instead display:

External Provider

No provider information is available for this transaction.

This ensures the interface remains informative without producing errors for historical transactions.


Architectural Improvements

Rather than querying the database directly from the admin screen, the page will use:

Flipnzee_External_Provider_Manager::get_provider_by_transaction()

This maintains a clear separation of responsibilities:

  • External Provider Manager retrieves provider data.
  • Admin Transaction Details focuses solely on presentation.
  • Escrow Provider remains responsible for provider creation.
  • Transaction Lifecycle Manager continues orchestrating the workflow.

This follows the object-oriented architecture established throughout the project.


Benefits

After completing this lesson:

  • Administrators can inspect provider information without leaving WordPress.
  • Transaction debugging becomes significantly easier.
  • Escrow references become immediately accessible.
  • Provider status is visible during transaction processing.
  • The UI becomes ready for future actions such as “Open Escrow Transaction”, “Refresh Provider Status”, or “Retry Provider Synchronization”.

What We’ll Build

The implementation will involve three primary steps:

  1. Retrieve provider information for the current transaction.
  2. Add a dedicated External Provider panel to the Transaction Details page.
  3. Display provider fields using WordPress admin styling and proper escaping.

No database changes are required, as the persistence layer introduced in Lesson 122 already provides everything needed.


Looking Ahead

Displaying provider information is only the first step toward a fully integrated provider management system.

Future lessons will build on this interface by allowing administrators to:

  • Synchronize provider status with external services.
  • View provider history.
  • Launch provider-specific actions.
  • Integrate with the real Escrow.com API.
  • Support multiple external payment and escrow providers through the same abstraction layer.

With provider information now visible inside the administration interface, the Flipnzee Auctions plugin moves one step closer to providing a complete transaction management experience for buying and selling websites.

Lesson 122: Persisting External Provider Transactions for Future Escrow Integration

One of the goals of the Flipnzee Auctions project is to build a transaction system that can eventually integrate with multiple payment and escrow providers without requiring major architectural changes. While previous lessons introduced a simulated Escrow.com provider and an event-driven transaction lifecycle, provider information existed only temporarily during execution.

In this lesson, that changes.

Instead of simply generating a simulated escrow reference and returning it to the caller, the plugin now persists provider information in a dedicated database table. This transforms the provider layer from a simple simulation into a permanent part of the transaction history and prepares the architecture for future integration with real external services.


Why Persist Provider Information?

During a real website sale, the auction transaction is only one part of the process. Once payment is initiated through an external provider such as Escrow.com, additional information must be tracked independently of the auction itself.

Examples include:

  • External provider name
  • Provider transaction reference
  • Provider status
  • Processing timestamps
  • Notes and audit information

Without persistent storage, all of this information would be lost once the request finishes.


Existing Provider Infrastructure

Earlier lessons already introduced a dedicated database table for external providers.

This lesson focuses on using that infrastructure rather than redesigning it.

Each provider record is linked to a Flipnzee transaction while maintaining its own independent lifecycle.

This separation keeps the auction system independent from the implementation details of any individual payment provider.


Enhancing the Escrow Provider

The simulated Escrow provider has been significantly expanded.

Instead of only generating an escrow reference, it now performs a complete provider workflow:

  1. Starts the provider transaction.
  2. Generates a unique simulated escrow reference.
  3. Creates a persistent provider record.
  4. Records timestamps and status.
  5. Returns the generated reference to the transaction lifecycle.

Conceptually, the workflow now looks like this:

Payment Completed
        │
        ▼
Transaction Lifecycle Manager
        │
        ▼
Escrow Provider
        │
        ├── Generate Escrow Reference
        ├── Create Provider Record
        ├── Store Status
        ├── Store Notes
        └── Return Reference

Persistent Provider Records

Every completed payment now creates a record similar to:

FieldExample
Transaction ID34
ProviderEscrow.com
Provider ReferenceESCROW-20260724010512-34
Statuscreated
Started At2026-07-24 06:35
Completed AtNULL
NotesSimulated escrow transaction created.

Unlike previous lessons, this information now survives beyond the lifetime of the PHP request and becomes part of the permanent transaction history.


The Role of the External Provider Manager

The Flipnzee_External_Provider_Manager acts as the persistence layer between business logic and the database.

Its responsibilities include:

  • Creating provider records
  • Retrieving provider information
  • Updating provider status
  • Looking up providers by transaction
  • Removing provider records if necessary

By centralizing these operations, the Escrow provider no longer communicates directly with the database.

This follows the same architectural principle used throughout the plugin, where managers coordinate data access while providers focus on provider-specific behaviour.


Improved Logging

The provider workflow now produces much more meaningful debug output.

Typical logs now include messages such as:

FLIPNZEE ESCROW: Starting escrow transaction for transaction #34

FLIPNZEE EXTERNAL PROVIDER: create_provider() called.

FLIPNZEE EXTERNAL PROVIDER INSERT SUCCEEDED

FLIPNZEE ESCROW: Provider record #14 created.

FLIPNZEE ESCROW: Escrow reference ESCROW-20260724010512-34 created.

These logs make it considerably easier to diagnose provider-related issues during development.


Benefits of the New Architecture

Persisting provider information provides several advantages:

  • Permanent audit trail of provider activity.
  • Separation between auction transactions and external services.
  • Easier debugging through structured provider records.
  • Foundation for future status synchronization.
  • Support for multiple providers without changing the auction model.
  • Cleaner object-oriented architecture.

Most importantly, the auction plugin no longer treats provider interactions as temporary events—they are now first-class entities within the transaction system.


Looking Ahead

Although the current implementation still simulates Escrow.com, the surrounding architecture is now remarkably close to supporting a real integration.

Future lessons will build upon this foundation by:

  • Displaying provider information within the Transaction Details screen.
  • Updating provider status as transactions progress.
  • Synchronizing with external provider APIs.
  • Supporting additional payment providers using the same abstraction layer.
  • Introducing webhook-based status updates.

With persistent provider records now in place, the Flipnzee Auctions plugin has taken another important step toward becoming a production-ready digital asset marketplace capable of handling complex website sale transactions in a clean, extensible, and maintainable manner.

Lesson 122: Persisting Escrow Provider Information for Future API Integration

In the previous lesson, Flipnzee Auctions introduced its first Escrow Provider Engine. Payment completion automatically created a simulated escrow transaction and generated a unique escrow reference.

While that proved the event-driven architecture worked, the generated reference only existed during execution. Once the request finished, there was no permanent record of the escrow transaction.

In this lesson, the plugin takes the next step by designing a persistent storage strategy for external providers.


Why Store Escrow Information?

Real-world escrow services return much more than a reference number.

An external provider may return:

  • Provider transaction ID
  • Escrow reference
  • Current escrow status
  • Creation timestamp
  • Last update timestamp
  • API response details
  • Provider-specific metadata

Without storing this information, the plugin would have no way to:

  • check escrow progress
  • synchronize status
  • reopen existing escrow transactions
  • display escrow details inside the admin panel

Persistence is therefore essential.


Objectives

By the end of this lesson the plugin architecture will support:

  • persistent escrow references
  • provider-specific transaction identifiers
  • provider status tracking
  • future API synchronization
  • support for multiple external providers

Thinking Beyond Escrow.com

Although Flipnzee Auctions is initially designed around Escrow.com, the architecture should never assume only one provider exists.

Instead of storing fields like:

escrow_reference
escrow_status

the plugin adopts more generic terminology.

For example:

provider
provider_reference
provider_transaction_id
provider_status

This makes the database independent of any specific vendor.

Future providers could include:

  • Escrow.com
  • custom enterprise escrow
  • regional payment escrow services
  • internal manual escrow workflows

Extending the Transaction Model

The transaction lifecycle now grows beyond internal auction information.

Auction
        │
        ▼
Transaction
        │
        ▼
External Provider
        │
        ▼
Escrow Workflow

Instead of treating external services as an afterthought, they become a first-class component of the transaction architecture.


Recommended Provider Fields

A professional transaction record may eventually include:

FieldPurpose
providerName of the provider
provider_referenceHuman-readable reference
provider_transaction_idExternal system ID
provider_statusCurrent provider status
provider_created_atProvider creation time
provider_updated_atLast synchronization
provider_responseRaw API response (optional)

Not every provider will use every field, but the structure remains flexible.


Keeping Responsibilities Separate

The Transaction Manager remains responsible for:

  • internal auction transactions
  • payment information
  • ownership workflow

The Escrow Provider becomes responsible for:

  • creating provider records
  • communicating with external APIs
  • interpreting provider responses
  • tracking provider-specific statuses

This clear separation keeps the plugin easier to maintain.


Future Synchronization

Creating an escrow transaction is only the beginning.

Eventually the plugin should support periodic synchronization.

Escrow Created
        │
        ▼
Store Provider Details
        │
        ▼
Scheduled Status Check
        │
        ▼
Retrieve Latest Status
        │
        ▼
Update Local Database

This enables administrators to see real-time escrow progress without manually checking the provider website.


Benefits of Persistent Storage

Persisting provider information allows administrators to:

  • search escrow transactions
  • troubleshoot failed payments
  • view escrow references
  • synchronize provider status
  • audit completed transactions
  • generate financial reports

These capabilities become increasingly valuable as transaction volume grows.


Preparing for API Integration

Most modern payment and escrow APIs follow a similar lifecycle:

  1. Create transaction
  2. Receive external reference
  3. Store the response
  4. Poll or receive status updates
  5. Finalize the transaction

Because Flipnzee Auctions now separates provider logic from transaction logic, integrating a live API becomes a matter of implementing provider-specific communication rather than rewriting the auction system.


Architectural Benefits

This lesson strengthens several important software engineering principles:

  • Separation of concerns
  • Single responsibility
  • Provider abstraction
  • Extensibility
  • Maintainability

By treating external providers as independent services, the plugin becomes easier to evolve as new payment technologies emerge.


What We Accomplished

In this lesson we:

  • designed a persistent model for external provider information
  • separated provider data from transaction data
  • prepared the database for long-term escrow tracking
  • laid the groundwork for status synchronization
  • ensured future provider integrations remain modular
  • continued evolving Flipnzee Auctions into a production-ready architecture

Looking Ahead

With provider persistence planned, the next stage is to build the synchronization layer that keeps local transaction records aligned with external escrow providers.

This will allow Flipnzee Auctions to automatically monitor escrow progress, refresh statuses, and provide administrators with an accurate, real-time view of every transaction without relying on manual updates.

Lesson 121: Building an Escrow Provider Engine for Flipnzee Auctions

As the Flipnzee Auctions plugin matures, the payment workflow is becoming more structured and event-driven. In previous lessons, payment completion triggered the transaction lifecycle, and ownership transfer records were automatically created.

In this lesson, the next major component is introduced: an Escrow Provider Engine.

Although this lesson uses a simulated provider instead of connecting to a real escrow service, it establishes the architecture required for integrating providers such as Escrow.com in the future.


Why an Escrow Provider?

High-value website and domain transactions require trust between buyers and sellers.

Rather than immediately transferring funds or ownership, an escrow service acts as a trusted intermediary by:

  • Holding buyer funds securely
  • Waiting until transfer conditions are satisfied
  • Releasing funds to the seller after successful delivery

Instead of hardcoding a specific provider throughout the plugin, Flipnzee Auctions now introduces an abstraction layer dedicated to escrow providers.


Objectives

By the end of this lesson the plugin will:

  • create an escrow transaction automatically after payment completion
  • generate a unique escrow reference
  • isolate escrow logic into its own provider class
  • keep transaction lifecycle independent from any specific provider
  • prepare the plugin for future Escrow.com API integration

Creating the Escrow Provider

A new provider class was introduced:

includes/
└── class-escrow-provider.php

The provider is intentionally lightweight.

Its responsibility is simply to manage escrow-related operations without affecting the transaction manager or ownership transfer logic.

Initialization is handled through:

Flipnzee_Escrow_Provider::init();

This keeps provider-specific functionality separated from the rest of the plugin.


Simulating Escrow Creation

Rather than connecting to a live API, the provider currently generates an internal escrow reference.

Example:

ESCROW-20260723144534-33

This combines:

  • current UTC timestamp
  • transaction ID

The resulting reference behaves similarly to what an external escrow provider would return after successfully opening an escrow transaction.


Connecting Escrow to the Transaction Lifecycle

Previously, payment completion created an ownership transfer record.

The workflow has now been extended.

Payment Completed
        │
        ▼
Transaction Lifecycle
        │
        ├────────► Create Ownership Transfer
        │
        ▼
Create Escrow Transaction
        │
        ▼
Generate Escrow Reference

This means escrow creation becomes an automatic consequence of payment completion.

No administrator intervention is required.


Event-Driven Architecture

One of the biggest improvements in this lesson is reinforcing an event-driven design.

Instead of directly calling escrow code from the payment page, the plugin continues using WordPress actions.

Payment Updated
        │
        ▼
flipnzee_payment_completed
        │
        ▼
Transaction Lifecycle Manager
        │
        ├────────► Transfer Manager
        │
        └────────► Escrow Provider

This approach offers several advantages:

  • lower coupling
  • easier testing
  • simpler future extensions
  • better maintainability

Why This Design Matters

Imagine replacing the simulated provider with:

  • Escrow.com
  • Stripe Escrow (if available)
  • custom enterprise escrow
  • another regional escrow service

The transaction lifecycle would remain unchanged.

Only the provider implementation would need to change.

That separation makes the architecture considerably more flexible.


Debugging the Workflow

During implementation, extensive logging was added to verify each stage of the lifecycle.

The logs confirmed:

Payment status updated

↓

Payment completed action fired

↓

Transaction lifecycle started

↓

Ownership transfer created

↓

Escrow provider invoked

↓

Escrow reference generated

This confirmed that the entire workflow executes exactly as intended.

After validation, temporary debugging hooks were removed while retaining useful lifecycle logging for development.


Current Escrow Flow

The payment pipeline now behaves as follows:

Buyer submits payment
        │
        ▼
Administrator verifies payment
        │
        ▼
Payment Completed
        │
        ▼
Transaction Lifecycle Manager
        │
        ├────────► Ownership Transfer
        │
        └────────► Escrow Provider
                        │
                        ▼
              Escrow Reference Created

This creates a clean foundation for integrating real external services.


What We Accomplished

In this lesson we successfully:

  • created the Escrow Provider class
  • initialized the provider during plugin bootstrap
  • integrated escrow creation into the transaction lifecycle
  • generated simulated escrow references
  • maintained loose coupling through WordPress actions
  • validated the complete workflow using event-driven architecture
  • prepared the plugin for real escrow provider integration

Looking Ahead

The current provider generates simulated escrow transactions.

In the next lessons, the plugin will evolve further by storing provider information in the database, tracking escrow status, and eventually communicating with real escrow APIs.

By introducing the provider abstraction now, future integrations can be added without restructuring the payment lifecycle.

This is one of the key architectural milestones in transforming Flipnzee Auctions from a simple auction plugin into a professional platform for buying and selling websites, domains, and digital assets.

https://github.com/SplendidDigital/flipnzee-auctions/releases/tag/lesson-121-stable