Quickstart for using Square's Web Payments SDK on Rails. This project is based on following documents.
-
https://developer.squareup.com/docs/web-payments/take-card-payment
-
https://github.com/square/web-payments-quickstart/blob/main/public/examples/card.html
Things you may want to cover:
- Ruby version: 2.7.1
- create file .env at root of project folder.
- In that .env, add following lines,and replace "?" with your sandbox environment values appropriately.
APPLICATION_ID="sandbox-?"
LOCATION_ID="?"
SQUARE_ACCESS_TOKEN="?"
- rails webpacker:install (if you need.)
- rails webpacker:compile (if you need.)
- bundle install
- start server(ex. rails s)