Skip to content

Instantly share code, notes, and snippets.

@eterry1388
Created November 9, 2022 00:15
Show Gist options
  • Save eterry1388/a09ddb4b00ca6be8f5528e4db41f06ac to your computer and use it in GitHub Desktop.
Save eterry1388/a09ddb4b00ca6be8f5528e4db41f06ac to your computer and use it in GitHub Desktop.
Associate a Stripe token to a Customer record
require "stripe"
Stripe.api_key = "sk_test_..."
token_id = "tok_..."
customer_id = "cus_..."
Stripe::Customer.create_source(
customer_id,
{ source: token_id },
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment