Yii 1.1: simple-paypal-ipn

Paypal IPN
3 followers

This extension is a simple Paypal IPN. Based on your input I will extend and make it robust.

Note: there are no error trapping and other bells and whistles yet!

Resources

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/extensions

Usage

See the following code example: see: http://gemisoft.com/site/paypal.html

Change Log

November 17, 2009

  • Initial release.

Total 8 comments

#7192 report it
yiimann at 2012/03/02 10:12am
WARNING

WARNING don't use this extension

This extension does not make any payment verifications and does not even verify that the notify request comes from Paypal. So anyone could send a fake 'payed' notification to your website.

#4431 report it
Ivica at 2011/07/08 09:04am
can't make it working

I have problem with installation of your extension, I don't get any response from code. Probably will have to develop my own extension(maybe based on your), but anyway thanks for sharing.

#412 report it
Deepak Pradhan at 2010/06/10 03:47am
Read Overview + POST contains emulation data

Read the overview first!

This extension is a simple Paypal IPN. Based on your input I will extend and make it robust.

Note: there are no error trapping and other bells and whistles yet!

"You dont put any checks for the $_POST... it is always available in PHP so even empty it is saving records..

Also this component is not doing any requests back to paypal to verify after payment."

The POST is sample data, emulation till you have a Sandbox account.

#413 report it
mech7 at 2010/06/10 12:50am
controller does not work too..

You dont put any checks for the $_POST... it is always available in PHP so even empty it is saving records..

Also this component is not doing any requests back to paypal to verify after payment.

#417 report it
mech7 at 2010/06/09 06:33am
x

mm the form messes up my code :s

#418 report it
mech7 at 2010/06/09 06:32am
test
class Paypal extends CApplicationComponent {
    public $useSandBox = true; 
    public $notify_url = 'http://www.flipbooksoft.com/gateway/checkpayment.php';
    private $sandbox    = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
    private $production = 'https://www.paypal.com/cgi-bin/webscr';
    private $buttinImg  = 'https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif';
    public $options = array();


    public function showButton($typ) 
    {
        $action  = ($this->useSandBox)?$this->sandbox:$this->production;

        echo "<form method='post' action='$action'>";
        foreach ($this->options as $key => $val) {
            echo '<input type="hidden" name="'.$key.'" value="'.$val.'">'."\n";
        }
        echo CHtml::submitButton(' Pay via Paypal');
        echo "</form>";
        //public static string submitButton(string $label='submit', array $htmlOptions=array ( ))
    }
}
#419 report it
mech7 at 2010/06/09 06:32am
many bugs...

Thx but your code contains many bugs... here are some modification to atleast get it to run... I did not check the controller or model yet.. plz test code on E_STRICT ;)

class Paypal extends CApplicationComponent { public $useSandBox = true; public $notify_url = 'http://www.flipbooksoft.com/gateway/checkpayment.php'; private $sandbox = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; private $production = 'https://www.paypal.com/cgi-bin/webscr'; private $buttinImg = 'https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif'; public $options = array();

public function showButton($typ) 
{
    $action  = ($this->useSandBox)?$this->sandbox:$this->production;

    echo "<form method='post' action='$action'>";
    foreach ($this->options as $key => $val) {
        echo '<input type="hidden" name="'.$key.'" value="'.$val.'">'."\n";
    }
    echo CHtml::submitButton(' Pay via Paypal');
    echo "</form>";
    //public static string submitButton(string $label='submit', array $htmlOptions=array ( ))
}

}

#1158 report it
jerry2801 at 2009/11/20 09:21am
so useful!

hope foe#1 build the payflow(paypal) extension~

Leave a comment

Please to leave your comment.

Create extension
Downloads
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: Deepak Pradhan
  • Category: Others
  • Votes: +5 / -3
  • Downloaded: 1,155 times
  • Created on: Nov 17, 2009
  • Last updated: Nov 18, 2009