solidusio / solidus_stripe

πŸ’³ Integrate Solidus with Stripe
https://stripe.com
BSD 3-Clause "New" or "Revised" License
36 stars 62 forks source link

Implement API #327

Closed kchodorek closed 4 weeks ago

kchodorek commented 1 month ago

Summary

Recently, we've been working on a Solidus-based project that uses Solidus via an API. To enable Stripe payments within this setup, we needed to add additional API endpoints and logic for creating payment intents within Stripe. The intent information can later be used in combination with the Stripe Payment Element.

This PR aims to integrate these changes into the upstream solidus_stripe.

It adds the following API endpoints:

More details on these endpoints can be found in the README here.

The core logic of this change is encapsulated in service objects, making it easy to create these intents outside of the API as well (e.g., if you prefer a custom GraphQL mutation or need to create a payment intent outside of the regular checkout process for some reason).

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

kchodorek commented 1 month ago

@jarednorman Thanks for your comment! I adjusted the specs, now instead of stubbing, I'm using stripe-ruby-mock gem, tests are much cleaner now.