WP Coacheroos Supporter
WP Coacheroos Supporter is a WordPress plugin for Coacheroos coach payout support. It connects coaches to Stripe Express accounts, lets eligible coaches add or update bank details, displays Stripe payment and payout information, and processes coach payouts for completed bookings.
by Asif Rasheed · github.com/asifrasheedprovelopers/wp-coacheroos-supporter · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/asifrasheedprovelopers/wp-coacheroos-supporter/archive/refs/heads/master.zipReadme
WP Coacheroos Supporter
WP Coacheroos Supporter is a WordPress plugin for Coacheroos coach payout support. It connects coaches to Stripe Express accounts, lets eligible coaches add or update bank details, displays Stripe payment and payout information, and processes coach payouts for completed bookings.
Features
- Stripe Express connected account creation for coaches.
- Bank account submission for United States and United Kingdom accounts.
- Stripe-hosted onboarding and account update links.
- Coach bank account listing through Stripe external accounts.
- Coach payout history and total amount sent.
- Stripe balance summary for connected accounts.
- Daily scheduled payout processing through WP-Cron.
- Administrator-only manual payout trigger for a specific coach or all eligible bookings.
- Stripe split-payment handling between coaches and admin for completed bookings, based on the configured commission.
Requirements
- WordPress with WP-Cron enabled.
- PHP 8.1 or compatible PHP version supported by the installed Stripe SDK.
- Composer dependencies installed.
- Stripe PHP SDK, already declared in
composer.json. - A WP Base Dev installation exposing
wpb_setting(). - WP Base Dev booking and transaction tables:
{prefix}base_bookings{prefix}base_transactions
Installation
- Upload this folder to
wp-content/plugins/wp-coacheroos-supporter. - Run
composer installif thevendordirectory is not present. - Activate WP Coacheroos Supporter in WordPress admin.
- Configure the Stripe secret key and fees in WP Base Dev monetary settings.
- Add the required shortcodes to the relevant Coacheroos account pages.
Stripe Settings
The plugin reads Stripe configuration from WP Base Dev:
- Secret key:
gateways.stripe.private_key - Percentage fee:
gateways.stripe.fee - Fixed fee:
gateways.stripe.fee_fixed
These values are exposed internally as:
STRIPE_SECRET_KEYSTRIPE_FEE_PERCENTAGESTRIPE_FEE_FIXED
Shortcodes
[coach_account_dashboard]
Displays the coach bank account onboarding form when the coach does not yet have a connected Stripe account. If the account exists but is not activated, it displays a Stripe onboarding link.
[coach_bankform_button link="/accounts" text="Add Bank Account" target="_self"]
Displays an add-bank-account button for logged-in eligible coaches who do not already have a Stripe connected account.
[coach_bank_detail_list]
Displays the connected coach bank account details from Stripe and provides an update button that redirects the coach to Stripe-hosted account onboarding.
[coach_payments_total]
Displays Stripe balance data for the coach connected account, including total balance, future payouts, pending balance, and lifetime successful payments.
[coach_payout_history]
Displays the coach transfer history stored in user meta and the total amount sent.
Eligible Roles
Shortcode access is limited to logged-in users with one of these roles:
wpb_workerwpb_vendoradministrator
Stripe Split Payments
The payout processor checks completed bookings in {prefix}base_bookings and finds the Stripe PaymentIntent ID in {prefix}base_transactions.transaction_paypal_ID.
The plugin supports split payments between coaches and the admin/platform account according to the configured commission. In the current payout logic, the coach receives 90% of the calculated booking price and the remaining net amount is recorded as the admin/platform amount.
For each eligible booking:
- The Stripe PaymentIntent is retrieved.
- The latest Stripe Charge and BalanceTransaction are retrieved.
- The total client payment is converted from cents to the account currency.
- The original booking price is calculated from the configured Stripe percentage and fixed fees.
- The coach payout is calculated from the configured commission split. The current implementation sends 90% of the booking price to the coach.
- A Stripe Transfer sends the coach amount to the coach's connected account.
- The remaining net amount is treated as the admin/platform amount.
- The plugin creates a Stripe Payout for the admin amount when available.
The processor stores payout data on the booking:
payout_statuspayout_amountpayout_transfer_idpayout_erroradmin_feeadmin_fee_currency
It also stores coach payout data in user meta:
stripe_connect_account_idstripe_account_verification_linkstripe_account_statusstripe_link_created_atpaid_booking_idstransfer_historytotal_amount_sent
Payout Scheduling
On plugin activation, the plugin schedules the process_coach_payouts WP-Cron event to run daily at midnight.
Automatic payouts process completed bookings that:
- Have a non-zero customer user.
- Have
status = completed. - Ended at least 24 hours before processing.
- Have a non-empty price.
- Have not already been recorded in the coach
paid_booking_idsmeta.
On plugin deactivation, the scheduled event is removed.
Manual Payout Trigger
Administrators can trigger payout processing from WordPress admin:
/wp-admin/?run_coach_payout=1
To process one coach:
/wp-admin/?run_coach_payout=1&user_id=123
Development Notes
- Public AJAX requests are protected with the
coacheroos_ajax_noncenonce. - Stripe account creation supports
GBandUSbank validation in the current form. - Bootstrap assets are bundled in
assets/. - The plugin currently assumes
GBPduring payout processing. - The repository excludes legacy backup PHP files and test balance top-up code.
License
GPL-2.0-or-later.