SHARE
TWEET
Untitled
a guest
Dec 30th, 2016
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- buynow page
- -------------
- <form action="annualForm-submit.php" method="POST">
- <script
- src="https://checkout.stripe.com/checkout.js" class="stripe-button"
- data-key="pk_live_key"
- data-amount="50"
- data-name="removed"
- data-description="1 Ticket"
- data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
- data-locale="auto"
- data-zip-code="true">
- </script>
- </form>
- annualForm-submit.php
- ----------------------
- <?php require_once('config.php'); ?>
- <?php
- // Get the credit card details submitted by the form
- $token = $_POST['stripeToken'];
- // Create a charge: this will charge the user's card
- try {
- $charge = \Stripe\Charge::create(array(
- "amount" => 50, // Amount in cents
- "currency" => "usd",
- "source" => $token,
- "description" => "Example charge"
- ));
- } catch(\Stripe\Error\Card $e) {
- // The card has been declined
- }
- ?>
- <meta http-equiv="refresh" content="0; url=annualForm-thanks.php" />
- annualForm-thanks.php
- -----------------------
- just a thank you page
- config.php
- --------------
- <?php
- require_once('stripe-php-3.1.0/init.php');
- $stripe = array(
- "secret_key" => "sk_live_secret",
- "publishable_key" => "pk_live_secret"
- );
- \Stripe\Stripe::setApiKey($stripe['secret_key']);
- ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
