Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Update to match docs #67

Merged
merged 22 commits into from
Sep 13, 2019
Merged

Update to match docs #67

merged 22 commits into from
Sep 13, 2019

Conversation

yuki-stripe
Copy link
Contributor

Breaking changes

Automatic PI confirmation:

  • Rename create_intent -> create_payment_intent

Manual PI confirmation:

  • Instead of capture_payment, call confirm_payment_intent. Pass payment_method_id instead of payment_method.
  • Instead of confirm_payment, call confirm_payment_intent.
  • Instead of returning secret, if the PI status is...
    • requires_action -> returns requires_action: true, secret: abc
    • requires_capture or succeeded -> returns success: true
    • anything else -> 500

Other changes

  • Fixed webhooks

Testing

Using 3ds1, 3ds2, error cards:

  • Custom Integration
    [x] Manual confirmation
    [x] Automatic confirmation
    [x] Setup Intent, SetupIntent Backend confirm
    [x] Standard Integration

Tested webhooks for

  • PI manual confirmation
  • Sofort

web.rb Outdated Show resolved Hide resolved
* 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
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

web.rb Show resolved Hide resolved
@yuki-stripe yuki-stripe merged commit 67cb89f into master Sep 13, 2019
@yuki-stripe yuki-stripe deleted the yuki-docs-parity branch September 13, 2019 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants