Skip to content

Instantly share code, notes, and snippets.

@fedesoria
Created March 8, 2016 22:23
Show Gist options
  • Save fedesoria/92545d198b10c108f295 to your computer and use it in GitHub Desktop.
Save fedesoria/92545d198b10c108f295 to your computer and use it in GitHub Desktop.
[1] pry(#<Merchant>)> stripe_customer = Stripe::Customer.retrieve(stripe_customer_id)
=> #<Stripe::Customer:0x3ffdb902b8bc id=cus_7i3TMi5sqH78iY> JSON: {
"id" : "cus_7i3TMi5sqH78iY",
"object" : "customer",
"account_balance" : 0,
"bank_accounts" : {
"object" : "list",
"data" : [
{
"id" : "ba_82xZOcvz6SNFx9",
"object" : "bank_account",
"account_holder_name" : "John Doe",
"account_holder_type" : "company",
"bank_name" : "STRIPE TEST BANK",
"country" : "US",
"currency" : "usd",
"customer" : "cus_7i3TMi5sqH78iY",
"fingerprint" : "rwb34mTnXGxlmtBx",
"last4" : "6789",
"metadata" : {},
"routing_number" : "110000000",
"status" : "new",
"name" : "John Doe"
}
],
"has_more" : false,
"total_count" : 1,
"url" : "/v1/customers/cus_7i3TMi5sqH78iY/bank_accounts"
},
"created" : 1452648245,
"currency" : null,
"default_bank_account" : "ba_82xZOcvz6SNFx9",
"default_source" : "ba_82xZOcvz6SNFx9",
"default_source_type" : "bank_account",
"delinquent" : false,
"description" : "Customer for Merchant ID 3",
"discount" : null,
"email" : "example@email.com",
"livemode" : false,
"metadata" : {},
"shipping" : null,
"sources" : {
"object" : "list",
"data" : [
{
"id" : "ba_82xZOcvz6SNFx9",
"object" : "bank_account",
"account_holder_name" : "John Doe",
"account_holder_type" : "company",
"bank_name" : "STRIPE TEST BANK",
"country" : "US",
"currency" : "usd",
"customer" : "cus_7i3TMi5sqH78iY",
"fingerprint" : "rwb34mTnXGxlmtBx",
"last4" : "6789",
"metadata" : {},
"routing_number" : "110000000",
"status" : "new",
"name" : "John Doe"
}
],
"has_more" : false,
"total_count" : 1,
"url" : "/v1/customers/cus_7i3TMi5sqH78iY/sources"
},
"subscriptions" : {
"object" : "list",
"data" : [],
"has_more" : false,
"total_count" : 0,
"url" : "/v1/customers/cus_7i3TMi5sqH78iY/subscriptions"
}
}
[2] pry(#<Merchant>)> stripe_customer.sources.all
=> #<Stripe::ListObject:0x3ffdb7b42860> JSON: {
"object" : "list",
"data" : [],
"has_more" : false,
"url" : "/v1/customers/cus_7i3TMi5sqH78iY/sources"
}
[3] pry(#<Merchant>)> stripe_customer.sources
=> #<Stripe::ListObject:0x3ffdb75a2f90> JSON: {
"object" : "list",
"data" : [
{
"id" : "ba_82xZOcvz6SNFx9",
"object" : "bank_account",
"account_holder_name" : "John Doe",
"account_holder_type" : "company",
"bank_name" : "STRIPE TEST BANK",
"country" : "US",
"currency" : "usd",
"customer" : "cus_7i3TMi5sqH78iY",
"fingerprint" : "rwb34mTnXGxlmtBx",
"last4" : "6789",
"metadata" : {},
"routing_number" : "110000000",
"status" : "new",
"name" : "John Doe"
}
],
"has_more" : false,
"total_count" : 1,
"url" : "/v1/customers/cus_7i3TMi5sqH78iY/sources"
}
[4] pry(#<Merchant>)> stripe_customer.sources.all
=> #<Stripe::ListObject:0x3ffdb74a2fa0> JSON: {
"object" : "list",
"data" : [],
"has_more" : false,
"url" : "/v1/customers/cus_7i3TMi5sqH78iY/sources"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment