Skip to content

Instantly share code, notes, and snippets.

View atwj's full-sized avatar

Amos Tan atwj

View GitHub Profile
@atwj
atwj / gist:e5c4a79ab7cb98b01efc7a3e2538971f
Created March 23, 2022 01:46
Stripe Checkout Sessions and add line items on the fly
curl https://api.stripe.com/v1/checkout/sessions \
-u sk_test_: \
-d success_url="https://example.com/success" \
-d cancel_url="https://example.com/cancel" \
-d "line_items[0][price_data][currency]"="sgd" \
-d "line_items[0][price_data][product_data][name]"="School Fees" \
-d "line_items[0][price_data][unit_amount]"="300000" \
-d "line_items[0][quantity]"="1" \
-d "line_items[1][price_data][currency]"="sgd" \
-d "line_items[1][price_data][product_data][name]"="Convenience Fee" \
@atwj
atwj / gist:b1eb264f986eb0dca1efd8f1d13c67e9
Last active March 23, 2022 01:45
Stripe Connect Account Creation and Connect Onboarding
curl https://api.stripe.com/v1/accounts \
-u sk_test_: \
-d country=SG \
-d type=custom \
-d "capabilities[card_payments][requested]"=true \
-d "capabilities[transfers][requested]"=true
// Get account ID (acct_xxxxxx) from prior call
curl https://api.stripe.com/v1/account_links \
@atwj
atwj / request.txt
Created March 23, 2022 01:43
Stripe e-mandate API calls
curl -X POST https://api.stripe.com/v1/customers \
-u sk_test_:
// Beta
curl https://api.stripe.com/v1/setup_intents \
-u sk_test_: \
-d "payment_method_options[card][mandate_options][reference]"="reference" \
-d "payment_method_options[card][mandate_options][description]"="description" \
-d "payment_method_options[card][mandate_options][amount]"=100000 \
-d "payment_method_options[card][mandate_options][amount_type]"="maximum" \
@atwj
atwj / sample.html
Created June 19, 2017 15:21
Messenger Extension
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sign Up</title>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/js/materialize.min.js"></script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@atwj
atwj / sgtopo.json
Created January 23, 2017 06:29
Singapore topoJSON file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
'use strict';
import angular from 'angular';
import Firebase from 'firebase';
import {spfShared} from '../module.js';
/**
* spfFirebaseRef return a Firebase reference to singpath database,
* at a specific path, with a specific query; e.g:
*
@atwj
atwj / asdf.md
Created July 7, 2016 17:49
A gist for commands or code snippets that I just can't seem to remember #smh

asdf

Git

Show local branches

git branch

Show remote branches