Created
November 9, 2022 00:15
-
-
Save eterry1388/a09ddb4b00ca6be8f5528e4db41f06ac to your computer and use it in GitHub Desktop.
Associate a Stripe token to a Customer record
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
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