PHP – Paypal Payment Gateway Integration

PHP – Paypal Payment Gateway Integration

In this Post We Will Explain About is PHP – Paypal Payment Gateway Integration With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to PHP PayPal Integration Example

In this post we will show you Best way to implement PayPal Standard Payment Gateway Integration in PHP, hear for Paypal payment gateway integration in php source code examplewith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Enable Auto Return In Your Test / Sandbox Account.


Step 1: First of all Log into
Step 2: And then Click Applications
Step 3: Now Click Sandbox accounts
Step 4: Expand the account in some question
Step 5: and then Click Sandbox site
Step 6: After that Login to the simple test account
Step 7: here link to Copy and paste simple “”
Step 8: into past your browser
Step 9: and then Enable Auto Return as well as click Save
Step 10: now last step provide the Auto Return URL as well as click Save

Read Also:  PayPal Payment Gateway with PHP MySQL Database


// config Your test paypal simple sandbox url, and then Replace it with like as a live url after successful some testing.
// Set paypal marchent id.
DEFINE('PAYPAL_ID', '[email protected]');  
// We can find This in your developer account it look like as a "[email protected]"
// Devloped by Define your some base currency


<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<!-- Include Your meta tags -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Include Your Script -->
<link rel="stylesheet" href="">
<!-- Include Your Body Content -->
<div class="panel panel-success">
<div class="panel-heading"><h3>Step By step Paypal Payment Gateway in PHP</h3></div>
<div class="panel-body">
<p class="bg-info" id="msg"></p>
<!-- Devloped by Your Body Content -->
 <form class="form-horizontal" role="form" id="paypalForm" method="post" action="<?php echo PAYPAL_URL; ?>">
 <!-- Devloped by Your Body Content -->
    <input type="hidden" name="business" value="<?php echo PAYPAL_ID; ?>">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="credits" value="510">
    <input type="hidden" name="userid" value="1">
    <input type="hidden" name="cpp_header_image" value="">
    <input type="hidden" name="no_shipping" value="1">
    <input type="hidden" name="handling" value="0">
    <input type="hidden" name="cancel_return" value="">
    <input type="hidden" name="return" value="">
<!-- Devloped by Your Body Content -->
  <div class="form-group">
    <label class="control-label col-md-2" for="amount">Amount:</label>
    <div class="col-md-10">
      <input type="text" class="form-control" name="amount" placeholder="provide Amount"  value="10">
     <div class="form-group">
    <label class="control-label col-md-2" for="currency">Quantity:</label>
    <div class="col-md-10">
      <input type="text" class="form-control" name="quantity" placeholder="provide Quantity" value="1" >
  <div class="form-group">
    <label class="control-label col-md-2" for="currency">Currency:</label>
    <div class="col-md-10">
      <input type="text" class="form-control" name="currency" placeholder="provide Currency Type" value="<?php echo CURRENCY; ?>" >
  <div class="form-group">
    <label class="control-label col-md-2" for="description">Description:</label>
    <div class="col-md-10">
      <textarea class="form-control" name="item_name" placeholder="provide Description">My First Payment</textarea>
  <div class="form-group">
    <div class="col-md-offset-2 col-md-10">
      <input type="image" src="" border="0" name="submit" alt="How to Set Up Paypal Payment Gateway Integration in PHP!">
    <img alt="" border="0" src="" width="1" height="1">
<!-- Include Your Script -->
 <script src=""></script>


$type = $_GET['type'];
if($type == 'success') {
  echo "<pre>";
  echo "<h1>Your Live Payment Successful</h1>";
if($type == 'cancel') {
  echo "<h1>Your Payment Canceled(Sorry.!!!)</h1>";

PayPal Integration In PHP – Source Code Download!

Simple Grab a free Latest copy of Paypal API Integration Demo from Github.

Read Also:  CheckBox Show Hide Div using Angular Example


I hope you have Got What is PayPal Standard Payment Gateway Integration in PHP And how it works.I would Like to have FeadBack From My Blog( readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article( Are Most Always Welcome.

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  PayPal Subscriptions(recurring payments) Payment Gateway Integration in PHP Source Code Download
  2. Read Also:  Laravel Search Comma Separated values Example
  3. Read Also:  PHP Pagination Class tutorial with next and previous
  4. Read Also:  Remove Html tags from string PHP - PHP strip_tags() Function
  5. Read Also:  How to find the Json Object Length in Javascript?
  6. Read Also:  Global Config variable In Laravel 6 Example
  7. Read Also:  payment gateway form php source code
  8. Read Also:  Simple Crud operations in php using mysql Example
  9. Read Also:  Get server memory and CPU usage in PHP Script (RAM & CPU Usage)
  10. Read Also:  Simple bootstrap product slider responsive