There are lots of payment gateway available in the web market like PayPal, iTransact, Card Gate Plus, SagePay, ANZ eGate and many more. Today, we are going to introduce one of the most powerful payment gateway for Web and Mobile payment. Yes, we are talking about Stripe Payment Gateway.
Integration of Stripe payment gateway using PHP is very easy. Just follow few steps and it will be ready.
Stripe take care the processing and keeping client’s card data so no information of essence would be stored on our server and you would not have to comply with all the rules that come with storing credit/debit cards.
Step 1: Create an account on Stripe https://dashboard.stripe.com/register.
Step 2: Login your account and go to Account setting for API Keys.
Step 3: Download the source code and replace the secret key in payment.php
Stripe::setApiKey("XXXX_YOUR_SECRET_KEY"); //Replace with your Secret Key
$charge = Stripe_Charge::create(array(
"amount" => 2100,
"currency" => "usd",
"card" => $_POST['stripeToken'],
"description" => "Demo Transaction"
//send the file, this line will be reached if no error was thrown above
echo "<h1>Your payment has been completed.</h1>";
//you can send the file to this email:
Step 4: Edit index.php file and replace with your Publishable Key
data-key="XXX_YOUR_PUBLISHER_KEY" //Replace with your Publishable key
data-description="Demo Transaction ($21.00)"
The test version does not entail any actual funds. However for testing you can use below mentioned detail:
Testing Card Number - 4242424242424242
CVV Number - 1234
Card Expiry Date - Use any future date