pay-rails / pay

Payments for Ruby on Rails apps
https://github.com/pay-rails/pay
MIT License
1.98k stars 316 forks source link

Lemon Squeezy Outstanding Items #1041

Closed excid3 closed 3 months ago

excid3 commented 3 months ago

Lemon Squeezy seems to be missing one-time payments functionality:

(Correct me if I'm wrong @deanpcmad 😜)

excid3 commented 3 months ago

Looks like we can pass custom data to the Checkout which gets included in Webhooks (but not API calls?!) which we could in theory use for passing the user ID. May not be that useful if we cannot sync it via API calls.

https://docs.lemonsqueezy.com/guides/developer-guide/taking-payments#passing-custom-data

deanpcmad commented 3 months ago

Ah good point. I forget that Pay is not just for subscriptions.

The Charge code currently looks at the Subscription Invoice API, but the Order API is similar. However, it doesn't have the card brand or last4 🤔

excid3 commented 3 months ago

Hah, of course not! 🫠

We probably don't need it, it's more of a nice to have.

excid3 commented 3 months ago

Potential problem:

Orders & SubscriptionInvoices are separate. If we store the processor_id as the Order ID or the SubscriptionInvoice ID, we might end up with duplicates. We could prefix the processor ID and remove it when looking up API records for refunds.

We also don't want to record an Order and the first Subscription Invoice which will be a duplicate.

We may only want to use an Order to create a charge when there are not subscriptions for it.

deanpcmad commented 3 months ago

Yeah it's annoying they have 2 separate order types