Download the Stripe API Library and place it in vendor Folder
source : [https://github.com/stripe/stripe-php][1]
include the library in your controller
use Stripe\BalanceTransaction;
use Stripe\Charge;
use Stripe\Stripe;
require_once('../vendor/stripe/init.php');
set the strip key
\Stripe\Stripe::setApiKey('stripe_secret_key');
Call the charge function for transaction
$card = array(
'number' =>'cardccn',
'cvc' =>'cardcvc',
'exp_month' => 'expMonth',
'exp_year' => 'expYear',
);
$charge = Charge::create(
array(
'amount' => ('amount') * 100, // Amount will store in cent in Stripe Account
'currency' => 'usd',
'card' => $card,
'description' => '$data['description',
'receipt_email'=>'receipt_email'
)
);
get the details of charge
$data = Charge::retrieve('ch_%');