GithubHelp home page GithubHelp logo

synapse_client's Introduction

Build Status Gem Version Coverage Status

synapse_client

A ruby client for the SynapsePay.com API.

I originally wrote this in a rails app of mine and stripped this out. There's some work left to do to really make it a true ruby gem. See that in the todo section.

Notes

  • This is written with the perspective of being the merchant. This gem doesn't support marketplace payments yet, although SynapsePay does support that.
  • This is also written with the assumption that a customer has no knowledge of their Synapse account. This means:
    • that this gem says "Customers" when Synapse says "Users"
    • all orders are bank pay orders
    • customers do not have passwords

Installation

Include the following in your Gemfile

  gem "synapse_client"

and then run bundle install.

You can also simply run gem install synapse_client.

Usage

See the specs for the most up to date usage demo.

configuration

  SynapseClient.client_id           = "e06fa0f143a267c2ed8e"
  SynapseClient.client_secret       = "f578105bf9ae03d9310e0af6f4637c1bf363998b"
  SynapseClient.merchant_synapse_id = 1
  SynapseClient.dev                 = true

create a customer

  SynapseClient::Customer.create({
    :email        => "[email protected]",
    :fullname     => "Foo Bar,
    :phonenumber  => "5555555555",
    :ip_address   => "8.8.8.8",
    :force_create => true
  })

retrieve a customer

  SynapseClient::Customer.retrieve("_customer_access_token_")

list bank accounts for a customer

  @customer.bank_accounts

add a bank account to a customer with just account & routing number

  @customer.add_bank_account({
    :account_num   => "1111111111",
    :routing_num   => "084000026",
    :nickname      => "Example bank account",
    :account_type  => "1",
    :account_class => "1"
  })

link a bank account to a customer with bank username/password

  @customer.link_bank_account({
    :username => "synapse_good",
    :password => "test1234",
    :pin      => "1234",
    :bank     => "Bank of America"
  })

get recent orders for a customer

  @customer.orders

add an order for a customer

  @customer.add_order({
    :amount  => 500,      # $500 USD
    :bank_id => 1
  })

retrieve an order

  SynapseClient::Order.retrieve(4)

TODO (in order of priority)

  • Add KYC Documents
  • Logger config
  • MassPay
  • Security Questions
  • Deposits
  • Withdrawals
  • Callbacks?

Links

Want to show your appreciation?

If this gem has helped you and you'd like to show your appreciation, feel free to use one of the methods below to buy me coffee:

SquareCash

Support via Gratipay

synapse_client's People

Contributors

milesmatthias avatar rebelvc avatar jordyone avatar

Stargazers

Lindsay Hohn avatar Joe Wang avatar Julien avatar Gene Kobilansky avatar Dorian Karter avatar lawson bae avatar Justin McNally avatar

Watchers

 avatar James Cloos avatar Sankaet Pathak avatar lawson bae avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.