Zip provides Spree stores the spree_quad_pay gem for integrating Zip 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 Zip 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 Zip 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 Zip 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 Zip callback calls
String, eg. my-company
Merchant Name provided by Zip
Client ID provided by Zip
Any positive integer
The Order minimum product/cart amount as agreed upon with Zip
Any positive integer
The Order maximum product/cart amount as agreed upon with Zip
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 Zip commands. The following actions are supported:
* create_order: create Zip Order * find_order: find Zip Order based on token provided * refund: refund with Zip 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 Zip 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 Zip integration please get in touch with us.
Updated 2 months ago
Now that you've added the Zip gateway and integrated the Zip widget, be sure to follow these quality assurance steps: