{"id":25700,"date":"2021-12-08T14:34:33","date_gmt":"2021-12-08T14:34:33","guid":{"rendered":"https:\/\/couponaffiliates.com\/docs\/pro-store-credit-integrations\/"},"modified":"2026-09-21T23:55:52","modified_gmt":"2026-09-21T23:55:52","slug":"integraciones-pro-store-credit","status":"publish","type":"aisa_doc","link":"https:\/\/couponaffiliates.com\/es\/docs\/pro-store-credit-integrations\/","title":{"rendered":"(PRO) Pagos a cr\u00e9dito en tienda - Integraciones"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Store credit payouts can be paid into a different store credit\/wallet plugin&#8217;s system, instead of our built-in wallet system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can select which system to use in the plugin settings (under &#8220;Store Credit Payouts&#8221;), in the &#8220;Wallet System&#8221; dropdown.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"600\" height=\"148\" src=\"https:\/\/couponaffiliates.com\/wp-content\/uploads\/2021\/12\/gif-1-4eae6d9e0b79.gif\" alt=\"\" class=\"wp-image-6974\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Recommended: Simple Store Credit &amp; Wallet &#8211; by RelyWP<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The integration for &#8220;Simple Store Credit &amp; Wallet for WooCommerce&#8221; is built directly into Coupon Affiliates, so there is no integration addon to download. It is the first option in the &#8220;Wallet System&#8221; dropdown, and the free version can be installed in one click from the settings page.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Plugin: <a href=\"https:\/\/wordpress.org\/plugins\/simple-store-credit\/\" target=\"_blank\" rel=\"noreferrer noopener\">Haga clic aqu\u00ed<\/a><\/li>\n\n\n\n<li>Documentation: <a href=\"https:\/\/couponaffiliates.com\/es\/docs\/simple-store-credit-integration\/\">Simple Store Credit Integration<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">The following integration addons are also available to download right now:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>TeraWallet - Para WooCommerce<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Plugin: <a href=\"https:\/\/wordpress.org\/plugins\/woo-wallet\" target=\"_blank\" rel=\"noreferrer noopener\">Haga clic aqu\u00ed<\/a><\/li>\n\n\n\n<li>Complemento de integraci\u00f3n: <a href=\"https:\/\/couponaffiliates.com\/es\/complementos\/integracion-de-terawallet\/\" target=\"_blank\" rel=\"noreferrer noopener\">Haga clic aqu\u00ed<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>YITH WooCommerce Fondos de Cuenta<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Plugin: <a href=\"https:\/\/yithemes.com\/themes\/plugins\/yith-woocommerce-account-funds\" data-type=\"URL\" target=\"_blank\" rel=\"noreferrer noopener\">Haga clic aqu\u00ed<\/a><\/li>\n\n\n\n<li>Complemento de integraci\u00f3n: <a href=\"https:\/\/couponaffiliates.com\/es\/complementos\/integracion-de-yithfunds\/\" target=\"_blank\" rel=\"noreferrer noopener\">Haga clic aqu\u00ed<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u00bfDesea que desarrollemos un complemento de integraci\u00f3n para otro complemento de monedero? Por favor <a href=\"https:\/\/roadmap.couponaffiliates.com\/boards\/feature-requests\" target=\"_blank\" rel=\"noreferrer noopener\">enviar una sugerencia<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Integraciones personalizadas<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For developing your own custom integration, there are three filters to hook into: one to read the affiliate&#8217;s balance, one to pay a payout into your wallet, and one to reverse a payout back out of it.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>wcusage_hook_custom_get_credit_users_balance<\/strong> &#8211; returns the user&#8217;s current balance.<\/li>\n\n\n\n<li><strong>wcusage_hook_custom_credit_create_payout<\/strong> &#8211; pays the commission into your wallet. Return 1 once paid, or 0 if it failed.<\/li>\n\n\n\n<li><strong>wcusage_hook_custom_credit_reverse_payout<\/strong> &#8211; takes the amount back out again when a payout is reversed.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can add your own system to the &#8220;Wallet System&#8221; dropdown with the &#8220;wcusage_hook_settings_store_credit_dropdown&#8221; action.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two things to be aware of when writing the callbacks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The first parameter of each filter starts out as the selected system ID, but it is passed along the chain and changed by each callback, so check the &#8220;wcusage_field_storecredit_system&#8221; setting directly rather than relying on it. When the selected system isn&#8217;t yours, return the value you were given so other integrations still work.<\/li>\n\n\n\n<li>An integration only counts as active once one of these three filters has actually been registered. If a wallet system is selected but nothing is hooked in &#8211; for example the integration&#8217;s plugin has been deactivated &#8211; the built-in wallet takes over again, so payouts and balances don&#8217;t silently disappear.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Por ejemplo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ The ID used to identify your own wallet system.\ndefine( 'MY_WALLET_SYSTEM_ID', 'mywallet' );\n\n\/**\n * Add your system to the \"Wallet System\" dropdown.\n *\/\nadd_action( 'wcusage_hook_settings_store_credit_dropdown', function( $system ) {\n  ?&gt;\n  &lt;option value=\"&lt;?php echo esc_attr( MY_WALLET_SYSTEM_ID ); ?&gt;\" &lt;?php selected( $system, MY_WALLET_SYSTEM_ID ); ?&gt;&gt;My Wallet Plugin&lt;\/option&gt;\n  &lt;?php\n}, 10, 1 );\n\n\/**\n * Whether your system is the one currently selected.\n *\/\nfunction my_wallet_is_selected() {\n  return wcusage_get_setting_value( 'wcusage_field_storecredit_system', 'default' ) === MY_WALLET_SYSTEM_ID;\n}\n\n\/**\n * Get the affiliate's balance.\n *\/\nadd_filter( 'wcusage_hook_custom_get_credit_users_balance', function( $balance, $user_id ) {\n\n  if ( ! my_wallet_is_selected() ) {\n    return $balance;\n  }\n\n  return (float) my_wallet_get_balance( $user_id );\n\n}, 20, 2 );\n\n\/**\n * Pay a payout into the wallet.\n *\/\nadd_filter( 'wcusage_hook_custom_credit_create_payout', function( $paid, $user_id, $amount ) {\n\n  if ( ! my_wallet_is_selected() ) {\n    return $paid;\n  }\n\n  $note = wcusage_get_setting_value( 'wcusage_field_tr_payouts_storecredit_description', 'Affiliate Commission' );\n\n  return my_wallet_add_credit( $user_id, (float) $amount, $note ) ? 1 : 0;\n\n}, 20, 3 );\n\n\/**\n * Reverse a payout back out of the wallet.\n *\/\nadd_filter( 'wcusage_hook_custom_credit_reverse_payout', function( $paid, $user_id, $amount ) {\n\n  if ( ! my_wallet_is_selected() ) {\n    return $paid;\n  }\n\n  return my_wallet_deduct_credit( $user_id, (float) $amount ) ? 1 : 0;\n\n}, 20, 3 );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Si eres desarrollador y necesitas m\u00e1s informaci\u00f3n sobre c\u00f3mo integrar tu propio complemento de monedero, o has creado tu propio complemento de integraci\u00f3n que quieres incluir aqu\u00ed, no dudes en contactar con <a href=\"https:\/\/couponaffiliates.com\/es\/pongase-en-contacto-con\/\" target=\"_blank\" rel=\"noreferrer noopener\">Contacto<\/a>.<\/p>","protected":false},"author":1,"menu_order":0,"template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_links_to":"","_links_to_target":""},"aisa_doc_category":[160,152],"class_list":["post-25700","aisa_doc","type-aisa_doc","status-publish","hentry","aisa_doc_category-integrations","aisa_doc_category-method-store-credit","wpbf-post"],"taxonomy_info":{"aisa_doc_category":[{"value":160,"label":"Integrations"},{"value":152,"label":"Method: Store Credit"}]},"featured_image_src_large":[],"author_info":{"display_name":"Elliot Sowersby","author_link":"#"},"comment_info":"","_links":{"self":[{"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/aisa_doc\/25700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/aisa_doc"}],"about":[{"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/types\/aisa_doc"}],"author":[{"embeddable":true,"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/aisa_doc\/25700\/revisions"}],"predecessor-version":[{"id":25915,"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/aisa_doc\/25700\/revisions\/25915"}],"wp:attachment":[{"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/media?parent=25700"}],"wp:term":[{"taxonomy":"aisa_doc_category","embeddable":true,"href":"https:\/\/couponaffiliates.com\/es\/wp-json\/wp\/v2\/aisa_doc_category?post=25700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}