Skip to content

Instantly share code, notes, and snippets.

@amfeng
amfeng / callback.html
Last active February 1, 2020 17:04
Stripe OAuth Example -- Python
<!doctype html>
<head>
<title>Stripe OAuth Example</title>
</head>
<body>
{{ token }}
</body>
</html>
@amfeng
amfeng / index.php
Last active August 8, 2022 19:33
Stripe OAuth Example -- PHP
<?php
define('CLIENT_ID', 'YOUR_CLIENT_ID');
define('API_KEY', 'YOUR_API_KEY');
define('TOKEN_URI', 'https://connect.stripe.com/oauth/token');
define('AUTHORIZE_URI', 'https://connect.stripe.com/oauth/authorize');
if (isset($_GET['code'])) { // Redirect w/ code
$code = $_GET['code'];
@amfeng
amfeng / callback.erb
Last active August 8, 2022 19:33
Stripe OAuth Example -- Ruby
<!doctype html>
<head>
<title>Stripe OAuth Example</title>
</head>
<body>
<%= @access_token %>
</body>
</html>