- Client
- User
- Get New Oauth
- Update User or Update/Add Documents
- Generate UBO
- Get All User Nodes
- Get All User Transactions
- Set up a .env file to fetch your client_id and client_secret
- Returns Client instance
args = {
# synapse client_id
client_id: ENV.fetch("client_id"),
# synapse client_secret
client_secret: ENV.fetch("client_secret"),
# a hashed value, either unique to user or static for app
fingerprint: "fp",
# end user's IP
ip_address: 'ip',
# (optional) requests go to sandbox endpoints if true
development_mode: true,
# (optional) if true logs requests to stdout
logging: true,
# (optional) file path to write logs to
log_to: nil,
# (optional) rases for 2FA and MFA if set to true
raise_for_202: true
}
client = Synapse::Client.new(args)
- Returns user instance
ip_address = "127.0.0"
fingerprint = "234092485wsf"
idemopotency_key = "222222"
payload = {
"logins": [
{
"email": "[email protected]"
}
],
"phone_numbers": [
"901.111.1111",
"[email protected]"
],
"legal_names": [
"Test User"
],
"extra": {
"supp_id": "122eddfgbeafrfvbbb",
"cip_tag":1,
"is_business": false
}
}
user = client.create_user(payload: payload, ip_address: ip_address, fingerprint: fingerprint, idemopotency_key: idemopotency_key)
- returns USER instance
user_id = "1232"
fingerprint = "234092485wsf"
ip_address = "127.0.0"
user = client.get_user(user_id: user_id, ip_address: ip_address, fingerprint: fingerprint, full_dehydrate: true)
- Returns subscription instace
scope = {
"scope": [
"USERS|POST",
"USER|PATCH",
"NODES|POST",
"NODE|PATCH",
"TRANS|POST",
"TRAN|PATCH"
],
"url": "https://requestb.in/zp216zzp"
}
subscription = client.create_subscriptions(scope: scope)
- returns a subscription instance
subscription_id = "2342324"
subscription = client.get_subscription(subscriptions_id: subscription_id)
- Updates a subscription scope, active or url
- Returns a subscription instance
subscription_id = "2342324"
body = {
"is_active": true,
"scope": [
"USERS|POST",
"NODES|POST",
"TRANS|POST"
]
"url": 'https://requestb.in/zp216zzp'
}
subscription = client.update_subscriptions(subscription_id: subscription_id , body: body)
- returns USERS instance
- Array of users on a platform
# param page (optional) response will default to 1
# param per_page [Integer] (optional) response will default to 20
users = client.get_users(page: 5, per_page: 5)
- returns Transactions instance
- array of Transaction instance
trans = client.get_transaction(page: 5, per_page: 5)
- Returns Nodes instance
- Array of Node instance
- Page (optional params)
- Per Page (optional params)
# param page (optional) response will default to 1
# param per_page [Integer] (optional) response will default to 20
Nodes = client.get_all_nodes(page: 5, per_page: 5)
- Returns institutions available for bank logins
- Page (optional params)
- Per Page (optional params)
# param page (optional) response will default to 1
# param per_page [Integer] (optional) response will default to 20
institutions = client.get_all_institutions(page: 5, per_page: 5)
- Returns api response
scope = ["USERS|GET","USER|GET","USER|PATCH"]
public_key = client.issue_public_key(scope: scope)
scope =["USERS|GET","USER|GET","USER|PATCH"]
user.authenticate(scope: scope)
body = {
"update":{
"login":{
"email":"[email protected]"
},
"remove_login":{
"email":"[email protected]"
},
"phone_number":"901-111-2222",
"remove_phone_number":"901.111.1111"
}
}
user = user.user_update(payload:body)
- Upload an Ultimate Beneficial Ownership or REG GG Form
body = {
"entity_info": {
"cryptocurrency": True,
"msb": {
"federal": True,
"states": ["AL"]
},
"public_company": False,
"majority_owned_by_listed": False,
"registered_SEC": False,
"regulated_financial": False,
"gambling": False,
"document_id": "2a4a5957a3a62aaac1a0dd0edcae96ea2cdee688ec6337b20745eed8869e3ac8"
...
}
user.create_ubo(payload:body)
Nodes = user.get_all_nodes(page=1, per_page=5, type='ACH-US')
- Returns transactons instance
# param page (optional) response will default to 1
# param per_page (optional) response will default to 20
transactions = user.get_user_transactions(page=1, per_page=5)
Refer to the following docs for how to setup the payload for a specific Node type:
- Deposit Accounts
- Card Issuance
- ACH-US with Logins
- ACH-US MFA
- ACH-US with AC/RT
- INTERCHANGE-US
- CHECK-US
- CRYPTO-US
- WIRE-US
- WIRE-INT
- IOU
body = {
"type": "DEPOSIT-US",
"info":{
"nickname":"My Checking"
}
}
node = user.create_node(payload:, idempotency_key='123456')
node_id = "5bd9e7b3389f2400adb012ae"
node = user.get_user_node(node_id: node_id, full_dehydrate: true, force_refresh: true)
Nodes = user.get_all_nodes(page=1, per_page=5, type='ACH-US')
- Param node_id
- Param payload
node_id = '5ba05ed620b3aa005882c52a'
body = {
"supp_id":"new_supp_id_1234"
}
node = user.generate(node_id:node_id, payload:body)
node_id = '5ba05ed620b3aa005882c52a'
body = {
"fee_node_id":"5ba05e7920b3aa006482c5ad",
"expedite":True
}
node = user.ship_card_node(node_id: node_id, payload: body)
node_id = '5ba05ed620b3aa005882c52a'
node = user.reset_card_node(node_id: node_id)
node_id = '5ba05ed620b3aa005882c52a'
body = {
"micro":[0.1,0.1]
}
node = user.verify_micro_deposit(node_id: node_id, payload: body)
node_id = '5ba05ed620b3aa005882c52a'
node = user.reinitiate_micro_deposit(node_id: node_id)
node_id = '5ba05ed620b3aa005882c52a'
body = {
"certificate": "your applepay cert",
"nonce": "9c02xxx2",
"nonce_signature": "4082f883ae62d0700c283e225ee9d286713ef74"
}
response = user.generate_apple_pay_token(node_id: node_id, payload: body)
node_id = '594e606212e17a002f2e3251'
response = user.delete_node(node_id: node_id)
node_id = '594e606212e17a002f2e3251'
subnets = user.get_all_subnets(node_id:node_id, page=4, per_page=10)
node_id = '594e606212e17a002f2e3251'
nodes = user.get_all_node_transaction(node_id: node_id, page=4, per_page=10)
node_id = '594e606212e17a002f2e3251'
body = {
"nickname":"Test AC/RT"
}
user.create_subnet(node_id: node_id, payload: body)
node_id = '594e606212e17a002f2e3251'
subnet_id = '59c9f77cd412960028b99d2b'
subnet = user.get_subnet(node_id: node_id, subnet_id: subnet_id)
node_id = '594e606212e17a002f2e3251'
subnet_id = '59c9f77cd412960028b99d2b'
body = {
"preferences": {
"allow_foreign_transactions":true,
"daily_atm_withdrawal_limit":100,
"daily_transaction_limit":900
}
}
subnet = user.update_subnet(node_id: node_id, payload: body, subnet_id: subnet_id)
node_id = '594e606212e17a002f2e3251'
body = {
"to": {
"type": "ACH-US",
"id": "594e6e6c12e17a002f2e39e4"
},
"amount": {
"amount": 20.1,
"currency": "USD"
},
"extra": {
"ip": "192.168.0.1"
}
}
transaction = user.create_transaction(node_id: node_id, payload: body, idempotency_key:"2435")
- Param node_id
- Param trans_id
node_id = '594e606212e17a002f2e3251'
trans_id = '594e72124599e8002fe62e4f'
transaction = user.get_node_transaction(node_id: node_id, trans_id: trans_id)
node_id = '594e606212e17a002f2e3251'
trans_id = '594e72124599e8002fe62e4f'
body = 'Pending verification...'
transaction = user.comment_transaction(node_id: node_id, trans_id: trans_id, payload: body)
node_id = '594e606212e17a002f2e3251'
trans_id = '594e72124599e8002fe62e4f'
dispute_reason = {
"dispute_reason":"CHARGE_BACK"
}
response = user.dispute_user_transactions(node_id:, trans_id:)
node_id = '594e606212e17a002f2e3251'
trans_id = '594e72124599e8002fe62e4f'
response = user.cancel_transaction(node_id: node_id, trans_id: trans_id)