Welcome Guest, Not a member yet? Register   Sign In
Paypal API integration in CodeIgniter
#1

[eluser]Unknown[/eluser]
Dear all developer,

I am new in PHP world. I want to know
How to integrate Paypal API in codeIgniter framework?

Please describe step by step.

Thanks
MH
#2

[eluser]dannowatts[/eluser]
three simple steps:

1. find someone who will do it for you, and pay them.
2. pay them.
3. dance until the cows come home.

rocksteady,
danno~
#3

[eluser]xeroblast[/eluser]
use this code in your php:

Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypal_form">
<input type="image" name="image" src="images/payment_sub.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="cmd" value="_xclick"> <!-- this is for buy button, the other is subscription button but i forgot, go to paypal to know the other value. -->
<input type="hidden" name="business" value="[email protected]"> <!--Value is Client paypal id for his site, it is mandatary-->
<input type="hidden" name="item_name" value="Name of Item for sale">
<input type="hidden" name="amount" value="5">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD"> <!--Value is currency code-->
<!--<input type="hidden" name="lc" value="US">--> <!--Country code-->
<!-- For subscription --><!--
<input type="hidden" name="bn" value="PP-SubscriptionsBF">
<input type="hidden" name="a3" value="5">--> <!--Value is the amount how much you collect from user, this value is mandatory, you can get this value from the hidden filed of previous form you come from or get from passing to the url, best to get from hidden field, if you get from url it is not safe because we give chance to the user to change the amount value-->
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<!-- end for subscription -->
<!-- user details and not mandatory -->
<input type="hidden" name="first_name" value="<?=$firstname?>">
<input type="hidden" name="last_name" value="<?=$lastname?>">
<input type="hidden" name="address1" value="<?=$address?>">
<input type="hidden" name="city" value="<?=$city?>">
<input type="hidden" name="state" id="state" value="<?=$state?>">
<input type="hidden" name="zip" value="<?=$zip?>">
<input type="hidden" name="country" id="country_code" value="<?=$country_code?>">
<input type="hidden" name="H_PhoneNumber" value="<?=$H_PhoneNumber?>">
<input type="hidden" name="email" value="<?=$email?>">
<input type="hidden" name="credit_card_type" id="credit_card_type" value="<?=$credit_card_type?>">
<input type="hidden" name="cc_number" value="<?=$card_num?>">
<input type="hidden" name="expdate_month" value="<?=$exp_month?>">
<input type="hidden" name="expdate_year" value="<?=$exp_year?>">
<input type="hidden" name="cvv2_number" value="<?=$card_code?>">
<input type="hidden" name="buyer_credit_promo_code" value="1">
<input type="hidden" name="buyer_credit_product_category" value="1">
<input type="hidden" name="buyer_credit_shipping_method" value="1">
<input type="hidden" name="buyer_credit_user_address_change" value="1">
<!-- enf of user details -->
<input type="hidden" name="return" value="http://www.yahoo.com"> <!--this is the page redirecting from paypal site when the user gives all correct details-->
<input type="hidden" name="cancel_return" value="http://www.google.com"> <!--this is the page redirecting from paypal site when the user gives false details-->
<input type="submit" name="submit" value="continue" />
</form>

you test it by putting desired values on the hidden form fields... other hidden fields are not required... and you can test it in sandbox by changing the <form action=""> with 'https://www.sandbox.paypal.com/cgi-bin/webscr'...




Theme © iAndrew 2016 - Forum software by © MyBB