Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pay-rails/pay
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Nov 12, 2024
2 parents 03cada6 + 2fe1083 commit e5fbeba
Show file tree
Hide file tree
Showing 11 changed files with 241 additions and 219 deletions.
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

130 changes: 66 additions & 64 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.2.1.2)
actionpack (= 7.2.1.2)
activesupport (= 7.2.1.2)
actioncable (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.1.2)
actionpack (= 7.2.1.2)
activejob (= 7.2.1.2)
activerecord (= 7.2.1.2)
activestorage (= 7.2.1.2)
activesupport (= 7.2.1.2)
actionmailbox (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
mail (>= 2.8.0)
actionmailer (7.2.1.2)
actionpack (= 7.2.1.2)
actionview (= 7.2.1.2)
activejob (= 7.2.1.2)
activesupport (= 7.2.1.2)
actionmailer (7.2.2)
actionpack (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activesupport (= 7.2.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.1.2)
actionview (= 7.2.1.2)
activesupport (= 7.2.1.2)
actionpack (7.2.2)
actionview (= 7.2.2)
activesupport (= 7.2.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
Expand All @@ -38,36 +38,37 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.1.2)
actionpack (= 7.2.1.2)
activerecord (= 7.2.1.2)
activestorage (= 7.2.1.2)
activesupport (= 7.2.1.2)
actiontext (7.2.2)
actionpack (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.1.2)
activesupport (= 7.2.1.2)
actionview (7.2.2)
activesupport (= 7.2.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.1.2)
activesupport (= 7.2.1.2)
activejob (7.2.2)
activesupport (= 7.2.2)
globalid (>= 0.3.6)
activemodel (7.2.1.2)
activesupport (= 7.2.1.2)
activerecord (7.2.1.2)
activemodel (= 7.2.1.2)
activesupport (= 7.2.1.2)
activemodel (7.2.2)
activesupport (= 7.2.2)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
timeout (>= 0.4.0)
activestorage (7.2.1.2)
actionpack (= 7.2.1.2)
activejob (= 7.2.1.2)
activerecord (= 7.2.1.2)
activesupport (= 7.2.1.2)
activestorage (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activesupport (= 7.2.2)
marcel (~> 1.0)
activesupport (7.2.1.2)
activesupport (7.2.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
Expand All @@ -85,9 +86,10 @@ GEM
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.3.0)
bigdecimal (3.1.8)
bindex (0.8.1)
braintree (4.22.0)
braintree (4.23.0)
builder (>= 3.2.4)
rexml (>= 3.1.9)
builder (3.3.0)
Expand All @@ -97,7 +99,7 @@ GEM
bigdecimal
rexml
crass (1.0.6)
date (3.3.4)
date (3.4.0)
drb (2.2.1)
erubi (1.13.0)
faraday (2.11.0)
Expand All @@ -118,7 +120,7 @@ GEM
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.4)
json (2.7.5)
language_server-protocol (3.17.0.3)
lemonsqueezy (1.0.1)
faraday (~> 2.0)
Expand Down Expand Up @@ -164,7 +166,7 @@ GEM
faraday (~> 2.11.0)
ostruct (~> 0.6.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
pdf-core (0.10.0)
Expand All @@ -189,30 +191,30 @@ GEM
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.2.1.2)
actioncable (= 7.2.1.2)
actionmailbox (= 7.2.1.2)
actionmailer (= 7.2.1.2)
actionpack (= 7.2.1.2)
actiontext (= 7.2.1.2)
actionview (= 7.2.1.2)
activejob (= 7.2.1.2)
activemodel (= 7.2.1.2)
activerecord (= 7.2.1.2)
activestorage (= 7.2.1.2)
activesupport (= 7.2.1.2)
rails (7.2.2)
actioncable (= 7.2.2)
actionmailbox (= 7.2.2)
actionmailer (= 7.2.2)
actionpack (= 7.2.2)
actiontext (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activemodel (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
bundler (>= 1.15.0)
railties (= 7.2.1.2)
railties (= 7.2.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.2.1.2)
actionpack (= 7.2.1.2)
activesupport (= 7.2.1.2)
railties (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand All @@ -239,7 +241,7 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
rubocop-ast (1.33.0)
parser (>= 3.3.1.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
Expand All @@ -254,10 +256,10 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (2.1.1)
sqlite3 (2.2.0)
mini_portile2 (~> 2.8.0)
sqlite3 (2.1.1-x86_64-darwin)
sqlite3 (2.1.1-x86_64-linux-gnu)
sqlite3 (2.2.0-x86_64-darwin)
sqlite3 (2.2.0-x86_64-linux-gnu)
standard (1.41.1)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
Expand All @@ -273,7 +275,7 @@ GEM
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.1)
stripe (13.0.2)
stripe (13.1.0)
thor (1.3.2)
timeout (0.4.1)
ttfunk (1.8.0)
Expand All @@ -297,7 +299,7 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.2)
webrick (1.9.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -335,4 +337,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
2.5.18
2.5.22
4 changes: 2 additions & 2 deletions docs/1_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Pay's installation is pretty straightforward. We'll add the gems, add some migra
Add these lines to your application's Gemfile:

```ruby
gem "pay", "~> 7.0"
gem "pay", "~> 8.0"

# To use Stripe, also include:
gem "stripe", "~> 12.0"
gem "stripe", "~> 13.0"

# To use Braintree + PayPal, also include:
gem "braintree", "~> 4.7"
Expand Down
15 changes: 12 additions & 3 deletions docs/lemon_squeezy/1_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,23 @@ Lemon Squeezy works differently than most of the other payment processors so it

## Creating Customers

You can create a customer, which subscriptions belong to.
First, you tell Pay which payment processor to use:

```ruby
# Set the payment processor
@user.set_payment_processor :lemon_squeezy
```

Then you can create a [Checkout](https://docs.lemonsqueezy.com/api/checkouts/create-checkout) to let the user purchase a product.

# Create the customer on Lemon Squeezy
@user.payment_processor.customer
```ruby
@user.payment_processor.checkout(variant_id: "xyz")
```

Customers are lazy created, so they won't be created until you create a Checkout or ask for the Lemon Squeezy customer object through Pay.

```ruby
@user.payment_processor.api_record
```

## Subscriptions
Expand Down
2 changes: 1 addition & 1 deletion docs/stripe/1_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Promotion codes are customer-facing coupon codes that can be applied in several
You can apply a promotion code on the Stripe::Customer to have it automatically apply to all Subscriptions.

```ruby
@user.payment_processor.update_customer!(promotion_code: "promo_1234")
@user.payment_processor.update_api_record(promotion_code: "promo_1234")
```

Promotion codes can also be applied directly to a subscription:
Expand Down
2 changes: 1 addition & 1 deletion docs/stripe/7_stripe_tax.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
To update the customer address anytime it's changed, call the following method:

```ruby
@user.payment_processor.update_customer!
@user.payment_processor.update_api_record
```

This will make an API request to update the Stripe::Customer with the current `stripe_attributes`.
Expand Down
13 changes: 7 additions & 6 deletions gemfiles/rails_6.1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ GEM
base64 (0.2.0)
bigdecimal (3.1.8)
bindex (0.8.1)
braintree (4.22.0)
braintree (4.23.0)
builder (>= 3.2.4)
rexml (>= 3.1.9)
builder (3.3.0)
Expand All @@ -85,7 +85,7 @@ GEM
bigdecimal
rexml
crass (1.0.6)
date (3.3.4)
date (3.4.0)
erubi (1.13.0)
faraday (2.11.0)
faraday-net_http (>= 2.0, < 3.4)
Expand All @@ -101,7 +101,7 @@ GEM
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
json (2.7.4)
json (2.7.5)
language_server-protocol (3.17.0.3)
lemonsqueezy (1.0.1)
faraday (~> 2.0)
Expand Down Expand Up @@ -146,7 +146,7 @@ GEM
faraday (~> 2.11.0)
ostruct (~> 0.6.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
pdf-core (0.10.0)
Expand Down Expand Up @@ -209,7 +209,7 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
rubocop-ast (1.33.0)
parser (>= 3.3.1.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
Expand Down Expand Up @@ -240,7 +240,7 @@ GEM
rubocop-performance (~> 1.22.0)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stripe (13.0.2)
stripe (13.1.0)
thor (1.3.2)
timeout (0.4.1)
ttfunk (1.8.0)
Expand Down Expand Up @@ -272,6 +272,7 @@ PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-20
x86_64-darwin-21
x86_64-darwin-22
Expand Down
Loading

0 comments on commit e5fbeba

Please sign in to comment.