PHP Classes

Go PayPal: Generate HTML for Paypal payment buttons and forms

Recommend this page to a friend!
  Info   View files Example   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 73%Total: 2,519 All time: 1,530 This week: 455Up
Version License PHP version Categories
go-paypal 1.0MIT/X Consortium ...5.0HTML, PHP 5, E-Commerce


This class can generate HTML for Paypal buttons and forms.

It can set a list of parameters for the payments and generates HTML to embed in pages several types of buttons and forms to redirect the user to perform the specified payments in the Paypal site.

Currently it can generate buy now buttons, donate buttons, buy gift certificate buttons, buy subscription buttons, add a product to a shopping cart and display the cart and upload a multiple products to buy from a third party shopping cart.

Picture of Sithu Kyaw
Name: Sithu Kyaw <contact>
Classes: 2 packages by
Country: Myanmar Myanmar
Age: 41
All time rank: 11922 in Myanmar Myanmar
Week rank: 170 Up2 in Myanmar Myanmar Equal


Integrate Paypal in a Web site
How to integrate paypal in my Web site

Paypal Express Checkout
Integrate Paypal in own web site


$api = 'buynow';
$_GET['api']) && $_GET['api']) $api = $_GET['api'];
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PayPal API Example</title>
    <style type="text/css">
        #menu a{ color:#0088cc; padding:3px 7px; display:inline-block; font:12px Arial, Helvetica, sans-serif; }
        #menu{ background:#666; color:#fff; }
        #form{ margin:10px 0; }
    <div id="menu">
        <a href="index.php?api=buynow" <?php if($api == 'buynow') echo 'class="active"'; ?>>Buy Now</a> |
        <a href="index.php?api=subscribe" <?php if($api == 'subscribe') echo 'class="active"'; ?>>Subscribe</a> |
        <a href="index.php?api=donation" <?php if($api == 'donation') echo 'class="active"'; ?>>Donation</a> |
        <a href="index.php?api=gift_certificate" <?php if($api == 'gift_certificate') echo 'class="active"'; ?>>Gift Certificate</a> |
        <a href="index.php?api=individual_paypalcart" <?php if($api == 'individual_paypalcart') echo 'class="active"'; ?>>Individual PayPal Cart</a> |
        <a href="index.php?api=thirdpartycart" <?php if($api == 'thirdpartycart') echo 'class="active"'; ?>>Third Party Shopping Cart</a>
    <div id="form">
        <?php include($api.'.php') ?>


================================ GoPayPal Class PHP PayPal Payment API Helper Version : 1.0 Developer : Sithu ================================ (1) Generate HTML Forms for Paypal AI, including Buy now, Donations, Subscriptions, Shopping carts and Gift certificates. Please look at Example folder or examples. (2) Process Paypal payments and return transactions from PayPal so you can do all processing. ===================== Supported PayPal API ===================== 1. Buy Now 2. Subscriptions 3. Donations 4. Buy Gift Certificates 4. Add To Cart 6. Single Item with PayPal Shopping Cart 7. Multiple Items with Third Party Shopping Cart ======================================== Pre-defined constants for all API types ======================================== These following constants are needed to use when creating GoPayPal class instant BUY_NOW # Buy Now button implementation ADD_TO_CART # Add To Cart button implementation PAYPAY_CART # Indivitual items with PayPal shopping cart implementation THIRD_PARTY_CART # Third-party shopping cart implementation with multiple items DONATE # Donate button implementation GIFT_CERTIFICATE # Buy Gift Certivicate button implementation SUBSCRIBE # Subscribe button implementation ============================================ Read the documentation for HTML variables ============================================ HTML-Form-&-Variables-Basics-for-PayPal-Website-Payments-Standard.pdf ====================================================== See more details for usage examples in Example/ Folder ====================================================== GoPayPal/Example/index.php

  Files folder image Files  
File Role Description
Files folder imageExample (8 files)
Plain text file GoPayPal.class.php Class GoPayPal Class
Accessible without login HTML file HTML-Variables-for...yments-Standard.htm Doc. PayPal API Variables Documentation
Accessible without login Plain text file README.txt Doc. Read this before use the class

  Files folder image Files  /  Example  
File Role Description
  Accessible without login Plain text file buynow.php Example Buy Now Example
  Accessible without login Plain text file donation.php Example Donation Example
  Accessible without login Plain text file gift_certificate.php Example Buy Gift Certificate Example
  Accessible without login Plain text file index.php Example Example
  Accessible without login Plain text file individual_paypalcart.php Example Single Item Example
  Accessible without login Plain text file payment_complete.php Example Payment Complete Example
  Accessible without login Plain text file subscribe.php Example Subscription Example
  Accessible without login Plain text file thirdpartycart.php Example Third Party Shopping Cart Example

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:1,530
This week:455Up
User Ratings User Comments (3)
 All time
Pretty good class, straightforward way and examples to integr...
11 years ago (kanuj bhatnagar)
I actually use this class.
11 years ago (Assontia Patient)
13 years ago (George Pasparakis)