QuadPay provides Spree stores the spree_quad_pay gem for integrating QuadPay into your Spree store.
- Add this extension to your Gemfile with this line:
gem 'spree_quad_pay', github: 'quadpay/quadpay-spree', branch: '3-3-stable'
- Install the gem using Bundler:
- Copy & run migrations
bundle exec rails g spree_quad_pay:install
- Setup a task scheduler to synchronize QuadPay order status
If your environment supports cronjobs, you can use
whenever to schedule the recurring tasks to synchronize orders:
bundle exec whenever --update-crontab
If you are using Heroku or another environment that doesn't support cronjobs, use rake task combine with Heroku Scheduler or another background job processing framework:
Create the QuadPay Payment Method.
- Login into the Spree Admin Dashboard and go to Configurations > Payment Method, click the button New Payment Method.
- On the new payment method page, set the PROVIDER field to
Spree::BillingIntegration::QuadPayCheckoutand enter a Name and Description.
- Click Create.
Setup the QuadPay API keys and Settings.
Go to Configurations > QuadPay Settings and enter the information below:
String, eg. https://www.mycompany.shop
This URL is used for QuadPay callback calls
String, eg. my-company
Merchant Name provided by QuadPay
Client ID provided by QuadPay
Any positive integer
The Order minimum product/cart amount as agreed upon with QuadPay
Any positive integer
The Order maximum product/cart amount as agreed upon with QuadPay
Display Widget At Product Page
Display Widget At Cart Page
Toggle Test Mode or Live Mode
- Restart your server
By default, the gem hooks into the regular Spree workflows for Refunds and Order cancellation.
If you are using custom workflows for Shipping, Refunds or Cancellations, you may wish to explore the built in
Spree::BillingIntegration::QuadPayCheckout object to trigger QuadPay commands. The following actions are supported:
* create_order: create QuadPay Order * find_order: find QuadPay Order based on token provided * refund: refund with QuadPay payment based on the Payment's response code * credit: partial refund back to User * cancel: full refund
For guidance on customizing the styling of the widget, visit the QuadPay Widget Integration Guide.
These instructions are for a Spree store using a lightly customized theme. If the store's theme is heavily customized, further customization may be necessary. If you would like support with the QuadPay integration please get in touch with us.
Updated 2 years ago
Now that you've added the QuadPay gateway and integrated the QuadPay widget, be sure to follow these quality assurance steps: