Skip to content

Instantly share code, notes, and snippets.

@JulienTant
Created August 19, 2015 10:49
Show Gist options
  • Save JulienTant/f9ce2516ec5342cb081c to your computer and use it in GitHub Desktop.
Save JulienTant/f9ce2516ec5342cb081c to your computer and use it in GitHub Desktop.
Blog - Soumission de formulaire de paiement
<?php
// ...
post('pay', function(\Illuminate\Http\Request $request, \Cartalyst\Stripe\Stripe $stripe) {
$charge = $stripe->charges()->create([
'amount' => $request->get('amount'),
'currency' => 'EUR',
'source' => [
'object' => 'card',
'name' => $request->get('name'),
'number' => $request->get('card_no'),
'cvc' => $request->get('cvc'),
'exp_month' => $request->get('expiration_month'),
'exp_year' => $request->get('expiration_year'),
]
]);
dd($charge);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment