{"id":690,"date":"2023-10-22T12:41:55","date_gmt":"2023-10-22T12:41:55","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=690"},"modified":"2023-10-22T12:41:56","modified_gmt":"2023-10-22T12:41:56","slug":"paypal-donations-2","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/paypal-donations-2\/","title":{"rendered":"Donations via PayPal Shortcode"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Donations via PayPal Shortcode<\/strong> to your WordPress website, including its <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Donations via PayPal Plugin shortcode not to show or not to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, here is an overview of the Donations via PayPal Plugin and the shortcodes it provides:<\/p>\n\n\n<p>    <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/paypal-donations\/assets\/icon.svg?rev=994082\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/paypal-donations-2\" target=\"_blank\" rel=\"noopener\">\n                        Donations via PayPal                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Donations via PayPal is a versatile WordPress plugin that simplifies the process of receiving donations on your site. It seamlessly integrates PayPal gateway for secure and efficient transactions.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2606<\/span> (24)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 30000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: false            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Donations via PayPal [paypal-donation] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The PayPal Donation shortcode allows users to generate a PayPal donation button with customizable parameters. The shortcode: [paypal-donation] can be modified to include specific purpose, reference, amount, return page, button URL, and IPN validation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[null]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible null shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>purpose<\/code> &#8211; Defines the reason for the donation<\/li>\n<li><code>reference<\/code> &#8211; Adds a unique reference for the donation<\/li>\n<li><code>amount<\/code> &#8211; Specifies the donation amount<\/li>\n<li><code>return_page<\/code> &#8211; Page to redirect donors after donation<\/li>\n<li><code>button_url<\/code> &#8211; URL of the PayPal button image<\/li>\n<li><code>validate_ipn<\/code> &#8211; Enables IPN validation for secure transactions<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; A simple PayPal donation request without any custom parameters.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Specifying a purpose for the donation. This will be displayed on the PayPal payment page.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation purpose=\"Support our cause\" \/]<\/code><\/pre>\n\n\n<p>Adding a reference to the donation. This could be used to track donations from different sources or campaigns.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation reference=\"Campaign1\" \/]<\/code><\/pre>\n\n\n<p>Pre-filling the donation amount. This can be used to suggest a donation amount to the user.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation amount=\"25\" \/]<\/code><\/pre>\n\n\n<p>Redirecting the user to a specific page after they have made a donation. This could be a thank you page or a page with more information about how their donation will be used.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation return_page=\"https:\/\/yourwebsite.com\/thank-you\" \/]<\/code><\/pre>\n\n\n<p>Using a custom button for the donation link. This can be used to match the style of your website or to provide a more engaging call to action.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation button_url=\"https:\/\/yourwebsite.com\/custom-button.png\" \/]<\/code><\/pre>\n\n\n<p>Enabling IPN validation. This can be used to verify that the donation was successfully processed by PayPal.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation validate_ipn=\"true\" \/]<\/code><\/pre>\n\n\n<p>Combining multiple parameters. This example shows a donation request with a specific purpose, pre-filled amount, custom button, and return page.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[paypal-donation purpose=\"Support our cause\" amount=\"25\" button_url=\"https:\/\/yourwebsite.com\/custom-button.png\" return_page=\"https:\/\/yourwebsite.com\/thank-you\" \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[null]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode('paypal-donation', array(&amp;$this,'paypalShortcode'));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction paypalShortcode($atts)\n    {\n        extract(\n            shortcode_atts(\n                array(\n                    &#039;purpose&#039; =&gt; &#039;&#039;,\n                    &#039;reference&#039; =&gt; &#039;&#039;,\n                    &#039;amount&#039; =&gt; &#039;&#039;,\n                    &#039;return_page&#039; =&gt; &#039;&#039;,\n                    &#039;button_url&#039; =&gt; &#039;&#039;,\n                    &#039;validate_ipn&#039; =&gt; &#039;&#039;,\n                ),\n                $atts\n            )\n        );\n\n        return $this-&gt;generateHtml(\n            $purpose,\n            $reference,\n            $amount,\n            $return_page,\n            $button_url,\n            $validate_ipn\n        );\n    }\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">paypal-donations\/paypal-donations\/paypal-donations.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Donations via PayPal Plugin shortcode<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Donations via PayPal Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Donations via PayPal Plugin shortcode not to show or not to work correctly. Before starting, here is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Donations via PayPal","slug":"","version":"1.9.10","author":"<a href=\"https:\/\/www.tipsandtricks-hq.com\/\">Tips and Tricks HQ, Johan Steen<\/a>","icons":"https:\/\/ps.w.org\/paypal-donations\/assets\/icon.svg?rev=994082","plugin_tags":"{\"donation\":\"donation\",\"donations\":\"donations\",\"paypal\":\"paypal\",\"shortcode\":\"shortcode\",\"widget\":\"widget\"}","author_profile":"https:\/\/profiles.wordpress.org\/mra13\/","requires":"5.5","tested":"6.3.2","requires_php":"false","rating":96,"num_ratings":24,"active_installs":30000,"downloaded":912468,"last_updated":"2023-07-25 2:50am GMT","added":"2009-05-08","homepage":"https:\/\/www.tipsandtricks-hq.com\/paypal-donations-widgets-plugin","short_description":"Easy, simple setup to add a PayPal Donation button as a Widget or with a shortcode.","description":"\"Donations via PayPal is a versatile WordPress plugin that simplifies the process of receiving donations on your site. It seamlessly integrates PayPal gateway for secure and efficient transactions.\"","shortcodes":"[null]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-690","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=690"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/690\/revisions"}],"predecessor-version":[{"id":830,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/690\/revisions\/830"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}