I’m trying to send this string to my Stripe account to process a transaction, and I want to send both an ID of the item being bought and the amount paid for as a JSON string. How do I include the pieces of the model in the string?
customer = Stripe::Customer.create(email: email, description: {"amount:" amount, "id:" idea_id}')
One part of the model is amount and the other is idea_id
Assuming your model is called Product
or you can also use
However this may not work if you absolutely require the key for idea_id to be ‘id’. in which case use the first option.
Hope this helps