Lemon Squeezy works differently than most of the other payment processors so it comes with some limitations and differences.
- Checkout only happens via iFrame or hosted page
- Cancelling a subscription cannot be resumed
You can create a customer, which subscriptions belong to.
# Set the payment processor
@user.set_payment_processor :lemon_squeezy
# Create the customer on Lemon Squeezy
@user.payment_processor.customer
Lemon Squeezy subscriptions are not created through the API, but through Webhooks. When a subscription is created, Lemon Squeezy will send a webhook to your application. Pay will automatically create the subscription for you.
You can generate an API key here
Certain API calls require a Store ID. You can find this here.
When creating a webhook, you have the option to set a signing secret. This is used to verify that the webhook request is coming from Lemon Squeezy.
You'll find this page here.
Pay will automatically look for the following environment variables, or the equivalent Rails credentials:
LEMON_SQUEEZY_API_KEY
LEMON_SQUEEZY_STORE_ID
LEMON_SQUEEZY_SIGNING_SECRET