Browsing all articles in Uncategorized
Aug
27

Zend Framework Quick Start in xampp and Windows

Author admin    Category Uncategorized     Tags

Now i am writing what i have done for my project learning from the zend documentation. It(Zend) follows the MVC design pattern (with some extension, like form).

Create Project

1. Start>Run (cmd)

zf create project E:\Faruque\Projects\gyneca\Source\trunk\test_php\test_zend test_zend

Create Layout

go to the application directory(in command pormpt.) where .zfproject.xml remains

execute this command:

zf enable layout

In application/configs/application.ini file append

; Add to [production] section:

resources.view[] =

Add a function to Bootstrap

protected function _initDoctype()
{
$this->bootstrap(‘view’);
$view = $this->getResource(‘view’);
$view->doctype(‘XHTML1_STRICT’);
}
make a file in application/layouts/scripts/layout.phtml

Aug
10

Paypal Integration(4th day)

Author admin    Category Uncategorized     Tags

What do u think? Is it completed? No. We have made the form to submit.

Now,

1. Data will go to paypal

2. paypal shows the payment form.

3. After transaction it(paypal) will send a notification to my site(The location i  have given at the form.).

<input type=”hidden” name=”notify_url” value=”http://www.abcd.com/ipn/ipn.php”>

4.  Now I have to send the notification data to paypal for verification.(I missed this step to my project and i fell in gr8 trouble)

5.  After verification, paypal sends me another notification.

6. Then i start processing the data(inserting in db , sending mail etc).

Its hard.na?

Paypal provides this handler for different language. So …. no problem.

The code of paypal ipn handler:

<?php
// PHP 4.1
// read the post from PayPal system and add ‘cmd’
$req = ‘cmd=_notify-validate’;
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= “&$key=$value”;
}
// post back to PayPal system to validate
$header .= “POST /cgi-bin/webscr HTTP/1.0\r\n”;
$header .= “Content-Type: application/x-www-form-urlencoded\r\n”;
$header .= “Content-Length: ” . strlen($req) . “\r\n\r\n”;
$fp = fsockopen (‘ssl://www.sandbox.paypal.com’, 443, $errno, $errstr, 30);
// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, “VERIFIED”) == 0) {
// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
}
else if (strcmp ($res, “INVALID”) == 0) {
// log for manual investigation
}
}
fclose ($fp);
}
?>
=============================================================
Completed.  \m/
Alhamdulillah (All praise is due to Allah).
Jul
14

Paypal Integration(3rd day)

Author admin    Category Uncategorized     Tags
1. <form action=”https://www.sandbox.paypal.com/cgi-bin/webscr” method=”post”>
form action is ”https://www.sandbox.paypal.com/cgi-bin/webscr” ,bcoz i am testing my integration is correct or not. When it is correct, change it to “https://www.paypal.com/cgi-bin/webscr”
2. <input type=”hidden” name=”cmd” value=”_xclick”>
I dont know why i had to give it sorry.
3. <input type=”hidden” name=”business” value=”abcd_1278228107_biz@yahoo.com”>
It is my paypal merchant account.
I think u can understand the purpose of other input
<input type=”hidden” name=”custom” value=”<?php echo $_SESSION['username'];?>”>
to get the username to my IPN handler i hav written this.
Any question?
No? good.
Jul
8

Paypal Integration(2nd day)

Author admin    Category Uncategorized     Tags

The minimalistic order form:

<form action=”https://www.sandbox.paypal.com/cgi-bin/webscr” method=”post”>
<input type=”hidden” name=”cmd” value=”_xclick”>
<input type=”hidden” name=”business” value=”abcd_1278228107_biz@yahoo.com”>
<input type=”hidden” name=”item_name”
value=”abcdaNow Service”>
<input type=”hidden” name=”item_number” value=”1″>
<input type=”hidden” name=”amount” value=”3″>
<!– <input type=”hidden” name=”tax” value=”1″>–>
<input type=”hidden” name=”quantity” value=”1″>
<input type=”hidden” name=”no_note” value=”1″>
<input type=”hidden” name=”currency_code” value=”USD”>
<!– Enable override of payer’s stored PayPal address –>
<input type=”hidden” name=”address_override” value=”1″>
<!– Set prepopulation variables to override stored address –>
<input type=”hidden” name=”address_name” value=”safaruque”>
<input type=”hidden” name=”first_name” value=”john pancraft”>
<input type=”hidden” name=”last_name” value=”last sent”>
<input type=”hidden” name=”notify_url” value=”http://www.abcd.com/ipn/ipn.php”>
<input type=”hidden” name=”return” value=”http://www.adbc.com/success.php”>
<input type=”hidden” name=”cbt” value=”Continue >>”>
<input type=”hidden” name=”custom” value=”<?php echo $_SESSION['username'];?>”>
<input type=”image” name=”submit” border=”0″
src=”https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif”
alt=”PayPal – The safer, easier way to pay online”>
</form>
Wanna explanation? which <input> is for what?
–Give comments or i will publish automatically. :)
Jul
7

Paypal Integration(1st day)

Author admin    Category Uncategorized     Tags

Yap, atlast i have integrated my project to paypal. Its easy but need some guidence.

For my project scenario is -

  1. Client will login to my page
  2. They put the quantity of products
  3. And click buy now button
  4. 1 notification(IPN) will come to me(Site Admin).
  5. I will store the info(user_name, amount) to DB.

Thats it.

I have made a order form given in next post. Now i m busy. :p:p:p:p:p

Jun
30

Paypal Integration(Introduction)

Author admin    Category Uncategorized     Tags

Again i have started learning paypal.

Jun
18

Learning Drupal (1st day)

Author admin    Category Drupal, Uncategorized     Tags

From yesterday  i started learning Drupal (word meaning: Drop of Water, Actually a CMS). I have got a book of [PACKT] Publication by David Mercer. and a e-book pro Drupal Development –John K. VanDyk.

Flickr Photostream
logo_elegentlogo_monochromiclogo_structure_alphabets_aralmost-final-with-axis
ADSENSE Test