๐ณ Pay::Square โ Square for the Pay gem
A Square payment processor for Pay โ the payments engine for Ruby on Rails.
๐ฆ Extending Pay โ and why Square is its own gem
Pay already speaks Stripe, Braintree, Paddle, and Lemon Squeezy.
pay-square adds Square from the outside โ its own gem, no fork of Pay โ the same self-registering
plugin pattern as pay-asaas.
Pay's maintainer, Chris Oliver, both welcomed this and is taking the same direction for Pay's own processors:
I'm planning to extract Braintree and Paddle from the main gem. It doesn't bloat anything having them in the gem since they're lazy loaded, but easier to maintain. [โฆ] long-term we can add it to the pay org if you would like to keep maintaining it.
Not just a processor โ a marketplace integration
Braintree and Paddle are being split out for maintainability alone. Square is a different case: here it is used for marketplace payments โ Pay's term for charging on a connected merchant's own account and taking an application fee โ not merely to charge your own customers.
Square also issues a distinct OAuth access token per merchant (unlike Stripe Connect's single
platform key plus a stripe_account header). So pay-square charges on a merchant's own connected
Square account (the merchant, not you, is the merchant of record), building a Square::Client per
operation from a token you supply via Pay::Square.access_token_provider, and isolates customers per
merchant with a square_account column. That on-behalf-of, per-merchant model โ not plain processing โ
is a core reason Square belongs in its own gem.
Scope: card payments, card-on-file, refunds, and payment/refund/card/customer webhooks. Square OAuth, token refresh, payouts/reconciliation, catalog, and the checkout UI stay in your app.
๐ Requirements
๐ Docs
- Installation โ Gemfile, pre-releases, and the migration
- Configuration โ the per-merchant token resolver and credentials
- Usage โ charges, card-on-file, refunds, and per-merchant isolation
- Webhooks โ endpoint, signature verification, and handled events
- Versioning & releasing โ SemVer, tags, pre-releases, and publishing
- Contributing โ dev setup, running the tests, and opening issues
๐ Contributing
Bug reports, feature ideas, and pull requests are welcome. See CONTRIBUTING.md to get started.
๐ Links
pay-square on RubyGems ยท Changelog
The RubyGems and Pay logos are trademarks of their respective projects, used here to link to those projects, not to imply endorsement.
๐ License
MIT.