Hi! I'm probably your first interaction with Codeigniter and Stripe, happy to se you, this repo only demonstrates how to connect and realize a transaction, it's not ready for production uses.
- Clone This Repository
You will need to have git and php installed in your pc, then.
git clone https://github.com/mullerjk/stripeCodeigniter.git
- Installing CodeIgniter
We will use the version 3.1.11 of Codeigniter in this project.
Download in this link. https://codeigniter.com/userguide3/installation/downloads.html
Instal in this link. https://codeigniter.com/userguide3/installation/index.html
Install codeigniter inside your stripeCodeigniter folder.
- Installing Stripe PHP Library
Download the zip on link bellow. https://github.com/stripe/stripe-php
Unzip and rename to stripe-php, copy the folder with the content inside the following path.
stripeCodeigniter/application/libraries
That was my first time dealing with stripe, and I could notice a very powerfull and easy to understood documentation, this integration worked like a charm.
Grab your Publishable and Secret Keys
All instructions needed here. https://stripe.com/docs/keys#obtain-api-keys
Now with your keys in hand.
You have to store your keys in your application, I'm not doing any security or optmization implementation because the focus is to keep our application lean e effective to test it.
#----------------------------------------------
# Stripe Config
#-----------------------------------------------
$config['stripe_key'] = 'pk_test_*****';
$config['stripe_secret'] = 'sk_test_*****';
$config['sess_save_path'] = sys_get_temp_dir();
You know what to do here, alright?! Edit with your credentials and paste at very bottom of your:
stripeCodeigniter/application/config/config.php
Open your browser("your host adrees"/stripeCodeiginiter) like mine.
https://localhost/stripeCodeigniter/
Click on proceed to checkout and make your payment. The test card data are:
Test 4242 4242 4242 4242 456 12 2025
Chechout your sale on your account balance on Stripe.
That's it. Thank you, to come here.