Project

square

0.02
No commit activity in last 3 years
No release in over 3 years
Square API client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Square

Square API Client

https://connect.squareup.com

Installation

Add this line to your application's Gemfile:

gem 'square'

And then execute:

$ bundle

Or install it yourself as:

$ gem install square

Usage

OAuth 2.0

client = Square::OAuth2::Client.new(
  '<your-client-id>',
  '<your-client-secret>',
  redirect_uri: 'https://client.example.com/callback'
)

## Authorization Request
redirect_to client.authorization_uri

## Token Request
client.authorization_code = '<your-authorization-code>'
access_token = client.access_token!

Connect API

me = Square::Connect::Merchant.me access_token

## Merchant API
me = me.fetch

## Payments API
payments = me.payments

## Payment API
payment = me.payment '<payment-id>'

## Refunds API
refunds = me.refunds

## Settlements API
settlements = me.settlements

## Settlement API
settlement = me.settlement '<settlement-id>'

## Bank Account API
bank_account = me.bank_account '<bank-accout-id>'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request