Class: BlockChyp::BlockChyp

Inherits:
BlockChypClient show all
Defined in:
lib/blockchyp.rb

Overview

the main autogenerated blockchyp client

Instance Attribute Summary

Attributes inherited from BlockChypClient

#api_key, #bearer_token, #gateway_host, #gateway_timeout, #https, #offline_cache_enabled, #offline_fixed_key, #route_cache, #route_cache_location, #route_cache_ttl, #signing_key, #terminal_connect_timeout, #terminal_timeout, #test_gateway_host

Instance Method Summary collapse

Methods inherited from BlockChypClient

#compute_hmac, #decrypt, #derive_offline_key, #encrypt, #evict, #gateway_request, #generate_error_response, #generate_gateway_headers, #get_http_request, #get_timeout, #initialize, #read_offline_cache, #request_route_from_gateway, #resolve_gateway_uri, #resolve_terminal_route, #resolve_terminal_uri, #route_cache_get, #route_terminal_request, #terminal_request, #update_offline_cache, #user_agent

Constructor Details

This class inherits a constructor from BlockChyp::BlockChypClient

Instance Method Details

#balance(request) ⇒ Object

Checks the remaining balance on a payment method.



84
85
86
# File 'lib/blockchyp.rb', line 84

def balance(request)
  route_terminal_request('POST', '/api/balance', '/api/balance', request)
end

#batch_details(request) ⇒ Object

Returns the batch details for a single batch.



200
201
202
# File 'lib/blockchyp.rb', line 200

def batch_details(request)
  gateway_request('POST', '/api/batch-details', request)
end

#batch_history(request) ⇒ Object

Returns the batch history for a merchant.



195
196
197
# File 'lib/blockchyp.rb', line 195

def batch_history(request)
  gateway_request('POST', '/api/batch-history', request)
end

#boolean_prompt(request) ⇒ Object

Asks the consumer a yes/no question.



126
127
128
# File 'lib/blockchyp.rb', line 126

def boolean_prompt(request)
  route_terminal_request('POST', '/api/boolean-prompt', '/api/boolean-prompt', request)
end

#capture(request) ⇒ Object

Captures a preauthorization.



136
137
138
# File 'lib/blockchyp.rb', line 136

def capture(request)
  gateway_request('POST', '/api/capture', request)
end

#capture_signature(request) ⇒ Object

Captures and returns a signature.



104
105
106
# File 'lib/blockchyp.rb', line 104

def capture_signature(request)
  route_terminal_request('POST', '/api/capture-signature', '/api/capture-signature', request)
end

#cash_discount(request) ⇒ Object

Calculates the discount for actual cash transactions.



190
191
192
# File 'lib/blockchyp.rb', line 190

def cash_discount(request)
  gateway_request('POST', '/api/cash-discount', request)
end

#charge(request) ⇒ Object

Executes a standard direct preauth and capture.



59
60
61
# File 'lib/blockchyp.rb', line 59

def charge(request)
  route_terminal_request('POST', '/api/charge', '/api/charge', request)
end

#clear(request) ⇒ Object

Clears the line item display and any in progress transaction.



89
90
91
# File 'lib/blockchyp.rb', line 89

def clear(request)
  route_terminal_request('POST', '/api/clear', '/api/terminal-clear', request)
end

#close_batch(request) ⇒ Object

Closes the current credit card batch.



160
161
162
# File 'lib/blockchyp.rb', line 160

def close_batch(request)
  gateway_request('POST', '/api/close-batch', request)
end

#customer(request) ⇒ Object

Retrieves a customer by id.



180
181
182
# File 'lib/blockchyp.rb', line 180

def customer(request)
  gateway_request('POST', '/api/customer', request)
end

#customer_search(request) ⇒ Object

Searches the customer database.



185
186
187
# File 'lib/blockchyp.rb', line 185

def customer_search(request)
  gateway_request('POST', '/api/customer-search', request)
end

#enroll(request) ⇒ Object

Adds a new payment method to the token vault.



74
75
76
# File 'lib/blockchyp.rb', line 74

def enroll(request)
  route_terminal_request('POST', '/api/enroll', '/api/enroll', request)
end

#gift_activate(request) ⇒ Object

Activates or recharges a gift card.



79
80
81
# File 'lib/blockchyp.rb', line 79

def gift_activate(request)
  route_terminal_request('POST', '/api/gift-activate', '/api/gift-activate', request)
end

#heartbeat(test) ⇒ Object



