Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jimdanz on github.
  • I am jimbd (https://keybase.io/jimbd) on keybase.
  • I have a public key ASCOCcisOte5blzW_S4IhNhkRLj_yrR7GIhn4BlRgc1Ozwo

To claim this, I am signing this object:

@jimdanz
jimdanz / gist:cbfff1d825f7f2e58296
Created August 23, 2014 01:21
testing failed subscription payment on trial_end=now
Jims-MacBook-Pro:~ jim$ curl https://api.stripe.com/v1/customers -d plan=Armada -d trial_end=1408771198 -d card[number]=4000000000000341 -d card[exp_month]=05 -d card[exp_year]=2019 -u sk_test_****:
{
"object": "customer",
"created": 1408756242,
"id": "cus_4dkYctG1ff2ReZ",
"livemode": false,
"description": null,
"email": null,
"delinquent": false,
"metadata": {},
#!/usr/bin/env ruby
require 'stripe'
require 'logger'
if ARGV.length != 2
puts "Usage: #{__FILE__} <api key> <sleep interval>"
exit 1
end
@jimdanz
jimdanz / gist:7838912
Created December 7, 2013 09:15
Java multi-subs example
@Test
public void testNewStyleSubscriptionAPI() throws StripeException {
Plan plan = Plan.create(getUniquePlanParams(), MULTI_SUBS_API_KEY);
Plan plan2 = Plan.create(getUniquePlanParams(), MULTI_SUBS_API_KEY);
Customer customer = Customer.create(defaultCustomerParams, MULTI_SUBS_API_KEY);
// Create
Map<String, Object> subCreateParams = new HashMap<String, Object>();
subCreateParams.put("plan", plan.getId());
Subscription sub = customer.createSubscription(subCreateParams, MULTI_SUBS_API_KEY);
/**
* Example usage of Stripe java bindings.
* See https://stripe.com/docs/libraries#java-library
*
* Usage:
* mkdir stripe-test
* cd stripe-test
* wget https://code.stripe.com/stripe-java-latest.jar
* wget http://google-gson.googlecode.com/files/google-gson-2.2.2-release.zip
* unzip google-gson-2.2.2-release.zip