-
Notifications
You must be signed in to change notification settings - Fork 205
Conversation
…uldnt pass amount
…confirm_payment, like the docs recommend.
…. card_present is not relevant for this backend
Also, use_stripe_sdk comment, finish refactoring out create_payment_intent
* Add emoji store products to backend
web.rb
Outdated
elsif payload[:payment_method_id] | ||
# Create and confirm the PaymentIntent | ||
payment_intent = Stripe::PaymentIntent.create( | ||
:amount => 1099, # A real implementation would calculate the amount based on e.g. an order id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we calculate_price here like above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the Standard Integration app doesn't use manual confirmation, and I don't believe any of the manual confirmation examples use the emoji store. I guess it could be nice to have the other examples send lists of emoji too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Android sample store uses manual confirmation fwiw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshafrir-stripe Our docs default/preferred recommendation is automatic confirmation now, so it's prooobably better if the Android sample store aligned with that.
I am down to add a calculate_price
here though, since it won't break anything, and it's closer to what a real implementation looks like anyways.
Breaking changes
amount
andcurrency
is ignored, hardcoded on the backend instead. (https://jira.corp.stripe.com/browse/IOS-242)Automatic PI confirmation:
create_intent
->create_payment_intent
Manual PI confirmation:
capture_payment
, callconfirm_payment_intent
. Passpayment_method_id
instead ofpayment_method
.confirm_payment
, callconfirm_payment_intent
.secret
, if the PI status is...requires_action
-> returnsrequires_action: true, secret: abc
requires_capture
orsucceeded
-> returnssuccess: true
Other changes
Testing
Using 3ds1, 3ds2, error cards:
[x] Manual confirmation
[x] Automatic confirmation
[x] Setup Intent, SetupIntent Backend confirm
[x] Standard Integration
Tested webhooks for