{"id":213417,"date":"2025-01-04T11:07:56","date_gmt":"2025-01-04T11:07:56","guid":{"rendered":"https:\/\/en-gb.wordpress.org\/plugins\/mondu-trade-account\/"},"modified":"2025-01-04T15:15:31","modified_gmt":"2025-01-04T15:15:31","slug":"mondu-digital-trade-account","status":"publish","type":"plugin","link":"https:\/\/hat.wordpress.org\/plugins\/mondu-digital-trade-account\/","author":23180115,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.2.6","stable_tag":"0.2.6","tested":"6.7.5","requires":"6.7","requires_php":"7.4","requires_plugins":null,"header_name":"Mondu Trade Account","header_author":"ainsley.dev LTD","header_description":"WooCommerce Payment Gateway for integrating the Mondu Digital Trade Account.","assets_banners_color":"dedad8","last_updated":"2025-01-04 15:15:31","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/ainsleydev\/mondu-trade-woocommerce","header_author_uri":"https:\/\/ainsley.dev","rating":0,"author_block_rating":0,"active_installs":0,"downloads":678,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":{"0.2.3":{"tag":"0.2.3","author":"ainsleydev","date":"2025-01-04 11:07:48"},"0.2.4":{"tag":"0.2.4","author":"ainsleydev","date":"2025-01-04 13:36:39"},"0.2.5":{"tag":"0.2.5","author":"ainsleydev","date":"2025-01-04 13:44:07"},"0.2.6":{"tag":"0.2.6","author":"ainsleydev","date":"2025-01-04 15:15:31"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":3216903,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":3216903,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":3216903,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":3216879,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":3216879,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":{"mondu-trade\/trade-account-form":{"name":"mondu-trade\/trade-account-form","title":"Mondu Trade Account Form"}},"tagged_versions":["0.2.3","0.2.4","0.2.5","0.2.6"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1556,3148,236395,236394,286],"plugin_category":[45],"plugin_contributors":[236396],"plugin_business_model":[],"class_list":["post-213417","plugin","type-plugin","status-publish","hentry","plugin_tags-api","plugin_tags-checkout","plugin_tags-mondu","plugin_tags-trade-accounts","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-ainsleydev","plugin_committers-ainsleydev"],"banners":{"banner":"https:\/\/ps.w.org\/mondu-digital-trade-account\/assets\/banner-772x250.jpg?rev=3216879","banner_2x":"https:\/\/ps.w.org\/mondu-digital-trade-account\/assets\/banner-1544x500.jpg?rev=3216879","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/mondu-digital-trade-account\/assets\/icon.svg?rev=3216903","icon":"https:\/\/ps.w.org\/mondu-digital-trade-account\/assets\/icon.svg?rev=3216903","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>The Mondu Trade Account - WooCommerce plugin integrates Mondu's Digital Trade Account functionality into your WooCommerce store, allowing your customers to apply for and manage trade accounts directly during checkout.<\/p>\n\n<p><strong>Features:<\/strong>\n- <strong>Trade Account Applications<\/strong>: Let customers apply for a trade account while completing their order.\n- <strong>Webhook Integration<\/strong>: Automatically update customer statuses (e.g., accepted, pending, declined) when a customer has applied for a Digital Trade Account.\n- <strong>Custom Styling and Actions<\/strong>: Easily extend and customize the checkout experience with hooks and filters. Allows you to run actions when a buyer has been accepted or declined.\n- <strong>Admin Management Tools<\/strong>: Access customer trade account information, logs, and webhook settings from the WordPress admin panel.\n- <strong>Secure and Compliant<\/strong>: Fully supports WooCommerce standards and uses secure connections for API communication.<\/p>\n\n<p><strong>Useful Links:<\/strong>\n- <a href=\"https:\/\/github.com\/mondu-ai\/bnpl-checkout-woocommerce\">Official GitHub Repository<\/a>\n- <a href=\"https:\/\/github.com\/mondu-ai\/bnpl-checkout-woocommerce\/blob\/main\/changelog.txt\">Changelog<\/a><\/p>\n\n<h3>Prerequisites<\/h3>\n\n<p>Before installing and using the Mondu Trade Account - WooCommerce plugin, ensure your environment meets the following requirements:<\/p>\n\n<ul>\n<li><strong>WordPress<\/strong>: Requires at least version <code>6.7<\/code><\/li>\n<li><strong>PHP<\/strong>: Requires at least version <code>7.4<\/code><\/li>\n<li><strong>WooCommerce<\/strong>: Requires at least version <code>9.4<\/code><\/li>\n<li><strong>Mondu Plugin<\/strong>: Needs to be installed, tested version <code>3.0.3<\/code><\/li>\n<\/ul>\n\n<h3>Backwards Compatibility<\/h3>\n\n<p>This plugin has a direct dependency on the <code>Mondu Plugin<\/code>. Before updating both plugins, always test the new version on a staging environment to ensure compatibility with your customizations, integrations, and WooCommerce setup.<\/p>\n\n<h3>Buyer States<\/h3>\n\n<p>There are a total of 6 buyer states that a user can be in. If you are the admin of the WordPress install, you can change these states, but it's recommended not to.<\/p>\n\n\n\n\n  State\n  Explanation\n\n\n\n\n  <code>unknown<\/code>\n  The default status, when the customer hasn't signed up yet.\n\n\n  <code>applied<\/code>\n  Customer has tried to apply for a Trade Account, but the webhook hasn't been triggered.\n\n\n  <code>accepted<\/code>\n  Customer has been approved for a Trade Account and should have a buyer limit.\n\n\n  <code>pending<\/code>\n  Customer is waiting to hear from Mondu if their account has been accepted (Maximum of 48 hours).\n\n\n  <code>declined<\/code>\n  Customer has been flat-out refused credit from Mondu.\n\n\n  <code>cancelled<\/code>\n  Customer exited out of the Mondu Trade Application form.\n\n\n\n\n<h3>Sandbox<\/h3>\n\n<p>If you have sandbox mode set on the <code>Mondu<\/code> plugin, you can test the following states with the email addresses listed below. Note that if an email does not follow this convention, the trade application will fail.<\/p>\n\n<ul>\n<li><strong><code>Accepted<\/code><\/strong>: accepted.good.{random-string}@example.com<\/li>\n<li><strong><code>Pending<\/code><\/strong>: pending.pending-brc.{random-string}@example.com<\/li>\n<li><strong><code>Declined<\/code><\/strong>: declined.bad.{random-string}@example.com<\/li>\n<\/ul>\n\n<p>Note that emails are sent via the Mondu internal inbox in sandbox mode. To see them, it's best to reach out to Mondu.<\/p>\n\n<h3>Webhooks<\/h3>\n\n<p>Mondu sends buyer webhooks when a user has applied for a Trade Account. The following payload will be provided via this webhook once buyer onboarding requested is processed. See <a href=\"https:\/\/docs.mondu.ai\/reference\/webhooks-overview\">here<\/a> for more details.<\/p>\n\n<p>If the webhook fails, Mondu will send the webhook in increasing intervals until the <code>WebhookController<\/code> returns an <code>OK<\/code> response. Mondu will send <code>6<\/code> attempts every minute for all <code>buyer<\/code> and <code>order<\/code> topics until the handler responds with an OK status code.<\/p>\n\n<p><strong>Example Payload<\/strong>:<\/p>\n\n<pre><code>{\n  \"topic\": \"buyer\/{TOPIC_NAME}\",\n  \"buyer\": {\n    \"uuid\": \"66e8d234-23b5-1125-9592-d7390f20g01c\",\n    \"state\": \"accepted\",\n    \"external_reference_id\": \"DE-1-1000745773\",\n    \"company_name\": \"2023-02-07T15:14:22.301Z\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\"\n  }\n}\n<\/code><\/pre>\n\n<h3>Copyright<\/h3>\n\n<p>All rights reserved. This plugin and its code are proprietary to ainsley.dev LTD. Unauthorized copying, distribution, transmission, or storage of this plugin, its code, or content, in whole or in part, in any form or by any means, is strictly prohibited without prior written permission.<\/p>\n\n<p>This plugin is licensed for use by end-users on their WordPress sites but may not be copied, shared, modified, or redistributed in any form, except with explicit written permission from ainsley.dev LTD.<\/p>\n\n<!--section=installation-->\n<p>You can either download the zip file from the releases section or locate it on the WordPress Plugin install page.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id='is%20the%20plugin%20compatible%20with%20the%20wp%20block%20editor%3F'><h3>Is the plugin compatible with the WP block editor?<\/h3><\/dt>\n<dd><p>The Payment Gateway is not compatible, but the form is. See below for more details.<\/p><\/dd>\n<dt id='how%20do%20i%20allow%20for%20signups%20outside%20the%20checkout%3F'><h3>How do I allow for signups outside the checkout?<\/h3><\/dt>\n<dd><p>This plugin adds native support for allowing users to sign up to a Trade Account outside of the checkout. Perfect for CTA's or banners.<\/p>\n\n<p><strong>Note<\/strong>: The user must be logged in to perform this action, as a customer ID is required when Mondu responds to the Trade Account request. Before displaying the form, ensure your users are logged in by using the WordPress <code>is_user_logged_in()<\/code> function.<\/p>\n\n<p><strong>Block<\/strong>:\nYou can add the <code>Mondu Trade Account Form Block<\/code> to the block editor, which will output a dynamic form the user can use to sign up for the Trade Account.<\/p>\n\n<p><strong>Shortcode<\/strong>:\nIf you want to programmatically output the shortcode, you can do so by placing the following code in your page template:<\/p>\n\n<pre><code>echo do_shortcode('[mondu_trade_account_form]');\n<\/code><\/pre><\/dd>\n<dt id='how%20do%20i%20know%20what%20the%20status%20is%20of%20a%20customer%3F'><h3>How do I know what the status is of a customer?<\/h3><\/dt>\n<dd><p>Simply go to the user's account on WordPress by navigating to <code>Users<\/code> and click on a customer. From there, you should see the following fields:<\/p>\n\n<ul>\n<li><code>uuid<\/code> -&gt; The external UUID that's been assigned from Mondu.<\/li>\n<li><code>status<\/code> -&gt; The buyer status which can be one of <code>unknown<\/code>, <code>accepted<\/code>, <code>pending<\/code>, or <code>declined<\/code>.<\/li>\n<\/ul><\/dd>\n<dt id='when%20will%20mondu%20send%20emails%20to%20the%20customer%3F'><h3>When will Mondu send emails to the customer?<\/h3><\/dt>\n<dd><ul>\n<li>After the buyer authorizes the onboarding process in the hosted checkout page.<\/li>\n<li>Status change to accepted triggers a webhook attempt, and the email communication is sent.<\/li>\n<li>Status change to declined triggers a webhook, and the declined email is sent.<\/li>\n<\/ul>\n\n<p><strong>It's recommended you still add email triggers for webhooks<\/strong>, as described below.<\/p><\/dd>\n<dt id='how%20do%20i%20add%20custom%20styling%20to%20the%20payment%20gateway%3F'><h3>How do I add custom styling to the payment gateway?<\/h3><\/dt>\n<dd><p>There may be times you want to style the checkout gateway with your own styles. To do this, you can either latch onto the default class name <code>mondu-trade<\/code> or provide your own using a filter.<\/p>\n\n<p>An example of this is below:<\/p>\n\n<pre><code>\/**\n * Adds a custom class to the Mondu Trade Account checkout gateway.\n *\n * @param string $class The existing CSS class for the Mondu Trade Account checkout gateway.\n * @return string The modified CSS class with the custom class name appended.\n *\/\nfunction add_custom_mondu_trade_account_class($class) {\n    return $class . ' my-class-name';\n}\n\nadd_filter('mondu_trade_account_checkout_class', 'add_custom_mondu_trade_account_class');\n<\/code><\/pre><\/dd>\n<dt id='how%20can%20i%20get%20a%20buyer%20status%20of%20a%20user%3F'><h3>How can I get a buyer status of a user?<\/h3><\/dt>\n<dd><p>You can use the <code>mondu_trade_get_buyer_status<\/code> function to fetch the current status of a customer. This function will throw a <code>MonduTradeException<\/code> if the provided customer ID is invalid. Ensure to handle exceptions properly when calling this function.<\/p>\n\n<p><strong>Parameters:<\/strong>\n- <code>$customer_id (int)<\/code>: The ID of the customer whose status you want to retrieve.<\/p>\n\n<p><strong>Returns<\/strong>:\n- <code>string<\/code>: The current Mondu Trade Account status of the customer.<\/p>\n\n<p><strong>Throws<\/strong>:\n- <code>MonduTradeException<\/code>: If the customer ID is not valid.<\/p>\n\n<p><strong>Example<\/strong>:\n    status = mondu_trade_get_buyer_status($customer_id);<\/p><\/dd>\n<dt id='how%20can%20i%20get%20a%20buyer%20limit%20of%20a%20user%3F'><h3>How can I get a buyer limit of a user?<\/h3><\/dt>\n<dd><p>You can use the <code>mondu_trade_get_buyer_limit<\/code> function to fetch the buyer limit for a customer. This function will throw a <code>MonduTradeException<\/code> if the provided customer ID is invalid or if the buyer status is not <code>accepted<\/code>. Ensure to handle exceptions properly when calling this function.<\/p>\n\n<p><strong>Parameters:<\/strong>\n- <code>$customer_id (int)<\/code>: The ID of the customer whose buyer limit you want to retrieve.<\/p>\n\n<p><strong>Returns<\/strong>:\n- <code>array<\/code>: An associative array containing the buyer limit details.<\/p>\n\n<p><strong>Throws<\/strong>:\n- <code>MonduTradeException<\/code>: If the customer ID is not valid or the buyer status is not <code>accepted<\/code>.<\/p>\n\n<p><strong>Example<\/strong>:\n     $buyer_limit = mondu_trade_get_buyer_limit($customer_id);<\/p>\n\n<p><strong>Sample Output<\/strong>:<\/p>\n\n<pre><code>Array (\n    [purchasing_limit] =&gt; Array (\n        [purchasing_limit_cents] =&gt; 100000\n        [balance_cents] =&gt; 10000\n        [max_purchase_value_cents] =&gt; 90000\n        [max_collections_state] =&gt; no\n    )\n)\n<\/code><\/pre><\/dd>\n<dt id='how%20can%20i%20run%20actions%20when%20a%20buyer%20status%20has%20changed%3F'><h3>How can I run actions when a buyer status has changed?<\/h3><\/dt>\n<dd><p>There are 4 different actions you can latch onto when Mondu replies with an update after a customer has applied for a Digital Trade Account. Below is a list of available actions.<\/p>\n\n<p><strong>Actions<\/strong>:\n- <code>mondu_trade_buyer_webhook_received<\/code>\n- <code>mondu_trade_buyer_accepted<\/code>\n- <code>mondu_trade_buyer_pending<\/code>\n- <code>mondu_trade_buyer_declined<\/code><\/p>\n\n<p><strong>Example Payload<\/strong>:<\/p>\n\n<pre><code>{\n  \"topic\": \"buyer\/{TOPIC_NAME}\",\n  \"buyer\": {\n    \"uuid\": \"66e8d234-23b5-1125-9592-d7390f20g01c\",\n    \"state\": \"accepted\",\n    \"external_reference_id\": \"DE-1-1000745773\",\n    \"company_name\": \"2023-02-07T15:14:22.301Z\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\"\n  }\n}\n<\/code><\/pre>\n\n<p><strong>Example for <code>mondu_trade_buyer_accepted<\/code><\/strong>:<\/p>\n\n<pre><code>add_action('mondu_trade_buyer_accepted', function ($customer_id, $buyer) {\n    \/\/ Handle accepted status\n});\n<\/code><\/pre><\/dd>\n\n<\/dl>","raw_excerpt":"Integrates Mondu&#039;s Digital Trade Account functionality into WooCommerce, enabling customers to apply for trade accounts during checkout.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/213417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=213417"}],"author":[{"embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ainsleydev"}],"wp:attachment":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=213417"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=213417"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=213417"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=213417"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=213417"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=213417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}