This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/lib/Stripe.php'; | |
if ($_POST) { | |
Stripe::setApiKey("sk_test_OXXXXXXXXXXXXXXXXXXX9"); | |
try { | |
// Use Stripe's bindings... | |
} catch(Stripe_CardError $e) { | |
// Since it's a decline, Stripe_CardError will be caught | |
$body = $e->getJsonBody(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Payment Form</title> | |
<link rel="stylesheet" type="text/css" href="https://fxsupport.org/consolidated_common.css" /> | |
<link rel="stylesheet" type="text/css" href="https://fxsupport.org/css/reset-fonts-grids.css" /> | |
<link href='https://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'> | |
<script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'path-to-Stripe.php'; | |
if ($_POST) { | |
Stripe::setApiKey("YOUR-API-KEY"); | |
$error = ''; | |
$success = ''; | |
try { | |
if (!isset($_POST['stripeToken'])) | |
throw new Exception("The Stripe Token was not generated correctly"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'path-to-Stripe.php'; | |
if ($_POST) { | |
Stripe::setApiKey("YOUR-API-KEY"); | |
$error = ''; | |
$success = ''; | |
try { | |
if (!isset($_POST['stripeToken'])) | |
throw new Exception("The Stripe Token was not generated correctly"); |