This file contains 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 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>Stripe Getting Started Form</title> | |
<!-- The required Stripe lib --> | |
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> | |
<!-- jQuery is used only for this example; it isn't required to use Stripe --> |
This file contains 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
Stripe.setPublishableKey('pk_test_Wfzrj4uDDPOcv7XxVJKXRERS'); | |
var l = Ladda.create( document.querySelector( '#addservice-submit' ) ); | |
var stripeResponseHandler = function(status, response) { | |
if (response.error) { | |
// show the errors on the form | |
$("#stripe-errors").html(response.error.message); | |
} else { | |
var token = response['id']; | |
var form$ = $("#addservice-form"); |
This file contains 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 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 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
function probe() { | |
var count = 1; | |
function recurse() { | |
count++; | |
recurse(); | |
} | |
try { | |
recurse(); | |
} catch (e) { | |
} |