Skip to content

Instantly share code, notes, and snippets.

@tlarevo
Created March 26, 2015 13:04
Show Gist options
  • Save tlarevo/d0b3e569f387f64885eb to your computer and use it in GitHub Desktop.
Save tlarevo/d0b3e569f387f64885eb to your computer and use it in GitHub Desktop.
$token = $_POST['stripeToken'];
$charge = Stripe_Charge::create(
array(
// 'customer' => $customer->id,
'amount' => $courseFee,
'currency' => 'aud',
'source' => $token,
'description' => '[email protected]',
'application_fee' => 123
),
array("Stripe-Account" => "acct_15jAbOCMTJOx0RGD") // Users_account_ID
);
/////////////////////////////////////////////////////////////////////
// At front-end
<script src="https://checkout.stripe.com/v2/checkout.js" class="stripe-button"
data-key="pk_test_8SIvC4XiqnlOUuNJ4qxSVpRH" <!-- This is user's Publishable_key -->
data-email= "<?php echo $usremail; ?>"
data-amount="<?php echo $valCoursefee*100; ?>" data-description="Pay & Enroll">
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment