paycargo 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/docs/index.html ADDED
@@ -0,0 +1,481 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
+ <head>
6
+ <!-- 2022-02-07 Mon 16:17 -->
7
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>Paycargo</title>
10
+ <meta name="author" content="Jose Perez" />
11
+ <meta name="generator" content="Org Mode" />
12
+ <style>
13
+ #content { max-width: 60em; margin: auto; }
14
+ .title { text-align: center;
15
+ margin-bottom: .2em; }
16
+ .subtitle { text-align: center;
17
+ font-size: medium;
18
+ font-weight: bold;
19
+ margin-top:0; }
20
+ .todo { font-family: monospace; color: red; }
21
+ .done { font-family: monospace; color: green; }
22
+ .priority { font-family: monospace; color: orange; }
23
+ .tag { background-color: #eee; font-family: monospace;
24
+ padding: 2px; font-size: 80%; font-weight: normal; }
25
+ .timestamp { color: #bebebe; }
26
+ .timestamp-kwd { color: #5f9ea0; }
27
+ .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
28
+ .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
29
+ .org-center { margin-left: auto; margin-right: auto; text-align: center; }
30
+ .underline { text-decoration: underline; }
31
+ #postamble p, #preamble p { font-size: 90%; margin: .2em; }
32
+ p.verse { margin-left: 3%; }
33
+ pre {
34
+ border: 1px solid #e6e6e6;
35
+ border-radius: 3px;
36
+ background-color: #f2f2f2;
37
+ padding: 8pt;
38
+ font-family: monospace;
39
+ overflow: auto;
40
+ margin: 1.2em;
41
+ }
42
+ pre.src {
43
+ position: relative;
44
+ overflow: auto;
45
+ }
46
+ pre.src:before {
47
+ display: none;
48
+ position: absolute;
49
+ top: -8px;
50
+ right: 12px;
51
+ padding: 3px;
52
+ color: #555;
53
+ background-color: #f2f2f299;
54
+ }
55
+ pre.src:hover:before { display: inline; margin-top: 14px;}
56
+ /* Languages per Org manual */
57
+ pre.src-asymptote:before { content: 'Asymptote'; }
58
+ pre.src-awk:before { content: 'Awk'; }
59
+ pre.src-authinfo::before { content: 'Authinfo'; }
60
+ pre.src-C:before { content: 'C'; }
61
+ /* pre.src-C++ doesn't work in CSS */
62
+ pre.src-clojure:before { content: 'Clojure'; }
63
+ pre.src-css:before { content: 'CSS'; }
64
+ pre.src-D:before { content: 'D'; }
65
+ pre.src-ditaa:before { content: 'ditaa'; }
66
+ pre.src-dot:before { content: 'Graphviz'; }
67
+ pre.src-calc:before { content: 'Emacs Calc'; }
68
+ pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
69
+ pre.src-fortran:before { content: 'Fortran'; }
70
+ pre.src-gnuplot:before { content: 'gnuplot'; }
71
+ pre.src-haskell:before { content: 'Haskell'; }
72
+ pre.src-hledger:before { content: 'hledger'; }
73
+ pre.src-java:before { content: 'Java'; }
74
+ pre.src-js:before { content: 'Javascript'; }
75
+ pre.src-latex:before { content: 'LaTeX'; }
76
+ pre.src-ledger:before { content: 'Ledger'; }
77
+ pre.src-lisp:before { content: 'Lisp'; }
78
+ pre.src-lilypond:before { content: 'Lilypond'; }
79
+ pre.src-lua:before { content: 'Lua'; }
80
+ pre.src-matlab:before { content: 'MATLAB'; }
81
+ pre.src-mscgen:before { content: 'Mscgen'; }
82
+ pre.src-ocaml:before { content: 'Objective Caml'; }
83
+ pre.src-octave:before { content: 'Octave'; }
84
+ pre.src-org:before { content: 'Org mode'; }
85
+ pre.src-oz:before { content: 'OZ'; }
86
+ pre.src-plantuml:before { content: 'Plantuml'; }
87
+ pre.src-processing:before { content: 'Processing.js'; }
88
+ pre.src-python:before { content: 'Python'; }
89
+ pre.src-R:before { content: 'R'; }
90
+ pre.src-ruby:before { content: 'Ruby'; }
91
+ pre.src-sass:before { content: 'Sass'; }
92
+ pre.src-scheme:before { content: 'Scheme'; }
93
+ pre.src-screen:before { content: 'Gnu Screen'; }
94
+ pre.src-sed:before { content: 'Sed'; }
95
+ pre.src-sh:before { content: 'shell'; }
96
+ pre.src-sql:before { content: 'SQL'; }
97
+ pre.src-sqlite:before { content: 'SQLite'; }
98
+ /* additional languages in org.el's org-babel-load-languages alist */
99
+ pre.src-forth:before { content: 'Forth'; }
100
+ pre.src-io:before { content: 'IO'; }
101
+ pre.src-J:before { content: 'J'; }
102
+ pre.src-makefile:before { content: 'Makefile'; }
103
+ pre.src-maxima:before { content: 'Maxima'; }
104
+ pre.src-perl:before { content: 'Perl'; }
105
+ pre.src-picolisp:before { content: 'Pico Lisp'; }
106
+ pre.src-scala:before { content: 'Scala'; }
107
+ pre.src-shell:before { content: 'Shell Script'; }
108
+ pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
109
+ /* additional language identifiers per "defun org-babel-execute"
110
+ in ob-*.el */
111
+ pre.src-cpp:before { content: 'C++'; }
112
+ pre.src-abc:before { content: 'ABC'; }
113
+ pre.src-coq:before { content: 'Coq'; }
114
+ pre.src-groovy:before { content: 'Groovy'; }
115
+ /* additional language identifiers from org-babel-shell-names in
116
+ ob-shell.el: ob-shell is the only babel language using a lambda to put
117
+ the execution function name together. */
118
+ pre.src-bash:before { content: 'bash'; }
119
+ pre.src-csh:before { content: 'csh'; }
120
+ pre.src-ash:before { content: 'ash'; }
121
+ pre.src-dash:before { content: 'dash'; }
122
+ pre.src-ksh:before { content: 'ksh'; }
123
+ pre.src-mksh:before { content: 'mksh'; }
124
+ pre.src-posh:before { content: 'posh'; }
125
+ /* Additional Emacs modes also supported by the LaTeX listings package */
126
+ pre.src-ada:before { content: 'Ada'; }
127
+ pre.src-asm:before { content: 'Assembler'; }
128
+ pre.src-caml:before { content: 'Caml'; }
129
+ pre.src-delphi:before { content: 'Delphi'; }
130
+ pre.src-html:before { content: 'HTML'; }
131
+ pre.src-idl:before { content: 'IDL'; }
132
+ pre.src-mercury:before { content: 'Mercury'; }
133
+ pre.src-metapost:before { content: 'MetaPost'; }
134
+ pre.src-modula-2:before { content: 'Modula-2'; }
135
+ pre.src-pascal:before { content: 'Pascal'; }
136
+ pre.src-ps:before { content: 'PostScript'; }
137
+ pre.src-prolog:before { content: 'Prolog'; }
138
+ pre.src-simula:before { content: 'Simula'; }
139
+ pre.src-tcl:before { content: 'tcl'; }
140
+ pre.src-tex:before { content: 'TeX'; }
141
+ pre.src-plain-tex:before { content: 'Plain TeX'; }
142
+ pre.src-verilog:before { content: 'Verilog'; }
143
+ pre.src-vhdl:before { content: 'VHDL'; }
144
+ pre.src-xml:before { content: 'XML'; }
145
+ pre.src-nxml:before { content: 'XML'; }
146
+ /* add a generic configuration mode; LaTeX export needs an additional
147
+ (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
148
+ pre.src-conf:before { content: 'Configuration File'; }
149
+
150
+ table { border-collapse:collapse; }
151
+ caption.t-above { caption-side: top; }
152
+ caption.t-bottom { caption-side: bottom; }
153
+ td, th { vertical-align:top; }
154
+ th.org-right { text-align: center; }
155
+ th.org-left { text-align: center; }
156
+ th.org-center { text-align: center; }
157
+ td.org-right { text-align: right; }
158
+ td.org-left { text-align: left; }
159
+ td.org-center { text-align: center; }
160
+ dt { font-weight: bold; }
161
+ .footpara { display: inline; }
162
+ .footdef { margin-bottom: 1em; }
163
+ .figure { padding: 1em; }
164
+ .figure p { text-align: center; }
165
+ .equation-container {
166
+ display: table;
167
+ text-align: center;
168
+ width: 100%;
169
+ }
170
+ .equation {
171
+ vertical-align: middle;
172
+ }
173
+ .equation-label {
174
+ display: table-cell;
175
+ text-align: right;
176
+ vertical-align: middle;
177
+ }
178
+ .inlinetask {
179
+ padding: 10px;
180
+ border: 2px solid gray;
181
+ margin: 10px;
182
+ background: #ffffcc;
183
+ }
184
+ #org-div-home-and-up
185
+ { text-align: right; font-size: 70%; white-space: nowrap; }
186
+ textarea { overflow-x: auto; }
187
+ .linenr { font-size: smaller }
188
+ .code-highlighted { background-color: #ffff00; }
189
+ .org-info-js_info-navigation { border-style: none; }
190
+ #org-info-js_console-label
191
+ { font-size: 10px; font-weight: bold; white-space: nowrap; }
192
+ .org-info-js_search-highlight
193
+ { background-color: #ffff00; color: #000000; font-weight: bold; }
194
+ .org-svg { width: 90%; }
195
+ </style>
196
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
197
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
198
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
199
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
200
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
201
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
202
+ <link rel="stylesheet" type="text/css" href="style.css">
203
+ </head>
204
+ <body>
205
+ <div id="content" class="content">
206
+ <h1 class="title">Paycargo</h1>
207
+ <div id="table-of-contents" role="doc-toc">
208
+ <h2>Table of Contents</h2>
209
+ <div id="text-table-of-contents" role="doc-toc">
210
+ <ul>
211
+ <li><a href="#orgaffc9ae">Quik start</a>
212
+ <ul>
213
+ <li><a href="#org30d08d4">Making requests</a></li>
214
+ <li><a href="#org10e0038">Consuming resources</a>
215
+ <ul>
216
+ <li><a href="#org4159966">Transactions</a></li>
217
+ <li><a href="#org3effeb7">Funds</a></li>
218
+ <li><a href="#org4939efc">Reports</a></li>
219
+ </ul>
220
+ </li>
221
+ </ul>
222
+ </li>
223
+ <li><a href="#org43e6090">Development</a></li>
224
+ <li><a href="#orgb5b16b4">Contributing</a></li>
225
+ <li><a href="#org624bcb1">License</a></li>
226
+ </ul>
227
+ </div>
228
+ </div>
229
+ <p>
230
+ Paycargo is a ruby gem client library to talk with Paycargo API. Paycargo wraps the Paycargos&rsquo;s REST API and follows Ruby convention.
231
+ </p>
232
+
233
+ <div id="outline-container-orgaffc9ae" class="outline-2">
234
+ <h2 id="orgaffc9ae">Quik start</h2>
235
+ <div class="outline-text-2" id="text-orgaffc9ae">
236
+ <p>
237
+ Install via Rubygems
238
+ </p>
239
+
240
+ <div class="org-src-container">
241
+ <pre class="src src-ruby">gem install paycargo
242
+ </pre>
243
+ </div>
244
+
245
+ <p>
246
+ Or add to your application&rsquo;s Gemfile:
247
+ </p>
248
+ <div class="org-src-container">
249
+ <pre class="src src-ruby">gem <span style="color: #f1fa8c;">'paycargo'</span>
250
+ </pre>
251
+ </div>
252
+
253
+ <p>
254
+ And then execute:
255
+ </p>
256
+ <div class="org-src-container">
257
+ <pre class="src src-bash">bundle install
258
+ </pre>
259
+ </div>
260
+
261
+ <p>
262
+ Access the library in Ruby:
263
+ </p>
264
+ <div class="org-src-container">
265
+ <pre class="src src-ruby"><span style="color: #ffb86c;">require</span> <span style="color: #f1fa8c;">'paycargo'</span>
266
+ </pre>
267
+ </div>
268
+ </div>
269
+
270
+ <div id="outline-container-org30d08d4" class="outline-3">
271
+ <h3 id="org30d08d4">Making requests</h3>
272
+ <div class="outline-text-3" id="text-org30d08d4">
273
+ <p>
274
+ Initialize client to make requets:
275
+ </p>
276
+
277
+ <div class="org-src-container">
278
+ <pre class="src src-ruby">client = <span style="color: #bd93f9;">Paycargo</span>::<span style="color: #bd93f9;">Client</span>.new(<span style="color: #8be9fd;">token:</span> <span style="color: #f1fa8c;">"JWT TOKEN"</span>)
279
+ client.transactions.list()
280
+ </pre>
281
+ </div>
282
+ </div>
283
+ </div>
284
+
285
+ <div id="outline-container-org10e0038" class="outline-3">
286
+ <h3 id="org10e0038">Consuming resources</h3>
287
+ <div class="outline-text-3" id="text-org10e0038">
288
+ <p>
289
+ Most methods return a <code>Resource</code> object which provides dot notation and [] access for fields returned in the API response.
290
+ </p>
291
+ </div>
292
+
293
+ <div id="outline-container-org4159966" class="outline-4">
294
+ <h4 id="org4159966">Transactions</h4>
295
+ <div class="outline-text-4" id="text-org4159966">
296
+ <p>
297
+ Get all Transactions for a client.
298
+ </p>
299
+ <div class="org-src-container">
300
+ <pre class="src src-ruby">client.transactions.list()
301
+ </pre>
302
+ </div>
303
+
304
+ <p>
305
+ Get a transaction by id
306
+ </p>
307
+ <div class="org-src-container">
308
+ <pre class="src src-ruby">client.transactions.retreive(<span style="color: #bd93f9; font-weight: bold;">473943</span>)
309
+ </pre>
310
+ </div>
311
+
312
+ <p>
313
+ Get transaction by number
314
+ </p>
315
+ <div class="org-src-container">
316
+ <pre class="src src-ruby">client.transactions.by_number(<span style="color: #8be9fd;">number:</span> <span style="color: #bd93f9; font-weight: bold;">9292323</span>, <span style="color: #8be9fd;">vendorID:</span> <span style="color: #bd93f9; font-weight: bold;">279366</span>)
317
+ </pre>
318
+ </div>
319
+
320
+ <p>
321
+ Get transactions history
322
+ </p>
323
+ <div class="org-src-container">
324
+ <pre class="src src-ruby">client.transactions.history(<span style="color: #bd93f9; font-weight: bold;">476296</span>)
325
+ </pre>
326
+ </div>
327
+
328
+ <p>
329
+ Create Transaction
330
+ </p>
331
+ <div class="org-src-container">
332
+ <pre class="src src-ruby">client.transactions.create(
333
+ <span style="color: #8be9fd;">vendorId:</span> <span style="color: #bd93f9; font-weight: bold;">279546</span>,
334
+ <span style="color: #8be9fd;">type:</span> <span style="color: #f1fa8c;">'Other'</span>,
335
+ <span style="color: #8be9fd;">subcategory:</span> <span style="color: #f1fa8c;">'I-432188'</span>,
336
+ <span style="color: #8be9fd;">number:</span> <span style="color: #f1fa8c;">'929-83294551'</span>,
337
+ <span style="color: #8be9fd;">departureDate:</span> <span style="color: #f1fa8c;">'2018-04-01'</span>,
338
+ <span style="color: #8be9fd;">arrivalDate:</span> <span style="color: #f1fa8c;">'2018-04-24'</span>,
339
+ <span style="color: #8be9fd;">total:</span> <span style="color: #bd93f9; font-weight: bold;">100</span>,
340
+ <span style="color: #8be9fd;">direction:</span> <span style="color: #f1fa8c;">'Outbound'</span>,
341
+ <span style="color: #8be9fd;">paymentDueDate:</span> <span style="color: #f1fa8c;">'2018-04-24'</span>,
342
+ <span style="color: #8be9fd;">hasArrived:</span> <span style="color: #f1fa8c;">'Y'</span>,
343
+ <span style="color: #8be9fd;">shipperRefNumber:</span> <span style="color: #f1fa8c;">'tdfgfdgfd'</span>
344
+ )
345
+ </pre>
346
+ </div>
347
+
348
+ <p>
349
+ Approve a Transaction
350
+ </p>
351
+ <div class="org-src-container">
352
+ <pre class="src src-ruby">client.transactions.apporve(<span style="color: #bd93f9; font-weight: bold;">489479</span>, <span style="color: #8be9fd;">paymentType:</span> <span style="color: #f1fa8c;">'OVERNIGHT'</span>)
353
+ </pre>
354
+ </div>
355
+
356
+ <p>
357
+ Puting a transaction to <code>proof</code>
358
+ </p>
359
+ <div class="org-src-container">
360
+ <pre class="src src-ruby">client.transactions.proof(<span style="color: #bd93f9; font-weight: bold;">500744</span>)
361
+ </pre>
362
+ </div>
363
+
364
+ <p>
365
+ Get transactions fees
366
+ </p>
367
+ <div class="org-src-container">
368
+ <pre class="src src-ruby">client.transactions.fees(
369
+ <span style="color: #8be9fd;">paymentType:</span> <span style="color: #f1fa8c;">'OVERNIGHT'</span>,
370
+ <span style="color: #8be9fd;">transactionId:</span> <span style="color: #bd93f9; font-weight: bold;">123456</span>,
371
+ <span style="color: #8be9fd;">numberOfTransactions:</span> <span style="color: #bd93f9; font-weight: bold;">2</span>,
372
+ <span style="color: #8be9fd;">payerId:</span> <span style="color: #bd93f9; font-weight: bold;">123456</span>,
373
+ <span style="color: #8be9fd;">vendorId:</span> <span style="color: #bd93f9; font-weight: bold;">123456</span>,
374
+ <span style="color: #8be9fd;">total:</span> <span style="color: #bd93f9; font-weight: bold;">70</span>
375
+ )
376
+ </pre>
377
+ </div>
378
+
379
+ <ul class="org-ul">
380
+ <li><code>paymentType</code>: payment type for transaction: OVERNIGHT, PREPAID, CREDITCARD, PAYCARGO<sub>CREDIT</sub>.</li>
381
+ <li><code>transactionId</code>: transaction id if exists.</li>
382
+ <li><code>numberOfTransactions</code>: number of transaction. Used to define if batch flat fee can be applied.</li>
383
+ <li><code>payerID</code>: payer ID</li>
384
+ <li><code>vendorID</code>: vendor ID</li>
385
+ <li><code>total</code>: total amount used to calculate fees for PAYCARGO<sub>CREDIT</sub> and CREDITCARD payment type.</li>
386
+ </ul>
387
+ </div>
388
+ </div>
389
+
390
+ <div id="outline-container-org3effeb7" class="outline-4">
391
+ <h4 id="org3effeb7">Funds</h4>
392
+ <div class="outline-text-4" id="text-org3effeb7">
393
+ <p>
394
+ Get Funds Availability
395
+ </p>
396
+ <div class="org-src-container">
397
+ <pre class="src src-ruby">client.payer.funds(<span style="color: #bd93f9; font-weight: bold;">281783</span>)
398
+ </pre>
399
+ </div>
400
+
401
+ <p>
402
+ This endpoint retrieves the following data, per payer, per payment method:
403
+ </p>
404
+ <ul class="org-ul">
405
+ <li>get funds availability</li>
406
+ <li>get funds limit</li>
407
+ </ul>
408
+ </div>
409
+ </div>
410
+
411
+ <div id="outline-container-org4939efc" class="outline-4">
412
+ <h4 id="org4939efc">Reports</h4>
413
+ <div class="outline-text-4" id="text-org4939efc">
414
+ <p>
415
+ Get Payer ACH Report
416
+ </p>
417
+ <div class="org-src-container">
418
+ <pre class="src src-ruby">client.reports.payer(
419
+ <span style="color: #8be9fd;">startDate:</span> <span style="color: #f1fa8c;">'10/01/2020'</span>,
420
+ <span style="color: #8be9fd;">endDate:</span> <span style="color: #f1fa8c;">'11/01/2020'</span>,
421
+ <span style="color: #8be9fd;">client_id:</span> <span style="color: #bd93f9; font-weight: bold;">284347</span>,
422
+ <span style="color: #8be9fd;">report_action_name:</span> <span style="color: #f1fa8c;">'getACHReconciliation'</span>,
423
+ <span style="color: #8be9fd;">type:</span> <span style="color: #f1fa8c;">'SHIPPER'</span>,
424
+ <span style="color: #8be9fd;">accountName:</span> <span style="color: #f1fa8c;">'all'</span>
425
+ )
426
+ </pre>
427
+ </div>
428
+
429
+ <ul class="org-ul">
430
+ <li><code>fleet_id</code>: Account fleet id ( payerId)</li>
431
+ <li><code>startDate</code>: Start Date in MM/DD/YYYY format</li>
432
+ <li><code>endDate</code>: End Date in MM/DD/YYYY format</li>
433
+ <li><code>client_id</code>: Account client id</li>
434
+ <li><code>report_action_name</code>: PayCargo report type name, for ACH report : getACHReconciliation</li>
435
+ <li><code>type</code>: Account type : SHIPPER or CARRIER</li>
436
+ <li><code>accountName</code>: Account name of branch if any. Apply &ldquo;all&rdquo; to get data from branches for HQ</li>
437
+ <li><code>fleetLimit</code>: fleet<sub>id</sub></li>
438
+ <li><code>providerLimit</code>: provier<sub>id</sub></li>
439
+ </ul>
440
+ </div>
441
+ </div>
442
+ </div>
443
+ </div>
444
+
445
+ <div id="outline-container-org43e6090" class="outline-2">
446
+ <h2 id="org43e6090">Development</h2>
447
+ <div class="outline-text-2" id="text-org43e6090">
448
+ <p>
449
+ After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run <code>rake spec</code> to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
450
+ </p>
451
+
452
+ <p>
453
+ To install this gem onto your local machine, run <code>bundle exec rake install</code>. To release a new version, update the version number in <code>version.rb</code> and then run <code>bundle exec rake release</code> which will create a git tag for the version, push git commits and the created tag, and push the <code>gem</code> file to <a href="https://rubygems.org">rubygems.org</a>.
454
+ </p>
455
+ </div>
456
+ </div>
457
+
458
+ <div id="outline-container-orgb5b16b4" class="outline-2">
459
+ <h2 id="orgb5b16b4">Contributing</h2>
460
+ <div class="outline-text-2" id="text-orgb5b16b4">
461
+ <p>
462
+ Bug reports and pull requests are welcome on GitHub at <a href="https://github.com/lepepe/paycargo">https://github.com/lepepe/paycargo</a>.
463
+ </p>
464
+ </div>
465
+ </div>
466
+
467
+ <div id="outline-container-org624bcb1" class="outline-2">
468
+ <h2 id="org624bcb1">License</h2>
469
+ <div class="outline-text-2" id="text-org624bcb1">
470
+ <p>
471
+ The gem is available as open source under the terms of the [MIT License](<a href="https://opensource.org/licenses/MIT">https://opensource.org/licenses/MIT</a>).
472
+ </p>
473
+ </div>
474
+ </div>
475
+ </div>
476
+ <div id="postamble" class="status">
477
+ <p class="author">Author: Jose Perez</p>
478
+ <p class="date">Created: 2022-02-07 Mon 16:17</p>
479
+ </div>
480
+ </body>
481
+ </html>
data/docs/style.css ADDED
@@ -0,0 +1,91 @@
1
+ /* Read the Org custom CSS */
2
+
3
+ /* Body andHeaders */
4
+ h4,h5,h6 {
5
+ color:#6272a4;
6
+ font-weight:300;
7
+ }
8
+
9
+ body{
10
+ background:#282A36;
11
+ color:#404040;
12
+ font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
13
+ font-weight:normal;
14
+ margin:0;
15
+ min-height:100%;
16
+ overflow-x:hidden;
17
+ }
18
+
19
+ /* Code block */
20
+ .codeblock,pre.src,#content .literal-block{
21
+ border:1px solid #e1e4e5;
22
+ padding:12px;
23
+ overflow-x:auto;
24
+ background:#282A36;
25
+ margin:1px 0 24px 0;
26
+ color: #F8F8F2;
27
+ }
28
+
29
+ /* Links */
30
+ a{
31
+ color:#6272a4;
32
+ text-decoration:none;
33
+ cursor:pointer}
34
+
35
+ a:hover,a:active{
36
+ outline:0;
37
+ }
38
+
39
+ a:hover{
40
+ color:#bd93f9}
41
+
42
+ a:visited{
43
+ color:#9B59B6}
44
+
45
+ /* Table of Content */
46
+ #table-of-contents{
47
+ position:fixed;
48
+ top:0;
49
+ left:0;
50
+ width:300px;
51
+ overflow-x:hidden;
52
+ overflow-y:scroll;
53
+ height:100%;
54
+ background:#44475A;
55
+ z-index:200;
56
+ scrollbar-base-color: #1F1D1D;
57
+ scrollbar-arrow-color: #b3b3b3;
58
+ scrollbar-shadow-color: #1F1D1D;
59
+ scrollbar-track-color : #343131;
60
+ }
61
+
62
+ #table-of-contents h2{
63
+ z-index:200;
64
+ background-color:#282A36;
65
+ text-align:center;
66
+ padding:0.809em;
67
+ display:block;
68
+ color:#fcfcfc;
69
+ font-size: 100%;
70
+ margin-bottom:0.809em}
71
+
72
+ /* Footer */
73
+ #postamble .author {
74
+ font-size: 100%;
75
+ margin-bottom: 0px;
76
+ }
77
+
78
+ #postamble .date {
79
+ font-size: 90%;
80
+ margin-bottom: 0px;
81
+ color: #00f769;
82
+ }
83
+
84
+ .figure {
85
+ padding: 0;
86
+ }
87
+
88
+ .figure p {
89
+ text-align: left;
90
+ padding: 0;
91
+ }
@@ -0,0 +1,36 @@
1
+ require "faraday"
2
+ require "faraday_middleware"
3
+
4
+ module Paycargo
5
+ class Client
6
+ BASE_URL = "https://api.paycargo.com"
7
+
8
+ attr_reader :token, :adapter
9
+
10
+ def initialize(token:, adapter: Faraday.default_adapter)
11
+ @token = token || ENV["JWT_TOKEN"]
12
+ @adapter = adapter
13
+ end
14
+
15
+ def transactions
16
+ TransactionsResource.new(self)
17
+ end
18
+
19
+ def payer
20
+ PayerResource.new(self)
21
+ end
22
+
23
+ def reports
24
+ ReportsResource.new(self)
25
+ end
26
+
27
+ def connection
28
+ @connection ||= Faraday.new do |con|
29
+ con.url_prefix = BASE_URL
30
+ con.request :json
31
+ con.response :json, content_type: "application/json"
32
+ con.adapter adapter
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,16 @@
1
+ module Paycargo
2
+ class Collection
3
+ attr_reader :data
4
+
5
+ def self.from_response(response, type:)
6
+ body = response.body
7
+ new(
8
+ data: body["data"].map{ |attrs| type.new(attrs) }
9
+ )
10
+ end
11
+
12
+ def initialize(data:)
13
+ @data = data
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ module Paycargo
2
+ class Error < StandardError; end
3
+ end
@@ -0,0 +1,18 @@
1
+ require "ostruct"
2
+
3
+ module Paycargo
4
+ class Object
5
+ def initialize(attributes)
6
+ @attributes = OpenStruct.new(attributes)
7
+ end
8
+
9
+ def method_missing(method, *args, &block)
10
+ attribute = @attributes.send(method, *args, &block)
11
+ attribute.is_a?(Hash) ? Object.new(attribute) : attribute
12
+ end
13
+
14
+ def respond_to_missing?(method, inlcude_private = false)
15
+ true
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ module Paycargo
2
+ class Payer < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Paycargo
2
+ class Report < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Paycargo
2
+ class Transaction < Object
3
+ end
4
+ end