invoq 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/README.md +28 -5
- data/lib/invoq/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4394aa795d6674da3055ce51a03de79b19602bc50139dc19bd00488b0bcc267
|
|
4
|
+
data.tar.gz: 4bba9c3d77bf88951e393097b7b9e47301f42d668acdae4b93ac24adbcf9254b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6606f9c4a3f0043e1353f007da072d9cae06edf823e3f695e9aac80938010baa38bd98bbbeb24d12adb164bbfea2f25f38db62f2a8e14267282d3876bb9fd21
|
|
7
|
+
data.tar.gz: 6beee35201584d88936d0d289301436eac266f87e0ef0a03889207fce892e72f36a50885314a365f63d93ca8ca714acf0889046150da1069f138469f63ccc48d
|
data/README.md
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
# invoq Ruby SDK
|
|
2
2
|
|
|
3
|
+
**English** · [Bahasa Indonesia](./docs/README.id.md) · [Español](./docs/README.es-419.md) · [Français](./docs/README.fr.md) · [Português](./docs/README.pt-BR.md) · [Tiếng Việt](./docs/README.vi.md) · [Türkçe](./docs/README.tr.md) · [ไทย](./docs/README.th.md) · [简体中文](./docs/README.zh-Hans.md) · [繁體中文](./docs/README.zh-Hant.md)
|
|
4
|
+
|
|
3
5
|
Accept stablecoin payments with invoq from Ruby server code. This SDK wraps
|
|
4
6
|
invoq server APIs and verifies signed webhooks.
|
|
5
7
|
|
|
6
8
|
Use this gem only on your server. It handles secret keys and should not be
|
|
7
9
|
bundled into browser code.
|
|
8
10
|
|
|
11
|
+
## Server SDKs
|
|
12
|
+
|
|
13
|
+
Create invoices and verify webhooks from your backend in any of these languages — same REST API, same webhook signature. This repository is the Ruby SDK.
|
|
14
|
+
|
|
15
|
+
| Language | Repository |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Node.js | [github.com/invoqmoney/sdk-js](https://github.com/invoqmoney/sdk-js) (`@invoq/server`) |
|
|
18
|
+
| Python | [github.com/invoqmoney/sdk-python](https://github.com/invoqmoney/sdk-python) |
|
|
19
|
+
| PHP | [github.com/invoqmoney/sdk-php](https://github.com/invoqmoney/sdk-php) |
|
|
20
|
+
| Go | [github.com/invoqmoney/sdk-go](https://github.com/invoqmoney/sdk-go) |
|
|
21
|
+
| Rust | [github.com/invoqmoney/sdk-rust](https://github.com/invoqmoney/sdk-rust) |
|
|
22
|
+
| Ruby | **this repo** |
|
|
23
|
+
|
|
24
|
+
The browser side is the same for every backend: **`@invoq/checkout`** (JavaScript, in [github.com/invoqmoney/sdk-js](https://github.com/invoqmoney/sdk-js)) opens the in-page checkout modal for any frontend.
|
|
25
|
+
|
|
9
26
|
## Installation
|
|
10
27
|
|
|
11
28
|
Install the gem:
|
|
@@ -115,10 +132,11 @@ invoice = invoq.invoices.get("inv_123")
|
|
|
115
132
|
```
|
|
116
133
|
|
|
117
134
|
`invoices.get` returns the public invoice shape used by hosted checkout. It
|
|
118
|
-
includes fields such as `amount_paid`, `amount_due`, `
|
|
119
|
-
`project`, `deposit_address`, `monitoring_ends_at`,
|
|
120
|
-
|
|
121
|
-
`invoice.paid` webhook when
|
|
135
|
+
includes fields such as `amount_paid`, `amount_due`, `amount_overpaid`,
|
|
136
|
+
`payment_status`, `project`, `deposit_address`, `monitoring_ends_at`,
|
|
137
|
+
`monitoring_status`, `transfers`, and `direct_onchain_rails`, but does not
|
|
138
|
+
include `reference_id`. Use the create response or `invoice.paid` webhook when
|
|
139
|
+
you need your merchant `reference_id`.
|
|
122
140
|
|
|
123
141
|
Create a test payment:
|
|
124
142
|
|
|
@@ -171,7 +189,12 @@ Leave unset optional fields out of the request hash. When you include
|
|
|
171
189
|
Amounts in responses are normalized to 4 decimal places: create with `"129"`
|
|
172
190
|
and the invoice returns `amount: "129.0000"`. Compare amounts numerically, not
|
|
173
191
|
as strings. `amount_due` is derived as `max(amount - amount_paid, 0)` and uses
|
|
174
|
-
the same 18-decimal scale as `amount_paid
|
|
192
|
+
the same 18-decimal scale as `amount_paid`; `amount_overpaid` is its mirror,
|
|
193
|
+
`max(amount_paid - amount, 0)`, so you never subtract money yourself.
|
|
194
|
+
`monitoring_status` is `"active"` or `"ended"` — once it is `"ended"`, the
|
|
195
|
+
deposit address is no longer watched — and `transfers` is the confirmed
|
|
196
|
+
on-chain receipt trail (each entry has `tx_hash`, `amount`, and
|
|
197
|
+
`explorer_tx_url`). Both are `nil` / `[]` for test invoices.
|
|
175
198
|
|
|
176
199
|
## Webhooks
|
|
177
200
|
|
data/lib/invoq/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: invoq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- invoq
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: minitest
|
|
@@ -45,7 +44,6 @@ dependencies:
|
|
|
45
44
|
- !ruby/object:Gem::Version
|
|
46
45
|
version: '14.0'
|
|
47
46
|
description: Ruby SDK for invoq server APIs and webhook verification.
|
|
48
|
-
email:
|
|
49
47
|
executables: []
|
|
50
48
|
extensions: []
|
|
51
49
|
extra_rdoc_files: []
|
|
@@ -64,7 +62,6 @@ licenses:
|
|
|
64
62
|
- MIT
|
|
65
63
|
metadata:
|
|
66
64
|
allowed_push_host: https://rubygems.org
|
|
67
|
-
post_install_message:
|
|
68
65
|
rdoc_options: []
|
|
69
66
|
require_paths:
|
|
70
67
|
- lib
|
|
@@ -79,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
79
76
|
- !ruby/object:Gem::Version
|
|
80
77
|
version: '0'
|
|
81
78
|
requirements: []
|
|
82
|
-
rubygems_version:
|
|
83
|
-
signing_key:
|
|
79
|
+
rubygems_version: 4.0.16
|
|
84
80
|
specification_version: 4
|
|
85
81
|
summary: Ruby SDK for invoq stablecoin payment acceptance.
|
|
86
82
|
test_files: []
|