Comments (5)
We are looking at building out a subscription implementation on top of solidus_stripe
, and persistent customer accounts are a critical first step, so adding a +1 to this. LMK if I can help with a PR...
from solidus_stripe.
It seems to me that in an ideal world, this extension would include a migration to add a stripe_gateway_customer_id
to the Spree::Users
table.
But, maybe there's another way to do it. When creating a new Spree::CreditCard
object, we can attempt to populate the gateway_customer_id
field like so:
gateway_customer_profile_id = source.user&.
payment_sources&.where&.not(gateway_customer_profile_id: nil)&.order(:updated_at)&.last&.
gateway_customer_profile_id
@spaghetticode What do you think about trying something like that?
from solidus_stripe.
Updating with two pieces of information. First is that I've created a (failing) spec at #77 to demonstrate this issue.
Second is that I have begun tracking down the cause. I believe the key lines are here:
solidus_stripe/app/models/spree/payment_method/stripe_credit_card.rb
Lines 122 to 139 in eca6dc2
Here you can see how we're setting the gateway_customer_profile_id
. Of course, a trivial way to make the specs in #77 pass would be to change the lines that directly update the payment source, but this would not be sufficient because the data would look right to Solidus and in the database, but would not actually be correct in Stripe.
It seems that we need to link this to the customer either before or during the call to gateway.store
. This method lives in ActiveMerchant. So, I'll keep digging and update this thread when I learn more.
from solidus_stripe.
Update: the specs are now green in #77, which should solve this issue.
from solidus_stripe.
This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.
from solidus_stripe.
Related Issues (20)
- Support creating payments from admin HOT 1
- Consider adding placeholder #authorize and #purchase methods to the gateway
- Synchronize or remove customer email from Stripe
- [v4.4] Migration does not update all `Spree::Preference`s used by `solidus_gateway` HOT 4
- Make `EventWithContextFactory` publicly accessible HOT 3
- Add `stripe` to available payments in the solidus installer
- Announce the release in the Solidus Slack
- Allow admin to create payments using Stripe elements
- Allow admin to reuse existing payment sources
- Support idempotent requests
- Consolidate naming for Solidus/Stripe payment methods HOT 4
- Compact migrations before the final 5.0 release
- Problems detecting and using Stripe payment methods other than credit cards
- Error displaying stripe form when store credits > order.total HOT 5
- Store credits leaving insufficient balance for Stripe payments HOT 2
- Removing the confirm step causes stripe failed payments (due to 3DS) to show up as paid
- Tests crash on a new solidus project with solidus_starter_frontend and stripe HOT 1
- Add support for v4 intents payment sources saved in wallet_payment_sources HOT 1
- Detach old payment methods from stripe customer as there is a limit of 100 payment methods per customer
- A stripe customer cannot have more than 100 stripe payment methods
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solidus_stripe.