greip 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +280 -0
  3. metadata +73 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ebdb7873c4bbcf7cd5fc3a8b0cdaf8f51b828cfa28caf4c30dea54fae600ad7b
4
+ data.tar.gz: 10884b2aa0fa86d1f1e186e657c7de2ffedb47c45900a41535d9b5872689e561
5
+ SHA512:
6
+ metadata.gz: f73126699d34c56599a945b2183a6d054a9e8950988aae0177053adbe07b6bb4cfde48caa7426692ce2fbb3f9d102e446ef2761331087854806c31c7d015a3b2
7
+ data.tar.gz: 71a209235dbb27ac64809e9adf0405a4b573b430894cad98271a38641423a4bcbbe667a672d5489fdb61c0eea522e89f8e86184a833590dbae887f61b3ea7700
data/README.md ADDED
@@ -0,0 +1,280 @@
1
+ # Greip Ruby Gem
2
+
3
+ The official Ruby Gem of Greip API
4
+
5
+ [Report Issue](https://github.com/Greipio/ruby/issues/new) ·
6
+ [Request Feature](https://github.com/Greipio/ruby/discussions/new?category=ideas)
7
+ · [Greip Website](https://greip.io/) · [Documentation](https://docs.greip.io/)
8
+
9
+ [![Ruby Gem of Greip](https://img.shields.io/badge/Ruby-CC342D?style=for-the-badge&logo=ruby&logoColor=white)](https://rubygems.org/gems/greip)
10
+ [![Github Repository](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/Greipio/ruby)
11
+
12
+ ![Gem version](https://img.shields.io/gem/v/greip)
13
+  
14
+ ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/Greipio/ruby?color=green&label=Minified%20size&logo=github)
15
+  
16
+ [![License: MIT](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0)
17
+  
18
+ ![API Status](https://img.shields.io/website?down_color=orange&down_message=down&label=API%20status&up_color=green&up_message=up&url=https%3A%2F%2Fgregeoip.com)
19
+
20
+ ---
21
+
22
+ ## Installation
23
+
24
+ Add this line to your application's `Gemfile`:
25
+
26
+ ```ruby
27
+ gem 'greip'
28
+ ```
29
+
30
+ Then run the following command in your terminal:
31
+
32
+ ```bash
33
+ bundle install
34
+ ```
35
+
36
+ Or, install it with the following command:
37
+
38
+ ```bash
39
+ gem install greip
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ Here's how you use the methods:
45
+
46
+ ### 1. IP Lookup Method
47
+
48
+ ```ruby
49
+ require 'greip'
50
+
51
+ access_token = 'your-api-key-goes-here'
52
+ handler = greip::create(access_token)
53
+ data = handler.lookup({ ip: "1.1.1.1", params: ["security", "timezone", "currency"], lang: "EN", mode: "live" })
54
+
55
+ puts data
56
+
57
+ ```
58
+
59
+ ### 2. Bulk IP Lookup Method
60
+
61
+ ```javascript
62
+ const { Greip } = require("greip-node");
63
+
64
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
65
+
66
+ greip
67
+ .BulkLookup({
68
+ ips: ["1.1.1.1", "2.2.2.2"],
69
+ })
70
+ .then((res: any) => {
71
+ console.log(res.data); // Log Response
72
+ })
73
+ .catch((error: any) => {
74
+ console.log(error);
75
+ });
76
+ ```
77
+
78
+ ### 3. ASN Lookup Method
79
+
80
+ ```javascript
81
+ const { Greip } = require("greip-node");
82
+
83
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
84
+
85
+ greip
86
+ .ASN({
87
+ asn: "AS01",
88
+ })
89
+ .then((res: any) => {
90
+ console.log(res.data); // Log Response
91
+ })
92
+ .catch((error: any) => {
93
+ console.log(error);
94
+ });
95
+ ```
96
+
97
+ ### 4. Profanity Detection Method
98
+
99
+ ```javascript
100
+ const { Greip } = require("greip-node");
101
+
102
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
103
+
104
+ greip
105
+ .Profanity({
106
+ text: "This is just normal sample text.",
107
+ })
108
+ .then((res: any) => {
109
+ console.log(res.data); // Log Response
110
+ })
111
+ .catch((error: any) => {
112
+ console.log(error);
113
+ });
114
+ ```
115
+
116
+ ### 5. Country Lookup Method
117
+
118
+ ```javascript
119
+ const { Greip } = require("greip-node");
120
+
121
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
122
+
123
+ greip
124
+ .Country({
125
+ countryCode: "SA",
126
+ })
127
+ .then((res: any) => {
128
+ console.log(res.data); // Log Response
129
+ })
130
+ .catch((error: any) => {
131
+ console.log(error);
132
+ });
133
+ ```
134
+
135
+ ### 6. Email Validation Method
136
+
137
+ ```javascript
138
+ const { Greip } = require("greip-node");
139
+
140
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
141
+
142
+ greip
143
+ .EmailValidation({
144
+ email: "name@domain.com",
145
+ })
146
+ .then((res: any) => {
147
+ console.log(res.data); // Log Response
148
+ })
149
+ .catch((error: any) => {
150
+ console.log(error);
151
+ });
152
+ ```
153
+
154
+ ### 7. Phone Validation Method
155
+
156
+ ```javascript
157
+ const { Greip } = require("greip-node");
158
+
159
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
160
+
161
+ greip
162
+ .PhoneValidation({
163
+ phone: "123123123",
164
+ countryCode: "US",
165
+ })
166
+ .then((res: any) => {
167
+ console.log(res.data); // Log Response
168
+ })
169
+ .catch((error: any) => {
170
+ console.log(error);
171
+ });
172
+ ```
173
+
174
+ ### 8. Payment Fraud Prevention Method
175
+
176
+ ```javascript
177
+ const { Greip } = require("greip-node");
178
+
179
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
180
+
181
+ greip
182
+ .PaymentFraud({
183
+ data: {
184
+ action: "purchase",
185
+ website_domain: "",
186
+ website_name: "",
187
+ merchant_id: 21,
188
+ shipment_id: 1,
189
+ transaction_id: 100,
190
+ transaction_amount: 1000000,
191
+ transaction_currency: "GBP",
192
+ cart_items: {
193
+ item_id: 1,
194
+ item_name: "Product name",
195
+ item_quantity: 1,
196
+ item_price: "1100.55",
197
+ item_category_id: 1,
198
+ },
199
+ isDigitalProducts: true,
200
+ coupon: "ASDF",
201
+ customer_id: 1,
202
+ customer_firstname: "First",
203
+ customer_lastname: "Last",
204
+ customer_pob: "London",
205
+ customer_ip: "1.1.1.1",
206
+ customer_country: "GB",
207
+ customer_region: "London",
208
+ customer_city: "London",
209
+ customer_zip: "NW10 7PQ",
210
+ customer_street: "7 Coronation Road",
211
+ customer_street2: "",
212
+ customer_latitude: 0.123,
213
+ customer_longitude: 0.123,
214
+ customer_device_id: "UNIQUE_DEVICE_ID",
215
+ customer_phone: "000000000",
216
+ customer_registration_date: 1677554670,
217
+ customer_balance: "1000.00",
218
+ customer_dob: "1997-19-05",
219
+ customer_email: "name@domain.com",
220
+ customer_2fa: true,
221
+ customer_useragent: "Mozill almaden sdfwer",
222
+ shipping_country: "GB",
223
+ shipping_region: "London",
224
+ shipping_city: "London",
225
+ shipping_zip: "NW10 7PQ",
226
+ shipping_street: "7 Coronation Road",
227
+ shipping_street2: "",
228
+ shipping_latitude: 0.123,
229
+ shipping_longitude: 0.123,
230
+ billing_country: "GB",
231
+ billing_region: "London",
232
+ billing_city: "London",
233
+ billing_zip: "NW10 7PQ",
234
+ billing_street: "7 Coronation Road",
235
+ billing_street2: "",
236
+ billing_latitude: 0.123,
237
+ billing_longitude: 0.123,
238
+ payment_type: "applepay",
239
+ card_name: "First Last",
240
+ card_number: "1234XXXXXXXX1234",
241
+ card_expiry: "29/05",
242
+ cvv_result: true,
243
+ },
244
+ })
245
+ .then((res: any) => {
246
+ console.log(res.data); // Log Response
247
+ })
248
+ .catch((error: any) => {
249
+ console.log(error);
250
+ });
251
+ ```
252
+
253
+ ### 9. IBAN Validation Method
254
+
255
+ ```javascript
256
+ const { Greip } = require("greip-node");
257
+
258
+ let greip = new Greip(process.env.YOUR_GREIP_TOKEN);
259
+
260
+ greip
261
+ .IBANValidation({
262
+ iban: "BY86AKBB10100000002966000000",
263
+ })
264
+ .then((res: any) => {
265
+ console.log(res); // Log Response
266
+ })
267
+ .catch((error: any) => {
268
+ console.log(error);
269
+ });
270
+ ```
271
+
272
+ ## Options, Methods and More
273
+
274
+ You can find the full guide of this package by visiting our
275
+ [Documentation Page](https://docs.greip.io/).
276
+
277
+ ## Credits
278
+
279
+ - [Greip Developers](https://greip.io)
280
+ - [All Contributors](https://github.com/Greipio/node/graphs/contributors)
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: greip
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Greip Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ description: The official Gem of Greip for Ruby on Rails
42
+ email:
43
+ - info@greip.io
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files:
47
+ - README.md
48
+ files:
49
+ - README.md
50
+ homepage: https://greip.io/
51
+ licenses:
52
+ - Apache-2.0
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 2.5.0
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubygems_version: 3.2.3
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Greip services for Ruby on Rails
73
+ test_files: []