49
50
51
# File 'lib/blockchyp.rb', line 49

def heartbeat(test)
  gateway_request('GET', '/api/heartbeat', { test: test })
end

#merchant_profile(request) ⇒ Object

Returns profile information for a merchant.



210
211
212
# File 'lib/blockchyp.rb', line 210

def merchant_profile(request)
  gateway_request('POST', '/api/public-merchant-profile', request)
end

#message(request) ⇒ Object

Displays a short message on the terminal.



121
122
123
# File 'lib/blockchyp.rb', line 121

def message(request)
  route_terminal_request('POST', '/api/message', '/api/message', request)
end

#new_transaction_display(request) ⇒ Object

Displays a new transaction on the terminal.



109
110
111
# File 'lib/blockchyp.rb', line 109

def new_transaction_display(request)
  route_terminal_request('POST', '/api/txdisplay', '/api/terminal-txdisplay', request)
end

#ping(request) ⇒ Object

Tests connectivity with a payment terminal.



54
55
56
# File 'lib/blockchyp.rb', line 54

def ping(request)
  route_terminal_request('POST', '/api/test', '/api/terminal-test', request)
end

#preauth(request) ⇒ Object

Executes a preauthorization intended to be captured later.



64
65
66
# File 'lib/blockchyp.rb', line 64

def preauth(request)
  route_terminal_request('POST', '/api/preauth', '/api/preauth', request)
end

#refund(request) ⇒ Object

Executes a refund.



69
70
71
# File 'lib/blockchyp.rb', line 69

def refund(request)
  route_terminal_request('POST', '/api/refund', '/api/refund', request)
end

#reverse(request) ⇒ Object

Executes a manual time out reversal.

We love time out reversals. Don’t be afraid to use them whenever a request to a BlockChyp terminal times out. You have up to two minutes to reverse any transaction. The only caveat is that you must assign transactionRef values when you build the original request. Otherwise, we have no real way of knowing which transaction you’re trying to reverse because we may not have assigned it an id yet. And if we did assign it an id, you wouldn’t know what it is because your request to the terminal timed out before you got a response.



155
156
157
# File 'lib/blockchyp.rb', line 155

def reverse(request)
  gateway_request('POST', '/api/reverse', request)
end

Creates and send a payment link to a customer.



165
166
167
# File 'lib/blockchyp.rb', line 165

def send_payment_link(request)
  gateway_request('POST', '/api/send-payment-link', request)
end

#terminal_status(request) ⇒ Object

Returns the current status of a terminal.



94
95
96
# File 'lib/blockchyp.rb', line 94

def terminal_status(request)
  route_terminal_request('POST', '/api/terminal-status', '/api/terminal-status', request)
end

#terms_and_conditions(request) ⇒ Object

Prompts the user to accept terms and conditions.



99
100
101
# File 'lib/blockchyp.rb', line 99

def terms_and_conditions(request)
  route_terminal_request('POST', '/api/tc', '/api/terminal-tc', request)
end

#text_prompt(request) ⇒ Object

Asks the consumer a text based question.



131
132
133
# File 'lib/blockchyp.rb', line 131

def text_prompt(request)
  route_terminal_request('POST', '/api/text-prompt', '/api/text-prompt', request)
end

#transaction_history(request) ⇒ Object

Returns the transaction history for a merchant.



205
206
207
# File 'lib/blockchyp.rb', line 205

def transaction_history(request)
  gateway_request('POST', '/api/tx-history', request)
end

#transaction_status(request) ⇒ Object

Retrieves the current status of a transaction.



170
171
172
# File 'lib/blockchyp.rb', line 170

def transaction_status(request)
  gateway_request('POST', '/api/tx-status', request)
end

#update_customer(request) ⇒ Object

Updates or creates a customer record.



175
176
177
# File 'lib/blockchyp.rb', line 175

def update_customer(request)
  gateway_request('POST', '/api/update-customer', request)
end

#update_transaction_display(request) ⇒ Object

Appends items to an existing transaction display. Subtotal, Tax, and Total are overwritten by the request. Items with the same description are combined into groups.



116
117
118
# File 'lib/blockchyp.rb', line 116

def update_transaction_display(request)
  route_terminal_request('PUT', '/api/txdisplay', '/api/terminal-txdisplay', request)
end

#void(request) ⇒ Object

Discards a previous preauth transaction.



141
142
143
# File 'lib/blockchyp.rb', line 141

def void(request)
  gateway_request('POST', '/api/void', request)
end