CodeIgniter Stripe Payment Gateway Api Integration

CodeIgniter Stripe Payment Gateway Api Integration

In this Post We Will Explain About is CodeIgniter Stripe Payment Gateway Api Integration With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Stripe payment gateway integration – Codeigniter – PHP Example

In this post we will show you Best way to implement Integration Stripe payment gateway in codeigniter, hear for Create integrate stripe payment gateway in Codeigniterwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Stripe Payment API integration in CodeIgniter

Stripe is simple and one of the most powerful secure payment gateway for Web-application and Mobile payment.

Now you can download the stripe PHP library from here GITHUB Download and place in the your directory libraries directory in PHP codeigniter location Like as a(codeigniter/application/libraries) and rename the directory to Stripe.

stripe payment gateway in php

Once we click on the create account setting as well as click on the simple app keys get to get secret key and config and simple put publishable key. we will see simple the screen source code below

stripe gateway in PHP

And then create a new file name like as a stripe.php in the view HTML Directory and simple put down the Like this below source code.




Now simple create a new controller name Stripe_payment.php and then copy the following simple source code Below:

load->view(stripe);
          }
  
 public function checkout()
 {
 try 
 { 
	 require_once(APPPATH.'libraries/Stripe/lib/Stripe.php');//or we
	 Stripe::setApiKey("YOUR_SECRET_KEY"); //create new app to Replace with your stripe Secret Key
	 //pass param to create a user 
	 $charge = Stripe_Charge::create(array(
	 "amount" => 10000,
	 "currency" => "usd",
	 "card" => $_POST['stripeToken'],
	 "description" => "Demo Live24u"
	 ));
	 echo "

Pakainfo.com - > Your payment has been completed.

"; } //catch part catch(Stripe_CardError $e) { // Since it's a decline, \Stripe\Error\Card will be caught $body = $e->getJsonBody(); $err = $body['error']; print('Status is:' . $e->getHttpStatus() . "\n"); print('Type is:' . $err['type'] . "\n"); print('Code is:' . $err['code'] . "\n"); // param is '' in this case print('Param is:' . $err['param'] . "\n"); print('Message is:' . $err['message'] . "\n"); } catch (Stripe_InvalidRequestError $e) { } catch (Stripe_AuthenticationError $e) { } catch (Stripe_ApiConnectionError $e) { } catch (Stripe_Error $e) { } catch (Exception $e) { } } }

Example

I hope you have Got What is php – Stripe payment gateway integration in codeigniter And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Comment