Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 1.41 KB

1_overview.md

File metadata and controls

50 lines (31 loc) · 1.41 KB

Using Pay with Lemon Squeezy

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

Creating Customers

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

Subscriptions

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.

Configuration

API Key

You can generate an API key here

Store ID

Certain API calls require a Store ID. You can find this here.

Signing Secret

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.

Environment Variables

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