{"id":311930,"date":"2026-05-19T10:37:53","date_gmt":"2026-05-19T10:37:53","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/multi-account-for-givewp-paypal-donations\/"},"modified":"2026-05-19T10:37:51","modified_gmt":"2026-05-19T10:37:51","slug":"alamin-donation-router","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/alamin-donation-router\/","author":20002658,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"6.9.4","requires":"6.4","requires_php":"8.1","requires_plugins":null,"header_name":"Business Accounts Router for GiveWP with PayPal Donations","header_author":"Al Amin Ahamed","header_description":"Routes donations to one of several PayPal Business accounts based on donor country, extending the GiveWP PayPal Donations gateway. Not affiliated with GiveWP or PayPal.","assets_banners_color":"9c9da1","last_updated":"2026-05-19 10:37:51","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/alaminahamed.com\/donate","header_plugin_uri":"https:\/\/github.com\/mralaminahamed\/alamin-donation-router","header_author_uri":"https:\/\/github.com\/mralaminahamed","rating":0,"author_block_rating":0,"active_installs":0,"downloads":24,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"mralaminahamed","date":"2026-05-19 10:37:51"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-1024x1024.png":{"filename":"icon-1024x1024.png","revision":3537083,"resolution":"1024x1024","location":"assets","locale":"","width":1024,"height":1024},"icon-128x128.png":{"filename":"icon-128x128.png","revision":3537083,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3537083,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256},"icon.svg":{"filename":"icon.svg","revision":3537083,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3537083,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3537083,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3537061,"resolution":"1","location":"assets","locale":"","width":1440,"height":900},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3537061,"resolution":"2","location":"assets","locale":"","width":1425,"height":993},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3537061,"resolution":"3","location":"assets","locale":"","width":1440,"height":900},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3537061,"resolution":"4","location":"assets","locale":"","width":1440,"height":900},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3537061,"resolution":"5","location":"assets","locale":"","width":1440,"height":900},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3537061,"resolution":"6","location":"assets","locale":"","width":1440,"height":1263},"screenshot-7.png":{"filename":"screenshot-7.png","revision":3537061,"resolution":"7","location":"assets","locale":"","width":1440,"height":1344}},"screenshots":{"1":"Accounts list table \u2014 all configured PayPal Business accounts with Active\/Inactive status badges, country, legal entity, and action buttons.","2":"Add Account form \u2014 entering legal entity details and connecting a PayPal Business account via OAuth.","3":"Country Routing list table \u2014 routing rules mapping donor countries to donation forms and PayPal accounts.","4":"Webhook Setup view \u2014 per-account webhook URL with one-click copy and the required PayPal event type list.","5":"Country selector popup \u2014 donor-facing modal that lets donors choose their country\/legal entity before checkout.","6":"Plugin Settings tab \u2014 configuring the country selector popup, geolocation provider, PDF receipts, and legal acknowledgement.","7":"Edit Account form \u2014 per-account legal entity details and receipt template editor with available GiveWP email tags."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[8222,263501,5800,32417,334],"plugin_category":[45],"plugin_contributors":[221130],"plugin_business_model":[],"class_list":["post-311930","plugin","type-plugin","status-publish","hentry","plugin_tags-charity","plugin_tags-country-routing","plugin_tags-donations","plugin_tags-givewp","plugin_tags-paypal","plugin_category-ecommerce","plugin_contributors-mralaminahamed","plugin_committers-mralaminahamed"],"banners":{"banner":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/banner-772x250.png?rev=3537083","banner_2x":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/banner-1544x500.png?rev=3537083","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/icon.svg?rev=3537083","icon":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/icon.svg?rev=3537083","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-1.png?rev=3537061","caption":"Accounts list table \u2014 all configured PayPal Business accounts with Active\/Inactive status badges, country, legal entity, and action buttons."},{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-2.png?rev=3537061","caption":"Add Account form \u2014 entering legal entity details and connecting a PayPal Business account via OAuth."},{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-3.png?rev=3537061","caption":"Country Routing list table \u2014 routing rules mapping donor countries to donation forms and PayPal accounts."},{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-4.png?rev=3537061","caption":"Webhook Setup view \u2014 per-account webhook URL with one-click copy and the required PayPal event type list."},{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-5.png?rev=3537061","caption":"Country selector popup \u2014 donor-facing modal that lets donors choose their country\/legal entity before checkout."},{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-6.png?rev=3537061","caption":"Plugin Settings tab \u2014 configuring the country selector popup, geolocation provider, PDF receipts, and legal acknowledgement."},{"src":"https:\/\/ps.w.org\/alamin-donation-router\/assets\/screenshot-7.png?rev=3537061","caption":"Edit Account form \u2014 per-account legal entity details and receipt template editor with available GiveWP email tags."}],"raw_content":"<!--section=description-->\n<p>Business Accounts Router for GiveWP with PayPal Donations extends the GiveWP PayPal Donations gateway so that a single WordPress installation can accept donations through several PayPal Business accounts, automatically routing each transaction to the correct account based on the donor's declared country.<\/p>\n\n<p>This plugin is an independent, third-party extension. It is not affiliated with, endorsed by, or sponsored by GiveWP (StellarWP) or PayPal. The names \"GiveWP\" and \"PayPal\" appear here solely to describe compatibility with those products.<\/p>\n\n<p>This plugin is designed for organisations that operate two or more legally distinct charity entities \u2014 for example a US 501(c)(3) and a Canadian CRA-registered charity \u2014 that share a single donation website but must process payments through separate PayPal accounts and issue separate tax receipts.<\/p>\n\n<p><strong>Key features:<\/strong><\/p>\n\n<ul>\n<li><strong>Multi-account admin panel<\/strong> \u2014 Add and manage any number of PayPal Business accounts under Donation Forms \u2192 PayPal Accounts. Each account stores legal entity details (name, tax ID, address, country) alongside AES-256-GCM encrypted API credentials.<\/li>\n<li><strong>Country routing rules<\/strong> \u2014 Define which PayPal account and GiveWP form handles donations from each country. One active rule per country, fully configurable from the admin.<\/li>\n<li><strong>Country selector popup<\/strong> \u2014 A donor-facing modal popup (shortcode <code>[ador_country_selector]<\/code>) asks donors to identify their country before proceeding to checkout. Selection is stored in sessionStorage to avoid repeated prompts.<\/li>\n<li><strong>Runtime credential routing<\/strong> \u2014 The plugin intercepts GiveWP's IoC container at payment time, substituting the correct PayPal credentials transparently. No GiveWP core files are modified.<\/li>\n<li><strong>Per-account webhook handling<\/strong> \u2014 Each PayPal account receives its own webhook endpoint (<code>\/wp-json\/ador\/v1\/webhook\/{account_id}<\/code>) with independent HMAC signature verification.<\/li>\n<li><strong>Per-entity email tags<\/strong> \u2014 Seven GiveWP email template tags populate receipt emails with the correct legal entity name, address, tax ID, tax-deductibility statement, and a unique per-entity receipt number.<\/li>\n<li><strong>PDF receipts<\/strong> \u2014 Optional on-demand PDF receipt download on the GiveWP success page, generated by dompdf.<\/li>\n<li><strong>Security-first design<\/strong> \u2014 AES-256-GCM credential storage, nonce protection, capability checks, webhook signature verification, and <code>$wpdb-&gt;prepare()<\/code> throughout.<\/li>\n<\/ul>\n\n<h3>External services<\/h3>\n\n<p>This plugin sends data to PayPal's REST API to authenticate with PayPal Business accounts and to verify the HMAC-SHA256 signatures of inbound webhook events.<\/p>\n\n<p><strong>PayPal REST API<\/strong> (<code>https:\/\/api-m.paypal.com<\/code>, <code>https:\/\/api-m.sandbox.paypal.com<\/code>, <code>https:\/\/api.paypal.com<\/code>, <code>https:\/\/api.sandbox.paypal.com<\/code>)<\/p>\n\n<ul>\n<li><strong>What is sent:<\/strong> PayPal Client ID and Client Secret (decrypted in memory at request time, never stored in plaintext) are exchanged for OAuth 2.0 bearer tokens during donation checkout. Webhook event payloads are forwarded to PayPal's <code>\/v1\/notifications\/verify-webhook-signature<\/code> endpoint for signature verification.<\/li>\n<li><strong>When it is sent:<\/strong> Only when a donation is being processed through a PayPal Business account configured in this plugin, or when PayPal sends a webhook event to this site.<\/li>\n<li><strong>Service terms:<\/strong> <a href=\"https:\/\/www.paypal.com\/us\/legalhub\/useragreement-full\">PayPal User Agreement<\/a> | <a href=\"https:\/\/www.paypal.com\/us\/legalhub\/privacy-full\">PayPal Privacy Statement<\/a><\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>alamin-donation-router<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Run <code>composer install --no-dev --optimize-autoloader<\/code> inside the plugin directory.<\/li>\n<li>Ensure <code>AUTH_KEY<\/code> and <code>SECURE_AUTH_SALT<\/code> are set to strong, unique values in <code>wp-config.php<\/code> \u2014 these are required for credential encryption.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> screen in WordPress.<\/li>\n<li>Navigate to <strong>Donation Forms \u2192 PayPal Accounts<\/strong> and add your first PayPal Business account.<\/li>\n<li>Configure country routing rules under the <strong>Country Routing<\/strong> tab.<\/li>\n<li>Add the shortcode <code>[ador_country_selector]<\/code> to your donation landing page.<\/li>\n<li>Register per-account webhook URLs in your PayPal Developer apps (see the <strong>Webhook Setup<\/strong> view for each account).<\/li>\n<\/ol>\n\n<p>For detailed configuration instructions, see the OPERATIONS.md file included with the plugin.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"which%20payment%20gateways%20does%20this%20plugin%20support%3F\"><h3>Which payment gateways does this plugin support?<\/h3><\/dt>\n<dd><p>This plugin supports the GiveWP PayPal Donations gateway (also known as PayPal Commerce \/ PPCP) only. It does not affect or support other GiveWP gateways such as Stripe, Authorize.net, or PayPal Standard.<\/p><\/dd>\n<dt id=\"how%20many%20paypal%20accounts%20can%20i%20add%3F\"><h3>How many PayPal accounts can I add?<\/h3><\/dt>\n<dd><p>There is no hard limit on the number of PayPal Business accounts you can configure. Each account requires its own PayPal Developer REST app (Client ID and Client Secret) and its own webhook URL registered in PayPal's developer portal.<\/p><\/dd>\n<dt id=\"how%20are%20paypal%20credentials%20stored%3F%20is%20it%20safe%3F\"><h3>How are PayPal credentials stored? Is it safe?<\/h3><\/dt>\n<dd><p>Yes. PayPal Client IDs and Client Secrets are never stored in plaintext. They are encrypted with AES-256-GCM using a key derived via PBKDF2-SHA256 from your WordPress <code>AUTH_KEY<\/code> and <code>SECURE_AUTH_SALT<\/code> constants (100,000 iterations, 32-byte key). The random nonce and GCM authentication tag are stored alongside the ciphertext as a base64 blob. Credentials are never written to any log. If <code>AUTH_KEY<\/code> or <code>SECURE_AUTH_SALT<\/code> are changed, stored credentials become unreadable and must be re-entered.<\/p><\/dd>\n<dt id=\"can%20i%20test%20with%20paypal%20sandbox%20accounts%20before%20going%20live%3F\"><h3>Can I test with PayPal sandbox accounts before going live?<\/h3><\/dt>\n<dd><p>Yes. The plugin works with both PayPal sandbox and live environments. Add your sandbox accounts the same way as live accounts, using the Client IDs and Secrets from your sandbox REST apps. Register sandbox webhook URLs in PayPal's developer portal using a publicly accessible HTTPS URL (use a tunnelling tool such as ngrok for local development). See OPERATIONS.md for a full sandbox testing procedure.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20a%20routing%20rule%20is%20missing%20for%20a%20donor%27s%20country%3F\"><h3>What happens if a routing rule is missing for a donor's country?<\/h3><\/dt>\n<dd><p>If no active routing rule exists for the selected country, the credential router falls back to GiveWP's primary PayPal account. The donation is not blocked \u2014 it proceeds normally using the default account. An error entry is written to the PHP error log with prefix <code>[ADOR]<\/code> for the operator's attention.<\/p><\/dd>\n<dt id=\"does%20this%20plugin%20modify%20givewp%20core%20files%3F\"><h3>Does this plugin modify GiveWP core files?<\/h3><\/dt>\n<dd><p>No. The plugin hooks into GiveWP exclusively through WordPress filters, actions, and GiveWP's public IoC container (<code>give()<\/code>). No GiveWP core files are modified.<\/p><\/dd>\n<dt id=\"can%20i%20use%20this%20plugin%20with%20givewp%27s%20built-in%20email%20receipts%3F\"><h3>Can I use this plugin with GiveWP's built-in email receipts?<\/h3><\/dt>\n<dd><p>Yes. The plugin registers additional GiveWP email template tags that you can insert into your existing GiveWP email templates (GiveWP \u2192 Settings \u2192 Emails). Tags include <code>{paypal_account_entity_name}<\/code>, <code>{paypal_account_entity_tax_id}<\/code>, <code>{paypal_account_receipt_number}<\/code>, and four others. Tags return an empty string for donations not routed through this plugin, so existing templates work without changes.<\/p><\/dd>\n<dt id=\"the%20pdf%20receipt%20is%20not%20generating.%20what%20should%20i%20check%3F\"><h3>The PDF receipt is not generating. What should I check?<\/h3><\/dt>\n<dd><p>Verify that <code>dompdf\/dompdf<\/code> is installed by running <code>composer install<\/code> in the plugin directory. Confirm that the <code>ador_pdf_receipts_enabled<\/code> option is set to a truthy value in <code>wp_options<\/code>. Check the PHP error log for a line beginning <code>[ADOR] PDF receipts disabled:<\/code> \u2014 this will include the underlying error message.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0 - 2026-05-07<\/h4>\n\n<p><strong>Added<\/strong><\/p>\n\n<ul>\n<li>Multi-account admin panel (Donation Forms \u2192 PayPal Accounts) with Accounts, Country Routing, and Settings tabs.<\/li>\n<li>Account add\/edit form with AES-256-GCM encrypted credential storage.<\/li>\n<li>Country routing rules with add\/edit\/bulk-deactivate actions.<\/li>\n<li>Custom database tables <code>{prefix}ador_accounts<\/code> and <code>{prefix}ador_country_routing<\/code> with schema versioning.<\/li>\n<li><code>PayPal_Credential_Router<\/code> intercepting GiveWP's IoC container before every PayPal AJAX payment request to substitute per-account credentials.<\/li>\n<li>IoC container rebinding for both <code>MerchantDetail::class<\/code> and <code>MerchantDetails::class<\/code> covering all GiveWP PayPal credential resolution paths.<\/li>\n<li>Refund routing with inactive-account guard.<\/li>\n<li>Per-account REST webhook endpoint <code>POST \/wp-json\/ador\/v1\/webhook\/{account_id}<\/code> with HMAC-SHA256 signature verification and idempotency checking.<\/li>\n<li>Country selector popup shortcode <code>[ador_country_selector]<\/code> with sessionStorage persistence.<\/li>\n<li>Geolocation hint (non-binding IP-based country pre-selection).<\/li>\n<li>Seven GiveWP email template tags for per-entity receipt details.<\/li>\n<li>Per-entity sequential receipt numbers allocated atomically via <code>FOR UPDATE<\/code> lock.<\/li>\n<li>Default tax-deductibility statement templates for US and Canada.<\/li>\n<li>PDF receipt generation via dompdf behind <code>ador_pdf_receipts_enabled<\/code> option flag.<\/li>\n<li>Action hooks <code>ador_credentials_routed<\/code> and <code>ador_webhook_processed<\/code>.<\/li>\n<li>PHPStan level 8, WPCS 3.x, PHPUnit 9.6 with Brain\\Monkey test suite.<\/li>\n<\/ul>\n\n<p><strong>Security<\/strong><\/p>\n\n<ul>\n<li>AES-256-GCM encryption for all stored PayPal credentials with PBKDF2-SHA256 key derivation.<\/li>\n<li>PayPal HMAC-SHA256 webhook signature verification on all inbound webhook events.<\/li>\n<li>WordPress nonce protection on all admin form submissions and AJAX endpoints.<\/li>\n<li><code>current_user_can( 'manage_give_settings' )<\/code> capability checks on all admin-only actions.<\/li>\n<li><code>$wpdb-&gt;prepare()<\/code> for all parameterised database queries.<\/li>\n<\/ul>","raw_excerpt":"Route GiveWP donations to multiple PayPal Business accounts by donor country. Multi-entity charities, automatic credential switching.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/311930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=311930"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mralaminahamed"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=311930"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=311930"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=311930"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=311930"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=311930"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=311930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}