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
type DOB struct { | |
DOBYear int | |
DOBMonth int | |
DOBDay int | |
} | |
type Person struct { | |
Name string | |
DOB // anonymous field is "embedded" | |
} | |
friend := Person{ |
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
$customer = \Stripe\Customer::create([ | |
'email' => '[email protected]', | |
'payment_method' => 'pm_card_visa', | |
'invoice_settings' => [ | |
'default_payment_method' => 'pm_card_visa', | |
], | |
]); | |
$connectCustomer = \Stripe\Customer::create([ | |
'email' => '[email protected]', |
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
const acct = await stripe.accounts.update( | |
'acct_xxx', { | |
individual: { | |
dob: { | |
day: 15, | |
month: 8, | |
year: 2013, | |
}, | |
}, | |
}, |
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
{ | |
"id": "cs_test_xxx", | |
"object": "checkout.session", | |
"amount_subtotal": 2100, | |
"amount_total": 2499, | |
"cancel_url": "https://example.com/cancel", | |
"client_reference_id": null, | |
"currency": "usd", | |
"customer": "cus_yyy", | |
"livemode": false, |
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
#!/usr/bin/ruby | |
require 'octokit' | |
require 'dotenv' | |
require 'restclient' | |
require 'json' | |
Dotenv.load('.env_shortcut') | |
GITHUB = "https://raw.githubusercontent.com/%s/master/.cli.json" |
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
{ | |
"_meta": { | |
"template_version": 0 | |
}, | |
"fixtures": [ | |
{ | |
"name": "customer", | |
"path": "/v1/customers", | |
"method": "post", | |
"params": { |
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
$session = \Stripe\Checkout\Session::create([ | |
'payment_method_types' => ['card'], | |
'line_items' => [[ | |
'price_data' => [ | |
'unit_amount' => 5000, # $50 per month | |
'currency' => 'usd', | |
'product_data' => ['name' => 'My Service Plan'], | |
'recurring' => [ | |
'interval' => 'month', | |
], |
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
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN}); // guessing this initializes stripe-node, and should be your platform's secret key, not the connected account's. | |
const pug = require('pug'); | |
const render = pug.compileFile('./payment.pug') | |
/** | |
* An HTTP endpoint that acts as a webhook for Custom API or Webhook request event | |
* @returns {object.http} result Your return value | |
*/ | |
module.exports = async (amount=null, frequency=null, email=null, firstname=null, lastname=null, street=null, zip=null, city=null, state=null, cellphone=null, occupation=null, employer=null) => { | |
const fec = { |
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
const f = async () => { | |
try { | |
const res = await stripe.billingPortal.sessions.create({ | |
customer: cus, | |
return_url: 'https://pay.cjavilla.com' | |
}) | |
return { | |
statusCode: 200, | |
body: JSON.stringify(res), | |
}; |
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
{ | |
"_meta": { | |
"template_version": 0 | |
}, | |
"fixtures": [ | |
{ | |
"name": "customer", | |
"path": "/v1/customers", | |
"method": "post", | |
"params": { |