{"id":4798,"date":"2017-11-25T04:36:39","date_gmt":"2017-11-25T04:36:39","guid":{"rendered":"http:\/\/a1webdesignteam.com\/blog\/?p=4798"},"modified":"2017-11-25T04:36:39","modified_gmt":"2017-11-25T04:36:39","slug":"php-paypal-integration","status":"publish","type":"post","link":"https:\/\/a1webdesignteam.com\/blog\/php-paypal-integration\/","title":{"rendered":"PHP &#8211; PayPal Integration"},"content":{"rendered":"<p>PayPal is a payment processing system, We can integrate PayPal with websites by using with php.<\/p>\n<h2>PayPal integration file system<\/h2>\n<p>PayPal integration file system included 4 files as shown below.<\/p>\n<ul class=\"list\">\n<li><b>constants.php<\/b>\u00a0\u2212 This file has included API user name, password and signature.<\/li>\n<li><b>CallerService.php<\/b>\u00a0\u2212 This file has included PayPal Services, which is used to call PayPal services.<\/li>\n<li><b>confirmation.php<\/b>\u00a0\u2212 This file has included a form with minimum fields required to make payment process and it will return payment success or failure.<\/li>\n<li><b>PayPal_entry.php<\/b>\u00a0\u2212 This page has used to send the user the data to PayPal. It acts as an adapter between PayPal and user form.<\/li>\n<\/ul>\n<p>The user has to download a PayPal SDK file from\u00a0<a href=\"https:\/\/www.tutorialspoint.com\/php\/paypal.zip\">here<\/a>\u00a0and exact a zip file. The zip file contains four php files, We don&#8217;t need to change any file except constants.php<\/p>\n<p>The constants.php file contains code as shown below \u2212<\/p>\n<pre class=\"prettyprint notranslate prettyprinted\"><span class=\"pun\">&lt;?<\/span><span class=\"pln\">php\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'API_USERNAME'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'YOUR USER NAME HERE'<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'API_PASSWORD'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'YOUR PASSWORD HERE'<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'API_SIGNATURE'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'YOUR API SIGNATURE HERE'<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'API_ENDPOINT'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'https:\/\/api-3t.paypal.com\/nvp'<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'USE_PROXY'<\/span><span class=\"pun\">,<\/span><span class=\"pln\">FALSE<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'PROXY_HOST'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'127.0.0.1'<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'PROXY_PORT'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'808'<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'PAYPAL_URL'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'https:\/\/www.PayPal.com\/webscr&amp;cmd=_express-checkout&amp;token='<\/span><span class=\"pun\">);<\/span><span class=\"pln\">\r\n   define<\/span><span class=\"pun\">(<\/span><span class=\"str\">'VERSION'<\/span><span class=\"pun\">,<\/span> <span class=\"str\">'53.0'<\/span><span class=\"pun\">);<\/span>\r\n<span class=\"pun\">?&gt;<\/span><\/pre>\n<p>The user will declare User Name, password and signature in above syntax which are placed in constants.php. This is an experimental example so the last amount will be added to sandbox&#8217;s account.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PayPal is a payment processing system, We can integrate PayPal with websites by using with php. PayPal integration file system PayPal integration file system included 4 files as shown below. constants.php\u00a0\u2212 This file has included API user name, password and signature. CallerService.php\u00a0\u2212 This file has included PayPal Services, which is used to call PayPal services. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4800,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[30],"tags":[51,129,128],"_links":{"self":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/4798"}],"collection":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/comments?post=4798"}],"version-history":[{"count":0,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/4798\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media\/4800"}],"wp:attachment":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media?parent=4798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/categories?post=4798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/tags?post=4798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}