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.
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.
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.
x
mm the form messes up my code :s
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 ( )) } }
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 ( )) }
}
so useful!
hope foe#1 build the payflow(paypal) extension~
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.
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.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.