{"id":917,"date":"2015-10-14T16:42:41","date_gmt":"2015-10-14T16:42:41","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=917"},"modified":"2024-07-08T18:06:31","modified_gmt":"2024-07-08T18:06:31","slug":"paypal-pro-payment-gateway-integration-in-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/","title":{"rendered":"PayPal Pro Payment Gateway Integration in PHP"},"content":{"rendered":"<p>If you are working on an eCommerce project and concerned about the payment gateway for accepting credit cards, then <b>PayPal Payments Pro<\/b> could be the best option for you. The main advantages of PayPal Pro are that customers don&#8217;t need to leave your site for making payment. The customer can make credit card payments within your site and without any PayPal account.<\/p>\n<p>PayPal Payments Pro provides a powerful and customizable solution to accept credit card payments in the web application. Website Payments Pro API allows you to accept credit and debit cards directly on the website. In this tutorial, we will show how to integrate <b>PayPal Pro payment gateway in PHP<\/b> with PayPal DoDirectPayment API. With the PayPal Pro payment gateway integration, you will be able to collect payment online from the buyer using a credit card or debit card.<\/p>\n<p><u>Since the PayPal Payments Pro is on the Legacy version, we recommended integrating <a href=\"https:\/\/www.codexworld.com\/paypal-advanced-checkout-card-payments-integration-in-php\/\">PayPal Advanced Checkout Card Payments<\/a> for the new payment gateway integration.<\/u><\/p>\n<h2>Create PayPal Sandbox Account<\/h2>\n<p>Before start accepting payment via PayPal Pro payment gateway, the payment process needs to be tested. To test the transaction process with PayPal a sandbox account needs to be created on the PayPal Developer account. PayPal sandbox account allows you to test the transaction before making the payment gateway live on the production server.<\/p>\n<p>First, create a PayPal sandbox account. You will get the API credentials in your sandbox Business account. To integrate the PayPal Pro payment gateway API your business account must be Website Payments Pro account. If you want to use a credit card as a payment method in your test transactions, you must configure a sandbox Business account as a Website Payments Pro account.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>See this detailed guide to create a PayPal website payments pro sandbox account &#8211; <a href=\"https:\/\/www.codexworld.com\/how-to\/create-paypal-payments-pro-sandbox-business-account\/\">How to Create PayPal Payments Pro Sandbox Business Account<\/a><\/li>\n<\/ul>\n<p>Once the PayPal business pro account creation is completed, you will get the <b>NVP\/SOAP Sandbox API Credentials<\/b> under the <b>API Credentials<\/b> tab.<\/p>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld.png\" alt=\"paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld\" width=\"941\" height=\"733\" class=\"alignnone size-full wp-image-5300\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld.png 941w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld-300x234.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld-768x598.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld-350x273.png 350w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld-320x249.png 320w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2023\/03\/paypal-sandbox-payments-pro-nvp-soap-api-credentials-codexworld-380x296.png 380w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/div>\n<p>You need to specify the API credentials at the time of PayPal DoDirectPayment API operations. Copy the API credentials (<b>Username<\/b>, <b>Password<\/b>, and <b>Signature<\/b>) for later use in the script.<\/p>\n<p>Before getting started to implement <b>PayPal Pro payment gateway in PHP<\/b>, take a look at the files structure.<\/p>\n<pre class=\"file-struc\">paypal_pro_integration_php<span style=\"color:#794938\">\/<\/span>\r\n\u251c\u2500\u2500 config.php\r\n\u251c\u2500\u2500 dbConnect.php\r\n\u251c\u2500\u2500 index.php\r\n\u251c\u2500\u2500 payment_process.php\r\n\u251c\u2500\u2500 PaypalPro.class.php\r\n\u251c\u2500\u2500 js<span style=\"color:#794938\">\/<\/span>\r\n\u2502   \u251c\u2500\u2500 jquery.min.js\r\n\u2502   \u2514\u2500\u2500 creditCardValidator.js\r\n\u2514\u2500\u2500 css<span style=\"color:#794938\">\/<\/span>\r\n    \u2514\u2500\u2500 style.css\r\n<\/pre>\n<h2>Create Database Table<\/h2>\n<p>To store the transaction details, a table is required in the database. The following SQL creates a <code>transactions<\/code> table with some basic fields in the MySQL database.<\/p>\n<pre style=\"color: rgb(0, 0, 0);\"><span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`transactions`<\/span> (\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">11<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span> AUTO_INCREMENT,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`item_number`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`item_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">255<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`item_price`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">float<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">10<\/span>,<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">2<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`item_price_currency`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">10<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">'usd'<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`buyer_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`buyer_email`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`card_num`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">bigint<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">20<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`card_exp_month`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">2<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`card_exp_year`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">5<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`paid_amount`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">10<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`paid_amount_currency`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">10<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`txn_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">50<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`payment_status`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(0, 134, 179);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(64, 160, 112);\">25<\/span>) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span> utf8_unicode_ci <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`created`<\/span> datetime <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">current_timestamp<\/span>(),\r\n  <span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`modified`<\/span> datetime <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(149, 65, 33);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">current_timestamp<\/span>(),\r\n  PRIMARY <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(33, 145, 97);\">`id`<\/span>)\r\n) <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"color: rgb(149, 65, 33);\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<h2>PaypalPro Library (PaypalPro.class.php)<\/h2>\n<p>The PaypalPro class is a custom library that handles PayPal DoDirectPayment API operations with PHP.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/** <br \/>&nbsp;*&nbsp;PaypalPro&nbsp;Class <br \/>&nbsp;*&nbsp;Helps&nbsp;to&nbsp;make&nbsp;credit&nbsp;card&nbsp;payment&nbsp;by&nbsp;PayPal&nbsp;Payments&nbsp;Pro <br \/>&nbsp;*&nbsp; <br \/>&nbsp;*&nbsp;Author:&nbsp;CodexWorld <br \/>&nbsp;*&nbsp;Author&nbsp;Email:&nbsp;admin@codexworld.com <br \/>&nbsp;*&nbsp;Author&nbsp;URL:&nbsp;http:\/\/www.codexworld.com <br \/>&nbsp;*&nbsp;Licence:&nbsp;https:\/\/www.codexworld.com\/license\/ <br \/>&nbsp;*\/ <br \/><\/span><span style=\"color: #007700\">class&nbsp;<\/span><span style=\"color: #0000BB\">PaypalPro <br \/><\/span><span style=\"color: #007700\">{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/Configuration&nbsp;Options <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">var&nbsp;<\/span><span style=\"color: #0000BB\">$apiUsername&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">PAYPAL_API_USERNAME<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$apiPassword&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">PAYPAL_API_PASSWORD<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$apiSignature&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">PAYPAL_API_SIGNATURE<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$apiEndpoint&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;(<\/span><span style=\"color: #0000BB\">PAYPAL_SANDBOX&nbsp;<\/span><span style=\"color: #007700\">==&nbsp;<\/span><span style=\"color: #0000BB\">TRUE<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #DD0000\">'https:\/\/api-3t.sandbox.paypal.com\/nvp'<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">'https:\/\/api-3t.paypal.com\/nvp'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$subject&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$authToken&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$authSignature&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$authTimestamp&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$useProxy&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">FALSE<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$proxyHost&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'127.0.0.1'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$proxyPort&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">808<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$version&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'65.1'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$ackSuccess&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'SUCCESS'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;<\/span><span style=\"color: #0000BB\">$ackSuccessWarning&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'SUCCESSWITHWARNING'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">__construct<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$config&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array()){&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">ob_start<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">session_start<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(<\/span><span style=\"color: #0000BB\">count<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$config<\/span><span style=\"color: #007700\">)&nbsp;&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(<\/span><span style=\"color: #0000BB\">$config&nbsp;<\/span><span style=\"color: #007700\">as&nbsp;<\/span><span style=\"color: #0000BB\">$key&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$val<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">$key<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">$key&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$val<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">nvpHeader<\/span><span style=\"color: #007700\">(){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpHeaderStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if((!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiUsername<\/span><span style=\"color: #007700\">))&nbsp;&amp;&amp;&nbsp;(!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiPassword<\/span><span style=\"color: #007700\">))&nbsp;&amp;&amp;&nbsp;(!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiSignature<\/span><span style=\"color: #007700\">))&nbsp;&amp;&amp;&nbsp;(!empty(<\/span><span style=\"color: #0000BB\">$subject<\/span><span style=\"color: #007700\">)))&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$authMode&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"THIRDPARTY\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else&nbsp;if((!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiUsername<\/span><span style=\"color: #007700\">))&nbsp;&amp;&amp;&nbsp;(!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiPassword<\/span><span style=\"color: #007700\">))&nbsp;&amp;&amp;&nbsp;(!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiSignature<\/span><span style=\"color: #007700\">)))&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$authMode&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"3TOKEN\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}elseif&nbsp;(!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authToken<\/span><span style=\"color: #007700\">)&nbsp;&amp;&amp;&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authSignature<\/span><span style=\"color: #007700\">)&nbsp;&amp;&amp;&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authTimestamp<\/span><span style=\"color: #007700\">))&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$authMode&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"PERMISSION\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}elseif(!empty(<\/span><span style=\"color: #0000BB\">$subject<\/span><span style=\"color: #007700\">))&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$authMode&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"FIRSTPARTY\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch(<\/span><span style=\"color: #0000BB\">$authMode<\/span><span style=\"color: #007700\">)&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<\/span><span style=\"color: #DD0000\">\"3TOKEN\"&nbsp;<\/span><span style=\"color: #007700\">:&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpHeaderStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"&amp;PWD=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiPassword<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">\"&amp;USER=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiUsername<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">\"&amp;SIGNATURE=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiSignature<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<\/span><span style=\"color: #DD0000\">\"FIRSTPARTY\"&nbsp;<\/span><span style=\"color: #007700\">: <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpHeaderStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"&amp;SUBJECT=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">subject<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<\/span><span style=\"color: #DD0000\">\"THIRDPARTY\"&nbsp;<\/span><span style=\"color: #007700\">: <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpHeaderStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"&amp;PWD=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiPassword<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">\"&amp;USER=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiUsername<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">\"&amp;SIGNATURE=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiSignature<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">\"&amp;SUBJECT=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$subject<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<\/span><span style=\"color: #DD0000\">\"PERMISSION\"&nbsp;<\/span><span style=\"color: #007700\">: <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpHeaderStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">formAutorization<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authToken<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authSignature<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authTimestamp<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">$nvpHeaderStr<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/** <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;hashCall:&nbsp;Function&nbsp;to&nbsp;perform&nbsp;the&nbsp;API&nbsp;call&nbsp;to&nbsp;PayPal&nbsp;using&nbsp;API&nbsp;signature <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@methodName&nbsp;is&nbsp;name&nbsp;of&nbsp;API&nbsp;&nbsp;method. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@nvpStr&nbsp;is&nbsp;nvp&nbsp;string. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;returns&nbsp;an&nbsp;associtive&nbsp;array&nbsp;containing&nbsp;the&nbsp;response&nbsp;from&nbsp;the&nbsp;server. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;*\/ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">hashCall<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$methodName<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$nvpStr<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;form&nbsp;header&nbsp;string <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpheader&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">nvpHeader<\/span><span style=\"color: #007700\">(); <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/setting&nbsp;the&nbsp;curl&nbsp;parameters. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$ch&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">curl_init<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_URL<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">apiEndpoint<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_VERBOSE<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/turning&nbsp;off&nbsp;the&nbsp;server&nbsp;and&nbsp;peer&nbsp;verification(TrustManager&nbsp;Concept). <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_SSL_VERIFYPEER<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">FALSE<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_SSL_VERIFYHOST<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">FALSE<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_RETURNTRANSFER<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_POST<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/in&nbsp;case&nbsp;of&nbsp;permission&nbsp;APIs&nbsp;send&nbsp;headers&nbsp;as&nbsp;HTTPheders <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authToken<\/span><span style=\"color: #007700\">)&nbsp;&amp;&amp;&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authSignature<\/span><span style=\"color: #007700\">)&nbsp;&amp;&amp;&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">authTimestamp<\/span><span style=\"color: #007700\">)) <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$headers_array<\/span><span style=\"color: #007700\">[]&nbsp;=&nbsp;<\/span><span style=\"color: #DD0000\">\"X-PP-AUTHORIZATION:&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$nvpheader<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_HTTPHEADER<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$headers_array<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_HEADER<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">false<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$nvpheader<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$nvpStr<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/if&nbsp;USE_PROXY&nbsp;constant&nbsp;set&nbsp;to&nbsp;TRUE&nbsp;in&nbsp;Constants.php,&nbsp;then&nbsp;only&nbsp;proxy&nbsp;will&nbsp;be&nbsp;enabled. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/Set&nbsp;proxy&nbsp;name&nbsp;to&nbsp;PROXY_HOST&nbsp;and&nbsp;port&nbsp;number&nbsp;to&nbsp;PROXY_PORT&nbsp;in&nbsp;constants.php&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">useProxy<\/span><span style=\"color: #007700\">) <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt&nbsp;<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">CURLOPT_PROXY<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">proxyHost<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\":\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">proxyPort<\/span><span style=\"color: #007700\">);&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/check&nbsp;if&nbsp;version&nbsp;is&nbsp;included&nbsp;in&nbsp;$nvpStr&nbsp;else&nbsp;include&nbsp;the&nbsp;version. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">str_replace<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'VERSION='<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">strtoupper<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpStr<\/span><span style=\"color: #007700\">)))&nbsp;==&nbsp;<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpStr<\/span><span style=\"color: #007700\">))&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"&amp;VERSION=\"&nbsp;<\/span><span style=\"color: #007700\">.&nbsp;<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">version<\/span><span style=\"color: #007700\">)&nbsp;.&nbsp;<\/span><span style=\"color: #0000BB\">$nvpStr<\/span><span style=\"color: #007700\">;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpreq<\/span><span style=\"color: #007700\">=<\/span><span style=\"color: #DD0000\">\"METHOD=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">urlencode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$methodName<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #0000BB\">$nvpStr<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/setting&nbsp;the&nbsp;nvpreq&nbsp;as&nbsp;POST&nbsp;FIELD&nbsp;to&nbsp;curl <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_setopt<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">CURLOPT_POSTFIELDS<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$nvpreq<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/getting&nbsp;response&nbsp;from&nbsp;server <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$response&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">curl_exec<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/convrting&nbsp;NVPResponse&nbsp;to&nbsp;an&nbsp;Associative&nbsp;Array <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpResArray&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">deformatNVP<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$response<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpReqArray&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">deformatNVP<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpreq<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$_SESSION<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'nvpReqArray'<\/span><span style=\"color: #007700\">]=<\/span><span style=\"color: #0000BB\">$nvpReqArray<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(<\/span><span style=\"color: #0000BB\">curl_errno<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">))&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(<\/span><span style=\"color: #DD0000\">\"CURL&nbsp;send&nbsp;a&nbsp;error&nbsp;during&nbsp;perform&nbsp;operation:&nbsp;\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">curl_error<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">)); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/closing&nbsp;the&nbsp;curl <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">curl_close<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$ch<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">$nvpResArray<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/**&nbsp;This&nbsp;function&nbsp;will&nbsp;take&nbsp;NVPString&nbsp;and&nbsp;convert&nbsp;it&nbsp;to&nbsp;an&nbsp;Associative&nbsp;Array&nbsp;and&nbsp;it&nbsp;will&nbsp;decode&nbsp;the&nbsp;response. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;It&nbsp;is&nbsp;usefull&nbsp;to&nbsp;search&nbsp;for&nbsp;a&nbsp;particular&nbsp;key&nbsp;and&nbsp;displaying&nbsp;arrays. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@nvpstr&nbsp;is&nbsp;NVPString. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@nvpArray&nbsp;is&nbsp;Associative&nbsp;Array. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">deformatNVP<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$intial<\/span><span style=\"color: #007700\">=<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpArray&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/postion&nbsp;of&nbsp;Key <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$keypos&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">strpos<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #DD0000\">'='<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/position&nbsp;of&nbsp;value <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$valuepos&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">strpos<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #DD0000\">'&amp;'<\/span><span style=\"color: #007700\">)&nbsp;?&nbsp;<\/span><span style=\"color: #0000BB\">strpos<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #DD0000\">'&amp;'<\/span><span style=\"color: #007700\">):&nbsp;<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/*getting&nbsp;the&nbsp;Key&nbsp;and&nbsp;Value&nbsp;values&nbsp;and&nbsp;storing&nbsp;in&nbsp;a&nbsp;Associative&nbsp;Array*\/ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$keyval&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">substr<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$intial<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$keypos<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$valval&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">substr<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$keypos<\/span><span style=\"color: #007700\">+<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$valuepos<\/span><span style=\"color: #007700\">-<\/span><span style=\"color: #0000BB\">$keypos<\/span><span style=\"color: #007700\">-<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/decoding&nbsp;the&nbsp;respose <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpArray<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">urldecode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$keyval<\/span><span style=\"color: #007700\">)]&nbsp;=<\/span><span style=\"color: #0000BB\">urldecode<\/span><span style=\"color: #007700\">(&nbsp;<\/span><span style=\"color: #0000BB\">$valval<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpstr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">substr<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$valuepos<\/span><span style=\"color: #007700\">+<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">strlen<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">)); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">$nvpArray<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">formAutorization<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$auth_token<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$auth_signature<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$auth_timestamp<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$authString<\/span><span style=\"color: #007700\">=<\/span><span style=\"color: #DD0000\">\"token=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$auth_token<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\",signature=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$auth_signature<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\",timestamp=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$auth_timestamp&nbsp;<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">$authString<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;<\/span><span style=\"color: #0000BB\">paypalCall<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/* <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Construct&nbsp;the&nbsp;request&nbsp;string&nbsp;that&nbsp;will&nbsp;be&nbsp;sent&nbsp;to&nbsp;PayPal. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;variable&nbsp;$nvpstr&nbsp;contains&nbsp;all&nbsp;the&nbsp;variables&nbsp;and&nbsp;is&nbsp;a <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;name&nbsp;value&nbsp;pair&nbsp;string&nbsp;with&nbsp;&amp;&nbsp;as&nbsp;a&nbsp;delimiter <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*\/ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/payment&nbsp;details&nbsp;item&nbsp;fields <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$itemStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'itemName'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #DD0000\">'&amp;L_NAMEn='<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'itemName'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$itemStr&nbsp;<\/span><span style=\"color: #007700\">.=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'itemNumber'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #DD0000\">'&amp;L_NUMBERn='<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'itemNumber'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/indicate&nbsp;a&nbsp;recurring&nbsp;transaction <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$recurringStr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;(<\/span><span style=\"color: #0000BB\">array_key_exists<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"recurring\"<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">)&nbsp;&amp;&amp;&nbsp;<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'recurring'<\/span><span style=\"color: #007700\">]&nbsp;==&nbsp;<\/span><span style=\"color: #DD0000\">'Y'<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #DD0000\">'&amp;RECURRING=Y'<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nvpstr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"&amp;PAYMENTACTION=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'paymentAction'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;AMT=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'amount'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;CREDITCARDTYPE=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'creditCardType'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;ACCT=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'creditCardNumber'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;EXPDATE=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'expMonth'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'expYear'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;CVV2=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'cvv'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;FIRSTNAME=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'firstName'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;LASTNAME=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'lastName'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;CITY=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'city'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;ZIP=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'zip'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;COUNTRYCODE=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'countryCode'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">\"&amp;CURRENCYCODE=\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$params<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'currencyCode'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #0000BB\">$itemStr<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$recurringStr<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/*&nbsp;Make&nbsp;the&nbsp;API&nbsp;call&nbsp;to&nbsp;PayPal,&nbsp;using&nbsp;API&nbsp;signature. <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;API&nbsp;response&nbsp;is&nbsp;stored&nbsp;in&nbsp;an&nbsp;associative&nbsp;array&nbsp;called&nbsp;$resArray&nbsp;*\/ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$resArray&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$this<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">hashCall<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"DoDirectPayment\"<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">$nvpstr<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;<\/span><span style=\"color: #0000BB\">$resArray<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>} <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<h2>Site Settings and API Configuration (config.php)<\/h2>\n<p>In the <code>config.php<\/code> file, product details, PayPal API credentials, and database settings constant variables are defined.<br \/>\n<b>Product details:<\/b><\/p>\n<ul class=\"bullet_disk_list\">\n<li><code>$itemName<\/code> &#8211; Specify product name.<\/li>\n<li><code>$itemNumber<\/code> &#8211; Specify product number.<\/li>\n<li><code>$payableAmount<\/code> &#8211; Specify product price.<\/li>\n<li><code>$currency<\/code> &#8211; Specify currency code.<\/li>\n<\/ul>\n<p><b>PayPal API constants:<\/b><\/p>\n<ul class=\"bullet_disk_list\">\n<li>PAYPAL_API_USERNAME &#8211; Specify the API username of the PayPal Business Pro account.<\/li>\n<li>PAYPAL_API_PASSWORD &#8211; Specify the API password of the PayPal Business Pro account.<\/li>\n<li>PAYPAL_API_SIGNATURE &#8211; Specify the API signature of the PayPal Business Pro account.<\/li>\n<li>PAYPAL_SANDBOX &#8211; Specify whether you use Sandbox environment (TRUE\/FALSE).<\/li>\n<\/ul>\n<p><b>Database constants:<\/b><\/p>\n<ul class=\"bullet_disk_list\">\n<li>DB_HOST &#8211; Specify the database host.<\/li>\n<li>DB_USERNAME &#8211; Specify the database username.<\/li>\n<li>DB_PASSWORD &#8211; Specify the database password.<\/li>\n<li>DB_NAME &#8211; Specify the database name.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Product&nbsp;details <br \/><\/span><span style=\"color: #0000BB\">$itemName&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"Demo&nbsp;Product\"<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$itemNumber&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"P123456\"<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$payableAmount&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">25<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$currency&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"USD\"<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;PayPal&nbsp;NVP\/SOAP&nbsp;API&nbsp;Credentials <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_API_USERNAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'API_Username'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_API_PASSWORD'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'API_Password'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_API_SIGNATURE'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'API_Signature'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_SANDBOX'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">TRUE<\/span><span style=\"color: #007700\">);&nbsp;<\/span><span style=\"color: #FF8000\">\/\/TRUE=Sandbox&nbsp;or&nbsp;FALSE=Production <br \/> <br \/>\/\/&nbsp;Database&nbsp;configuration <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_HOST'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Host'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_USERNAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Username'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_PASSWORD'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Password'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_NAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Name'<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<h2>Database Connection (dbConnect.php)<\/h2>\n<p>The <code>dbConnect.php<\/code> file is used to connect the database using PHP and MySQL.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Connect&nbsp;with&nbsp;the&nbsp;database <br \/><\/span><span style=\"color: #0000BB\">$db&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">mysqli<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">DB_HOST<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">DB_USERNAME<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">DB_PASSWORD<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">DB_NAME<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Display&nbsp;error&nbsp;if&nbsp;failed&nbsp;to&nbsp;connect <br \/><\/span><span style=\"color: #007700\">if&nbsp;(<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_errno<\/span><span style=\"color: #007700\">)&nbsp;{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">printf<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"Connect&nbsp;failed:&nbsp;%s\\n\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;exit(); <br \/>} <br \/> <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<h2>PayPal Pro Checkout Form (index.php)<\/h2>\n<p><b>Credit Card Form:<\/b><br \/>\nInitially, an HTML form is provided to input the credit card information (Card Number, Expiration Date, CVC Number, Card Holder Name, and Email). Also, the product name and price are displayed at the top of the form.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php\r\n<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;configuration&nbsp;file\r\n<\/span><span style=\"color: #007700\">include_once&nbsp;<\/span><span style=\"color: #DD0000\">'config.php'<\/span><span style=\"color: #007700\">;\r\n<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n\r\n<span style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"paymentSection\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span> <span class=\"hljs-attr\">method<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"post\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"paymentForm\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>Item: <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$itemName<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>Payable amount: <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span>$<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$payableAmount<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$currency<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">ul<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>Card Number<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"1234 5678 9012 3456\"<\/span> <span class=\"hljs-attr\">maxlength<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"20\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card_number\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card_number\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"vertical\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">ul<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>Expiry Month<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"MM\"<\/span> <span class=\"hljs-attr\">maxlength<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"2\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"expiry_month\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"expiry_month\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>Expiry Year<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"YYYY\"<\/span> <span class=\"hljs-attr\">maxlength<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"4\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"expiry_year\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"expiry_year\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>CVV<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"123\"<\/span> <span class=\"hljs-attr\">maxlength<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"4\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"cvv\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"cvv\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">ul<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>Name on card<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"John Doe\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"name_on_card\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"name_on_card\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>Email<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"user@example.com\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"email\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"email\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"hidden\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card_type\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card_type\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"\"<\/span>\/&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"button\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card_submit\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"cardSubmitBtn\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"Proceed\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"payment-btn\"<\/span> <span class=\"hljs-attr\">disabled<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"true\"<\/span> &gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">ul<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/span>\r\n<\/pre>\n<p><b>jQuery Library:<\/b><br \/>\nWe will use jQuery to process card payment without page refresh. So, include the jQuery library first.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.6.3\/jquery.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<p><b>Card Form Validation:<\/b><br \/>\nTo validate credit card number we will use <a href=\"https:\/\/www.codexworld.com\/credit-card-number-validation-jquery\/\">Credit Card Validator jQuery plugin<\/a>, so include the creditCardValidator.js library.<\/p>\n<pre style=\"color: rgb(110, 107, 94);\"><span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span> <span class=\"hljs-title\" style=\"color: rgb(102, 132, 225);\">cardFormValidate<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>)<\/span>{\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> cardValid = <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">0<\/span>;\r\n      \r\n    <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/ Card number validation<\/span>\r\n    $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#card_number'<\/span>).validateCreditCard(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\">result<\/span>) <\/span>{\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> cardType = (result.card_type == <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">null<\/span>)?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">''<\/span>:result.card_type.name;\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardType == <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Visa'<\/span>){\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> backPosition = result.valid?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -163px, 320px -87px'<\/span>:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -163px, 320px -61px'<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardType == <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'MasterCard'<\/span>){\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> backPosition = result.valid?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -247px, 320px -87px'<\/span>:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -247px, 320px -61px'<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardType == <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Maestro'<\/span>){\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> backPosition = result.valid?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -289px, 320px -87px'<\/span>:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -289px, 320px -61px'<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardType == <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Discover'<\/span>){\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> backPosition = result.valid?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -331px, 320px -87px'<\/span>:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -331px, 320px -61px'<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardType == <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Amex'<\/span>){\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> backPosition = result.valid?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -121px, 320px -87px'<\/span>:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -121px, 320px -61px'<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span>{\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> backPosition = result.valid?<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -121px, 320px -87px'<\/span>:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2px -121px, 320px -61px'<\/span>;\r\n        }\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#card_number'<\/span>).css(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"background-position\"<\/span>, backPosition);\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(result.valid){\r\n            $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_type\"<\/span>).val(cardType);\r\n            $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n            cardValid = <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">1<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span>{\r\n            $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_type\"<\/span>).val(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">''<\/span>);\r\n            $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n            cardValid = <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">0<\/span>;\r\n        }\r\n    });\r\n      \r\n    <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/ Card details validation<\/span>\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> email = $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#email\"<\/span>).val();\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> cardName = $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#name_on_card\"<\/span>).val();\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> expMonth = $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).val();\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> expYear = $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).val();\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> cvv = $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cvv\"<\/span>).val();\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> regName = <span class=\"hljs-regexp\" style=\"color: rgb(215, 55, 55);\">\/^[a-z ,.'-]+$\/i<\/span>;\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> regEmail = <span class=\"hljs-regexp\" style=\"color: rgb(215, 55, 55);\">\/^[A-Z0-9._%+-]+@([A-Z0-9-]+\\.)+[A-Z]{2,4}$\/i<\/span>;\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> regMonth = <span class=\"hljs-regexp\" style=\"color: rgb(215, 55, 55);\">\/^01|02|03|04|05|06|07|08|09|10|11|12$\/<\/span>;\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> regYear = <span class=\"hljs-regexp\" style=\"color: rgb(215, 55, 55);\">\/^2023|2024|2025|2026|2027|2028|2029|2030|2031|2032|2033|2034|2035|2036$\/<\/span>;\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> regCVV = <span class=\"hljs-regexp\" style=\"color: rgb(215, 55, 55);\">\/^[0-9]{3,3}$\/<\/span>;\r\n    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardValid == <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">0<\/span>){\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).focus();\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(!regMonth.test(expMonth)){\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).focus();\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(!regYear.test(expYear)){\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).focus();\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(!regCVV.test(cvv)){\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cvv\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cvv\"<\/span>).focus();\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(!regName.test(cardName)){\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cvv\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#name_on_card\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/$(\"#name_on_card\").focus();<\/span>\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span> <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(!regEmail.test(email)){\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cvv\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#name_on_card\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#email\"<\/span>).addClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/$(\"#email\").focus();<\/span>\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>;\r\n    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span>{\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#card_number\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_month\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#expiry_year\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cvv\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#name_on_card\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#email\"<\/span>).removeClass(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'required'<\/span>);\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#cardSubmitBtn'<\/span>).prop(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'disabled'<\/span>, <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>);  \r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">return<\/span> <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>;\r\n    }\r\n}<\/pre>\n<p><b>Payment Process using jQuery and Ajax:<\/b><br \/>\nThe Ajax request is initiated to validate and process the card transaction through PayPal Pro API.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>The given card information is sent to the server-side script (<code>payment_process.php<\/code>) via Ajax.<\/li>\n<li>The transaction is processed in the server-side script and the payment status is returned.<\/li>\n<li>Based on the response, the order info or error message is shown to the user.<\/li>\n<\/ul>\n<pre style=\"color: rgb(110, 107, 94);\">$(<span class=\"hljs-built_in\" style=\"color: rgb(182, 86, 17);\">document<\/span>).ready(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>)<\/span>{\r\n    <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/ Initiate validation on input fields<\/span>\r\n    $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#paymentForm input[type=text]'<\/span>).on(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'keyup'<\/span>,<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>)<\/span>{\r\n        cardFormValidate();\r\n    });\r\n    \r\n    <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/\/ Submit card form<\/span>\r\n    $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cardSubmitBtn\"<\/span>).on(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'click'<\/span>,<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>)<\/span>{\r\n        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'.status-msg'<\/span>).remove();\r\n        <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(cardFormValidate()){\r\n            <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">var<\/span> formData = $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#paymentForm'<\/span>).serialize();\r\n            $.ajax({\r\n                type:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'POST'<\/span>,\r\n                url:<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'payment_process.php'<\/span>,\r\n                dataType: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"json\"<\/span>,\r\n                data:formData,\r\n                beforeSend: <span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\"><\/span>)<\/span>{\r\n                    $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cardSubmitBtn\"<\/span>).prop(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'disabled'<\/span>, <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>);\r\n                    $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cardSubmitBtn\"<\/span>).val(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Processing....'<\/span>);\r\n                },\r\n                success:<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">function<\/span>(<span class=\"hljs-params\" style=\"color: rgb(182, 86, 17);\">resp<\/span>)<\/span>{\r\n                    <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span>(resp.status == <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">1<\/span>){\r\n                        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#paymentSection'<\/span>).html(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;p class=\"status-msg success\"&gt;The transaction was successful! &lt;br\/&gt;Reference ID: &lt;span&gt;#'<\/span>+resp.data.ref_id+<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;\/span&gt; &lt;br\/&gt;Transaction ID: &lt;span&gt;'<\/span>+resp.data.txn_id+<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;\/span&gt; &lt;br\/&gt;Paid Amount: &lt;span&gt;'<\/span>+resp.data.amount+<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">' '<\/span>+resp.data.currency+<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;\/span&gt;&lt;\/p&gt;'<\/span>);\r\n                    }<span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">else<\/span>{\r\n                        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cardSubmitBtn\"<\/span>).prop(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'disabled'<\/span>, <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>);\r\n                        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">\"#cardSubmitBtn\"<\/span>).val(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Proceed'<\/span>);\r\n                        $(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#paymentSection'<\/span>).prepend(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;p class=\"status-msg error\"&gt;Transaction has been failed, please try again.&lt;\/p&gt;'<\/span>);\r\n                    }\r\n                }\r\n            });\r\n        }\r\n    });\r\n});<\/pre>\n<h2>Validate and Process Payment (payment_process.php)<\/h2>\n<p>In the <code>payment_process.php<\/code> file, the submitted card details are validated and the charge is processed using <b>PaypalPro PHP library<\/b> and PHP.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Include the PayPalPro PHP library and configuration file.<\/li>\n<li>Fetch the product details, buyer information, and card details.<\/li>\n<li>Create an instance of PaypalPro class.<\/li>\n<li>Call the <b>paypalCall()<\/b> function of PaypalPro class and pass the item, buyer, and card details (<code>$paypalParams<\/code>).<\/li>\n<li>If the charge is successful, the transaction details will be inserted in the MySQL database.<\/li>\n<li>The transaction status is returned to the Ajax request.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;configuration&nbsp;file <br \/><\/span><span style=\"color: #007700\">include_once&nbsp;<\/span><span style=\"color: #DD0000\">'config.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;database&nbsp;connection&nbsp;file <br \/><\/span><span style=\"color: #007700\">include_once&nbsp;<\/span><span style=\"color: #DD0000\">'dbConnect.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;PayPalPro&nbsp;PHP&nbsp;library <br \/><\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'PaypalPro.class.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/>if(<\/span><span style=\"color: #0000BB\">$_SERVER<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'REQUEST_METHOD'<\/span><span style=\"color: #007700\">]&nbsp;==&nbsp;<\/span><span style=\"color: #DD0000\">'POST'<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Buyer&nbsp;information <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$name&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'name_on_card'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$nameArr&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">explode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$name<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$firstName&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$nameArr<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$nameArr<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$lastName&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$nameArr<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$nameArr<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$email&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$city&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'Charleston'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$zipcode&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'25301'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$countryCode&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'US'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Card&nbsp;details <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$creditCardNumber&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">trim<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">str_replace<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"&nbsp;\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">\"\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'card_number'<\/span><span style=\"color: #007700\">])); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$creditCardType&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'card_type'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$expYear&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'expiry_year'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$expMonth&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'expiry_month'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$cvv&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'cvv'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Create&nbsp;an&nbsp;instance&nbsp;of&nbsp;PaypalPro&nbsp;class <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$paypal&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">PaypalPro<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Payment&nbsp;details <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$paypalParams&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'paymentAction'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'Sale'<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'itemNumber'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$itemNumber<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'itemName'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$itemName<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'amount'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$payableAmount<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'currencyCode'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$currency<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'creditCardType'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$creditCardType<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'creditCardNumber'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$creditCardNumber<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'expMonth'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$expMonth<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'expYear'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$expYear<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'cvv'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$cvv<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'firstName'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$firstName<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'lastName'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$lastName<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'city'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$city<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'zip'&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$zipcode<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'countryCode'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$countryCode <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Call&nbsp;PayPal&nbsp;API <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$response&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$paypal<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">paypalCall<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$paypalParams<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$paymentStatus&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">strtoupper<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$response<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"ACK\"<\/span><span style=\"color: #007700\">]); <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$paymentStatus&nbsp;<\/span><span style=\"color: #007700\">==&nbsp;<\/span><span style=\"color: #DD0000\">\"SUCCESS\"<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Transaction&nbsp;info <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$transactionID&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$response<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'TRANSACTIONID'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$paidAmount&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$response<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'AMT'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$paidCurrency&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$response<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'CURRENCYCODE'<\/span><span style=\"color: #007700\">]; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Insert&nbsp;tansaction&nbsp;data&nbsp;into&nbsp;the&nbsp;database <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$sql&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"INSERT&nbsp;INTO&nbsp;transactions&nbsp;(item_number,item_name,item_price,item_price_currency,buyer_name,buyer_email,card_num,card_exp_month,card_exp_year,paid_amount,paid_amount_currency,txn_id,payment_status,created,modified)&nbsp;VALUES('\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$itemNumber<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$itemName<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$payableAmount<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$currency<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$name<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"',&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$email<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"',&nbsp;'\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$creditCardNumber<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$expMonth<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$expYear<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$paidAmount<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$paidCurrency<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$transactionID<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"','\"<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$paymentStatus<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">\"',NOW(),NOW())\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$insert&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">query<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$sql<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$last_insert_id&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">insert_id<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$data<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'status'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #0000BB\">1<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$data<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'data'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;array( <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'ref_id'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$last_insert_id<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'txn_id'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$transactionID<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'amount'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$paidAmount<\/span><span style=\"color: #007700\">, <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'currency'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #0000BB\">$paidCurrency <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;}else{ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$data<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'status'<\/span><span style=\"color: #007700\">]&nbsp;=&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Transaction&nbsp;status <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">json_encode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$data<\/span><span style=\"color: #007700\">); <br \/>} <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<p><b>Recurring Payment:<\/b><br \/>\nIf you want the recurring transaction, insert recurring key (recurring = Y) into the <code>$paypalParams<\/code> array.<\/p>\n<pre><span style=\"color: #0000BB\">$paypalParams&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;array( \r\n&nbsp;&nbsp;&nbsp;&nbsp;... \r\n&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #DD0000\">'recurring'&nbsp;<\/span><span style=\"color: #007700\">=&gt;&nbsp;<\/span><span style=\"color: #DD0000\">'Y' \r\n<\/span><span style=\"color: #007700\">); \r\n<\/span><span style=\"color: #0000BB\">$response&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$paypal<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">paypalCall<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$paypalParams<\/span><span style=\"color: #007700\">);<\/span><\/pre>\n<h2>Make PayPal Pro Payment Gateway Live<\/h2>\n<p>Once the testing is completed and the payment process working properly on the Sandbox environment, do the following changes to make PayPal Pro payment gateway live.<\/p>\n<p>In the <code>config.php<\/code> file,<\/p>\n<ul class=\"step_list\">\n<li>Change the PayPal API credentials (PAYPAL_API_USERNAME, PAYPAL_API_PASSWORD, and PAYPAL_API_SIGNATURE) as per your PayPal Pro Business account.<\/li>\n<li>Set PAYPAL_SANDBOX to FALSE.<\/li>\n<\/ul>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/stripe-payment-gateway-integration-php\/\">Stripe Payment Gateway Integration in PHP <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are working on an eCommerce project and concerned about the payment gateway for accepting credit cards, then PayPal Payments Pro could be the best option for you. The main advantages of PayPal Pro <\/p>\n","protected":false},"author":1,"featured_media":5305,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[250,166,76,73,74,14],"class_list":["post-917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-api","tag-library","tag-payment-gateway","tag-paypal","tag-paypalpro","tag-php","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PayPal Pro Payment Gateway Integration in PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"PayPal Pro payment gateway integration in PHP. Learn how to integrate credit card payment gateway in PHP using PayPal Payments Pro. Example PHP script for PayPal pro payment gateway integration.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PayPal Pro Payment Gateway Integration in PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"PayPal Pro payment gateway integration in PHP. Learn how to integrate credit card payment gateway in PHP using PayPal Payments Pro. Example PHP script for PayPal pro payment gateway integration.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-14T16:42:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-08T18:06:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"PayPal Pro Payment Gateway Integration in PHP\",\"datePublished\":\"2015-10-14T16:42:41+00:00\",\"dateModified\":\"2024-07-08T18:06:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/\"},\"wordCount\":900,\"commentCount\":35,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png\",\"keywords\":[\"API\",\"Library\",\"Payment Gateway\",\"PayPal\",\"PayPalPro\",\"PHP\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/\",\"name\":\"PayPal Pro Payment Gateway Integration in PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png\",\"datePublished\":\"2015-10-14T16:42:41+00:00\",\"dateModified\":\"2024-07-08T18:06:31+00:00\",\"description\":\"PayPal Pro payment gateway integration in PHP. Learn how to integrate credit card payment gateway in PHP using PayPal Payments Pro. Example PHP script for PayPal pro payment gateway integration.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2015\\\/10\\\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png\",\"width\":1920,\"height\":1080,\"caption\":\"paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/paypal-pro-payment-gateway-integration-in-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PayPal Pro Payment Gateway Integration in PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PayPal Pro Payment Gateway Integration in PHP - CodexWorld","description":"PayPal Pro payment gateway integration in PHP. Learn how to integrate credit card payment gateway in PHP using PayPal Payments Pro. Example PHP script for PayPal pro payment gateway integration.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/","og_locale":"en_US","og_type":"article","og_title":"PayPal Pro Payment Gateway Integration in PHP - CodexWorld","og_description":"PayPal Pro payment gateway integration in PHP. Learn how to integrate credit card payment gateway in PHP using PayPal Payments Pro. Example PHP script for PayPal pro payment gateway integration.","og_url":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2015-10-14T16:42:41+00:00","article_modified_time":"2024-07-08T18:06:31+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"PayPal Pro Payment Gateway Integration in PHP","datePublished":"2015-10-14T16:42:41+00:00","dateModified":"2024-07-08T18:06:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/"},"wordCount":900,"commentCount":35,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png","keywords":["API","Library","Payment Gateway","PayPal","PayPalPro","PHP"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/","url":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/","name":"PayPal Pro Payment Gateway Integration in PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png","datePublished":"2015-10-14T16:42:41+00:00","dateModified":"2024-07-08T18:06:31+00:00","description":"PayPal Pro payment gateway integration in PHP. Learn how to integrate credit card payment gateway in PHP using PayPal Payments Pro. Example PHP script for PayPal pro payment gateway integration.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png","width":1920,"height":1080,"caption":"paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/paypal-pro-payment-gateway-integration-in-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"PayPal Pro Payment Gateway Integration in PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2015\/10\/paypal-pro-payment-gateway-integration-dodirect-api-in-php-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-eN","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=917"}],"version-history":[{"count":18,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/917\/revisions"}],"predecessor-version":[{"id":5682,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/917\/revisions\/5682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5305"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}