Tuesday, March 29, 2011

Get all the top google search results | Google Search Results API |

We will be using the google ajax api in this script. As you might have found, by default it gives out only 4 results. Or you may manage to get 8 with one more parameter. But here, with some tweaks, you will get the top 64 results! (And 64 is the upper limit, because google doesn’t like bots.)

<?php
function google_search_api($args, $referer = 'http://localhost/testing/', $endpoint = 'web')
{
 
if ( !array_key_exists('v', $args) )
$args['v'] = '1.0';
//$args['key']="ABQIAAAArMTuM-CBxyWL0PYBLc7SuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxT-uD75NXlWUsDRBw-8aVAlQ29oCg";
//$args['userip']=$_SERVER['REMOTE_ADDR'];
$args['rsz']='8';
$url .= '?'.http_build_query($args, '', '&');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// note that the referer *must* be set
curl_setopt($ch, CURLOPT_REFERER, $referer);
$body = curl_exec($ch);
curl_close($ch);
//decode and return the response
return json_decode($body,true);
}
$query=urldecode(isset($_GET['q'])?$_GET['q']:"none");
echo "Results for: $query<br />-----<br />";
$res = google_search_api(array('q' => $query));
$pages=$res['responseData']['cursor']['pages'];
$nres=0;
for($i=0;$i<count($pages);$i++)
{
$res = google_search_api(array('q' => $query,'start'=>$rez['responseData']['cursor']['pages'][$i]['start']));
for($j=0;$j<count($res['responseData']['results']); $j++)
{
$nres++;
echo urldecode($res['responseData']['results'][$j]['url'])."<br />";
}
}
echo "<br />---<br />Total number of reuslts: $nres";
?>
 
 

Wednesday, March 23, 2011

plimus payment gateway | payment gateway | Sample code to integrate plimus payment gateway

 Here is a Sample code to integrate plimus as payment gateway either for one time payment or for Recurring payment.

<form id="form1" action="https://sandbox.plimus.com/jsp/buynow.jsp" method="post">
<div>
<input type="hidden" name="contractId" value="2114108" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="overridePrice" value="20" />
<input type="hidden" name="custom1" value="1001" />
<input type="hidden" name="enableCustom" value="Y" />
<input type="hidden" name="firstName" value="Lakhan" />
<input type="hidden" name="lastName" value="Pal" />
<input type="hidden" name="email" value="lakhangarg@gmail.com" />
<input type="hidden" name="address1" value="6252 NW 65 Terrace" />
<input type="hidden" name="address2" value="Test Course" />
<input type="hidden" name="city" value="Parkland" />
<input type="hidden" name="zipCode" value="33067" />
<input type="hidden" name="country" value="us" />
<input type="hidden" name="state" value="FL" />
<input type="hidden" name="workPhone" value="1-858-350-7473" />
<input type="hidden" name="cardNumber" value="4111111111111111" />
<input type="hidden" name="verifyCardCode" value="411" />
<input type="hidden" name="bCur" value="USD" />
<input type="hidden" name="currency" value="USD" />
<input type="submit" id="btnSubmit" name="btnSubmit" value="Plimus - Pay Now"/>
</div>
</form>



 Refer the following useful urls:

plimus sandbox URL  :https://sandbox.plimus.com/jsp/buynow.jsp

Form for plimus: http://www.dotnetspark.com/kb/841-payment-gateway-integrate---plimus.aspx

httpNotificationVariable IPN variables: https://sandbox.plimus.com/html/httpNotificationVariable.html

Useful tip for IPN:

http://home.plimus.com/ecommerce/learning-center/instant-notifications/ipn-guide
http://home.plimus.com/ecommerce/learning-center/instant-notifications/sample-code

Alertpay implementation | generate Alertpay button | Alertpay gateway | Alertpay

 This payment-gate way is like pay-pal.Two account have create by user business and personal pro account.And also define IPN URL in the IPN settings.


 These steps to create Alertpay buy now button are as follow.
  1. Log in to your Alertpay account using your username and password.
  2. Click Business Tool Tab.
  3. In Advanced Integration section, Click Generate a “Buy Now” Button.
  4. Select your Business Account
  5. Enter the item details, such as Item type, Name, Description, Item Code and change the button image if you want.
  6. Then enter the pricing details such as Currency, Amount, Shipping & Handling, Discount Amount & Tax.
  7. Setup your url for return and cancellation and Click Update.
  8. Alertpay System will generate a link code and image code, copy the code that you want use and paste it in your website page.
  9. Now you could receive payments for your goods and services using Alertpay.
Alert pay Login : https://www.alertpay.com/login.aspx

Signup : https://www.alertpay.com/signup/signup.aspx

Create personal pro and business account.And start your transactions.




    Refer Useful tips:
    http://hubpages.com/hub/How-to-generate-Alertpay-buy-now-button
    http://www.infinitydownline-infinity100.com/alertpay-set-up-for-infinity-downline/
    https://dev.alertpay.com/index.php/integration-tools/html-integration/ipn-guide
    https://dev.alertpay.com/en/resources/documentation/alert-url.html