Integration addons will allow you to use a different store credit/wallet plugin’s system, instead of our built-in wallet system, when paying commission into your affiliates as store credit.
You can then select which system to use in the plugin settings (under “Store Credit Payouts”).
The following integration addons available to download right now:
TeraWallet – For WooCommerce
- Plugin: Click Here
- Integration addon: Click Here
YITH WooCommerce Account Funds
- Plugin: Click Here
- Integration addon: Click Here
Want us to develop an integration addon for another wallet plugin? Please submit a suggestion.
Custom Integrations
For developing your own custom integrations there is the “wcusage_hook_custom_credit_create_payout” hook you can use to override the store credit payouts, pay it into a custom wallet, and then mark it as paid.
For example, here’s how it’s done with the TerraWallet integration:
/**
* TeraWallet - Credit Create Payout
*
* @param string $system
* @param int $user_id
* @param int $amount
*
*/
add_filter('wcusage_hook_custom_credit_create_payout', 'my_custom_credit_create_payout', 10, 3);
function my_custom_credit_create_payout( $system, $user_id, $amount ) {
$paid = 0;
// Make the payment using the wallet plugins credit function
if( $system == $this->get_system_id && is_plugin_active( $this->get_system_file ) ) {
$label = "Affiliate Commission";
woo_wallet()->wallet->credit( $user_id, sanitize_text_field( $amount ), $label );
$paid = 1;
}
return $paid;
}
/**
* TeraWallet - Settings - Get Balance
*
* @param string $system
* @param int $user_id
*
*/
add_filter('wcusage_hook_custom_credit_balance', 'my_custom_credit_balance', 10, 2);
function my_custom_credit_balance( $system, $user_id ) {
$integration = new wcusage_credit_integration();
$credit = "";
// Get the custom credit amount if plugin exists
if ( function_exists('woo_wallet') && is_plugin_active( $this->get_system_file ) ) {
$credit = woo_wallet()->wallet->get_wallet_balance( $user_id, 0 );
}
return $integration->get_balance( $credit, $system, $user_id, $this->get_system_id, $this->get_system_name, $this->get_system_file );
}
If you are a developer and require more information on how to integrate your own wallet plugin, or have created your own integration addon that you want to list here, feel free to contact us.