Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidpatters0n/2ce480332b766de9db86af1138f82301 to your computer and use it in GitHub Desktop.
Save davidpatters0n/2ce480332b766de9db86af1138f82301 to your computer and use it in GitHub Desktop.
klass = Stripe::PaymentIntent
intent_params = {
payment_method: payment_method_id,
amount: amount,
currency: currency,
confirmation_method: 'manual',
confirm: true,
expand: ['payment_method']
}
intent = klass.create(intent_params, api_key) if payment_method_id
# When using a the card: 4111 1111 1111 1111 I get a response with the charge already processed
"receipt_email": null,
[2] pry(#<Api::V2::StripeEventsController>)> intent.charges
=> #<Stripe::ListObject:0x3ff6042e626c> JSON: {
"object": "list",
"data": [
{"id":"ch_1ESvqw42hvyHeN72wNsBOY6c","object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment