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.
- 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
Include the following in your Gemfile
gem "synapse_client"
and then run bundle install
.
You can also simply run gem install synapse_client
.
See the specs for the most up to date usage demo.
SynapseClient.client_id = "e06fa0f143a267c2ed8e"
SynapseClient.client_secret = "f578105bf9ae03d9310e0af6f4637c1bf363998b"
SynapseClient.merchant_synapse_id = 1
SynapseClient.dev = true
SynapseClient::Customer.create({
:email => "[email protected]",
:fullname => "Foo Bar,
:phonenumber => "5555555555",
:ip_address => "8.8.8.8",
:force_create => true
})
SynapseClient::Customer.retrieve("_customer_access_token_")
@customer.bank_accounts
@customer.add_bank_account({
:account_num => "1111111111",
:routing_num => "084000026",
:nickname => "Example bank account",
:account_type => "1",
:account_class => "1"
})
@customer.link_bank_account({
:username => "synapse_good",
:password => "test1234",
:pin => "1234",
:bank => "Bank of America"
})
@customer.orders
@customer.add_order({
:amount => 500, # $500 USD
:bank_id => 1
})
SynapseClient::Order.retrieve(4)
- Add KYC Documents
- Logger config
- MassPay
- Security Questions
- Deposits
- Withdrawals
- Callbacks?
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: