class Privacy::Client

Defined in:

privacy/client.cr

Constant Summary

PROD_URL = "https://api.privacy.com/v1"
SANDBOX_URL = "https://sandbox.privacy.com/v1"

Constructors

Instance Method Summary

Constructor Detail

def self.new(token : String, debug_mode : Bool = false) #

[View source]

Instance Method Detail

def add_bank(routing_number : Int32, account_number : Int32, account_name : String | Nil = nil) #

This action requires an Enterprise account API Docs


[View source]
def authorize(descriptor : String, pan : String, amount : Int32) #

Authorization request Returns a json response containing a token to use in void or clear requests. API Docs


[View source]
def cards(page : Int32 | Nil = nil, page_size : Int32 | Nil = nil, start_date : String | Nil = nil, end_date : String | Nil = nil, card_token : String | Nil = nil) #

List cards of the token API Docs


[View source]
def clear(token : String, amount : Int32) #

Clears an authorization request API Docs


[View source]
def create_card(name : String | Nil = nil, spend_limit : Int32 | Nil = nil, spend_limit_duration : Card::Limit | Nil = nil, type : Card::Type = Card::Type::SINGLE_USE) #

This action requires a premium subscription API Docs


[View source]
def funding_sources(filter_type : String | Nil = nil) #

List funding accounts for an account API Docs


[View source]
def request(method : String, path : String, body : String | Nil = nil) #

TODO Handle 'rate-limits' and errors


[View source]
def return(descriptor : String, pan : String, amount : Int32) #

Refunds an amount back to the card Returns a token for the trasaction API Docs


[View source]
def transactions(approval_status : ApprovalStatus = ApprovalStatus::ALL, page : Int32 | Nil = nil, page_size : Int32 | Nil = nil, start_date : String | Nil = nil, end_date : String | Nil = nil, card_token : String | Nil = nil, transaction_token : String | Nil = nil) #

List transactions from token API Docs


[View source]
def update_card(card_token : String, state : Card::State | Nil = nil, name : String | Nil = nil, spend_limit : Int32 | Nil = nil, spend_limit_duration : Card::Limit | Nil = nil) #

This action requires a premium subscription Note: Setting a card to CLOSED CANNOT BE UNDONE API Docs


[View source]
def void(token : String, amount : Int32) #

Void a pending authorization Returns error if token is not valid, otherwise returns nothing (in sandbox mode returns debug request id) API Docs


[View source]