getnet_api 1.0.3 → 1.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +14 -2
- data/.gitignore +2 -0
- data/Gemfile.lock +8 -8
- data/README.md +27 -6
- data/lib/getnet_api/base.rb +14 -18
- data/lib/getnet_api/boleto.rb +0 -1
- data/lib/getnet_api/customer.rb +5 -5
- data/lib/getnet_api/payment.rb +23 -29
- data/lib/getnet_api/pix.rb +35 -0
- data/lib/getnet_api/version.rb +2 -2
- data/lib/getnet_api.rb +5 -7
- data/spec/lib/getnet_api/address_spec.rb +77 -0
- data/spec/lib/getnet_api/base_spec.rb +6 -8
- data/spec/lib/getnet_api/boleto_spec.rb +49 -0
- data/spec/lib/getnet_api/card_spec.rb +69 -0
- data/spec/lib/getnet_api/card_verification_spec.rb +30 -0
- data/spec/lib/getnet_api/configure_spec.rb +9 -0
- data/spec/lib/getnet_api/credit_spec.rb +68 -0
- data/spec/lib/getnet_api/customer_spec.rb +130 -0
- data/spec/lib/getnet_api/order_spec.rb +30 -0
- data/spec/lib/getnet_api/payment_cancel_spec.rb +121 -0
- data/spec/lib/getnet_api/payment_spec.rb +163 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/vcr_cassettes/{getnet_api/base/build_request.yml → GetnetApi_Base/_build_request/builds_and_executes_request_based_on.yml} +12 -12
- data/spec/vcr_cassettes/GetnetApi_CardVerification/_verify/performs_the_request_and_returns_the_verification_result.yml +110 -0
- data/spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request.yml +64 -0
- data/spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request_and_returns_the_number_token.yml +112 -0
- data/spec/vcr_cassettes/GetnetApi_Payment/_create/test/correctly_requests_for_cancelling.yml +67 -0
- data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_cancelling_a_payment/correctly_execute_the_request.yml +118 -0
- data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_boleto/correctly_requests_for_boleto_payment.yml +60 -0
- data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_credit/correctly_requests_for_credit_payment.yml +63 -0
- data/spec/vcr_cassettes/getnet_api/base/valid_bearer.yml +5 -5
- data/spec/vcr_cassettes/getnet_api/cardtoken/get.yml +8 -63
- data/spec/vcr_cassettes/getnet_api/payment_cancel/create.yml +62 -0
- metadata +43 -8
@@ -1,60 +1,5 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://api-sandbox.getnet.com.br/auth/oauth/v2/token
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: grant_type=client_credentials&scope=oob
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- "*/*"
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
16
|
-
Host:
|
17
|
-
- api-sandbox.getnet.com.br
|
18
|
-
Authorization:
|
19
|
-
- Basic NzQ0Mzg4NzctZjAwYi00NTAyLTg0NTQtZGUzZDcxNjZkYzJhOjRlYWM2OTIwLTFiNTctNGNkMS04Nzk5LWQ4NzcxNzNiZmEzNw==
|
20
|
-
Content-Type:
|
21
|
-
- application/x-www-form-urlencoded
|
22
|
-
response:
|
23
|
-
status:
|
24
|
-
code: 200
|
25
|
-
message: OK
|
26
|
-
headers:
|
27
|
-
Server:
|
28
|
-
- Apache-Coyote/1.1
|
29
|
-
Pragma:
|
30
|
-
- no-cache
|
31
|
-
Cache-Control:
|
32
|
-
- no-store
|
33
|
-
Strict-Transport-Security:
|
34
|
-
- max-age=15552000; includeSubDomains
|
35
|
-
Preload:
|
36
|
-
- ''
|
37
|
-
Content-Type:
|
38
|
-
- application/json;charset=UTF-8
|
39
|
-
X-Edgeconnect-Midmile-Rtt:
|
40
|
-
- '1'
|
41
|
-
X-Edgeconnect-Origin-Mex-Latency:
|
42
|
-
- '36'
|
43
|
-
X-Powered-By:
|
44
|
-
- '11711'
|
45
|
-
Vary:
|
46
|
-
- Accept-Encoding
|
47
|
-
Date:
|
48
|
-
- Fri, 09 Apr 2021 06:39:57 GMT
|
49
|
-
Content-Length:
|
50
|
-
- '127'
|
51
|
-
Connection:
|
52
|
-
- keep-alive
|
53
|
-
body:
|
54
|
-
encoding: UTF-8
|
55
|
-
string: "{\r\n \"access_token\":\"3f322bbc-b2b6-45aa-9faa-5f8e3b9a73a5\",\r\n
|
56
|
-
\ \"token_type\":\"Bearer\",\r\n \"expires_in\":3600,\r\n \"scope\":\"oob\"\r\n}"
|
57
|
-
recorded_at: Fri, 09 Apr 2021 06:39:57 GMT
|
58
3
|
- request:
|
59
4
|
method: post
|
60
5
|
uri: https://api-sandbox.getnet.com.br/v1/tokens/card
|
@@ -71,7 +16,7 @@ http_interactions:
|
|
71
16
|
Host:
|
72
17
|
- api-sandbox.getnet.com.br
|
73
18
|
Authorization:
|
74
|
-
- Bearer
|
19
|
+
- Bearer 334de8fe-b9f4-49d3-87db-8188b69504ef
|
75
20
|
Content-Type:
|
76
21
|
- application/json
|
77
22
|
Seller-Id:
|
@@ -92,19 +37,19 @@ http_interactions:
|
|
92
37
|
Content-Type:
|
93
38
|
- application/json;charset=utf-8
|
94
39
|
Content-Length:
|
95
|
-
- '
|
40
|
+
- '128'
|
96
41
|
X-Edgeconnect-Midmile-Rtt:
|
97
|
-
- '
|
42
|
+
- '6'
|
98
43
|
X-Edgeconnect-Origin-Mex-Latency:
|
99
|
-
- '
|
44
|
+
- '32'
|
100
45
|
X-Powered-By:
|
101
|
-
- '
|
46
|
+
- '62210'
|
102
47
|
Date:
|
103
|
-
-
|
48
|
+
- Wed, 14 Apr 2021 14:08:33 GMT
|
104
49
|
Connection:
|
105
50
|
- keep-alive
|
106
51
|
body:
|
107
52
|
encoding: ASCII-8BIT
|
108
|
-
string: '{"number_token":"
|
109
|
-
recorded_at:
|
53
|
+
string: '{"number_token":"0afcea9339a585558c6b7d9beaeca015bade50a03112c94372885dc930f75f39ca310e8215f5e2fec4f90eaf834c28ddb5acc5a6f8d3fc1d59e2a421f4b9c5cf"}'
|
54
|
+
recorded_at: Wed, 14 Apr 2021 14:08:33 GMT
|
110
55
|
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api-sandbox.getnet.com.br/v1/payments/credit//cancel
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"payment_id":null,"cancel_amount":100}'
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Host:
|
17
|
+
- api-sandbox.getnet.com.br
|
18
|
+
Authorization:
|
19
|
+
- Bearer 3e28e48b-478f-4b98-b2ca-c2e82e4d5d14
|
20
|
+
Content-Type:
|
21
|
+
- application/json
|
22
|
+
Seller-Id:
|
23
|
+
- seller_id
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 401
|
27
|
+
message: Unauthorized
|
28
|
+
headers:
|
29
|
+
Server:
|
30
|
+
- Apache-Coyote/1.1
|
31
|
+
Content-Type:
|
32
|
+
- application/json;charset=UTF-8
|
33
|
+
Content-Length:
|
34
|
+
- '342'
|
35
|
+
X-Edgeconnect-Midmile-Rtt:
|
36
|
+
- '15'
|
37
|
+
X-Edgeconnect-Origin-Mex-Latency:
|
38
|
+
- '13'
|
39
|
+
X-Powered-By:
|
40
|
+
- '23307'
|
41
|
+
Date:
|
42
|
+
- Wed, 14 Apr 2021 12:27:16 GMT
|
43
|
+
Connection:
|
44
|
+
- close
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: |-
|
48
|
+
{
|
49
|
+
"message": "Unauthorized",
|
50
|
+
"name": "GatewayAuthenticationOAuth2ServiceError",
|
51
|
+
"status_code": 401,
|
52
|
+
"details": [
|
53
|
+
{
|
54
|
+
"status": "DENIED",
|
55
|
+
"error_code": "AUTHENTICATION-401",
|
56
|
+
"description": "Unauthorized",
|
57
|
+
"description_detail": "Invalid client credentials"
|
58
|
+
}
|
59
|
+
]
|
60
|
+
}
|
61
|
+
recorded_at: Wed, 14 Apr 2021 12:27:16 GMT
|
62
|
+
recorded_with: VCR 6.0.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getnet_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QW3 Software & Marketing
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -55,19 +55,37 @@ files:
|
|
55
55
|
- lib/getnet_api/order.rb
|
56
56
|
- lib/getnet_api/payment.rb
|
57
57
|
- lib/getnet_api/payment_cancel.rb
|
58
|
+
- lib/getnet_api/pix.rb
|
58
59
|
- lib/getnet_api/version.rb
|
60
|
+
- spec/lib/getnet_api/address_spec.rb
|
59
61
|
- spec/lib/getnet_api/base_spec.rb
|
62
|
+
- spec/lib/getnet_api/boleto_spec.rb
|
63
|
+
- spec/lib/getnet_api/card_spec.rb
|
60
64
|
- spec/lib/getnet_api/card_token_spec.rb
|
65
|
+
- spec/lib/getnet_api/card_verification_spec.rb
|
61
66
|
- spec/lib/getnet_api/configure_spec.rb
|
67
|
+
- spec/lib/getnet_api/credit_spec.rb
|
68
|
+
- spec/lib/getnet_api/customer_spec.rb
|
69
|
+
- spec/lib/getnet_api/order_spec.rb
|
70
|
+
- spec/lib/getnet_api/payment_cancel_spec.rb
|
71
|
+
- spec/lib/getnet_api/payment_spec.rb
|
62
72
|
- spec/spec_helper.rb
|
63
|
-
- spec/vcr_cassettes/
|
73
|
+
- spec/vcr_cassettes/GetnetApi_Base/_build_request/builds_and_executes_request_based_on.yml
|
74
|
+
- spec/vcr_cassettes/GetnetApi_CardVerification/_verify/performs_the_request_and_returns_the_verification_result.yml
|
75
|
+
- spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request.yml
|
76
|
+
- spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request_and_returns_the_number_token.yml
|
77
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/test/correctly_requests_for_cancelling.yml
|
78
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/when_cancelling_a_payment/correctly_execute_the_request.yml
|
79
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_boleto/correctly_requests_for_boleto_payment.yml
|
80
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_credit/correctly_requests_for_credit_payment.yml
|
64
81
|
- spec/vcr_cassettes/getnet_api/base/valid_bearer.yml
|
65
82
|
- spec/vcr_cassettes/getnet_api/cardtoken/get.yml
|
83
|
+
- spec/vcr_cassettes/getnet_api/payment_cancel/create.yml
|
66
84
|
homepage: https://github.com/qw3/getnet_api
|
67
85
|
licenses:
|
68
86
|
- MIT
|
69
87
|
metadata: {}
|
70
|
-
post_install_message:
|
88
|
+
post_install_message:
|
71
89
|
rdoc_options: []
|
72
90
|
require_paths:
|
73
91
|
- lib
|
@@ -82,15 +100,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
100
|
- !ruby/object:Gem::Version
|
83
101
|
version: '0'
|
84
102
|
requirements: []
|
85
|
-
rubygems_version: 3.0.
|
86
|
-
signing_key:
|
103
|
+
rubygems_version: 3.0.3.1
|
104
|
+
signing_key:
|
87
105
|
specification_version: 4
|
88
106
|
summary: Getnet API - Meios de Pagamento
|
89
107
|
test_files:
|
108
|
+
- spec/lib/getnet_api/address_spec.rb
|
90
109
|
- spec/lib/getnet_api/base_spec.rb
|
110
|
+
- spec/lib/getnet_api/boleto_spec.rb
|
111
|
+
- spec/lib/getnet_api/card_spec.rb
|
91
112
|
- spec/lib/getnet_api/card_token_spec.rb
|
113
|
+
- spec/lib/getnet_api/card_verification_spec.rb
|
92
114
|
- spec/lib/getnet_api/configure_spec.rb
|
115
|
+
- spec/lib/getnet_api/credit_spec.rb
|
116
|
+
- spec/lib/getnet_api/customer_spec.rb
|
117
|
+
- spec/lib/getnet_api/order_spec.rb
|
118
|
+
- spec/lib/getnet_api/payment_cancel_spec.rb
|
119
|
+
- spec/lib/getnet_api/payment_spec.rb
|
93
120
|
- spec/spec_helper.rb
|
94
|
-
- spec/vcr_cassettes/
|
121
|
+
- spec/vcr_cassettes/GetnetApi_Base/_build_request/builds_and_executes_request_based_on.yml
|
122
|
+
- spec/vcr_cassettes/GetnetApi_CardVerification/_verify/performs_the_request_and_returns_the_verification_result.yml
|
123
|
+
- spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request.yml
|
124
|
+
- spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request_and_returns_the_number_token.yml
|
125
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/test/correctly_requests_for_cancelling.yml
|
126
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/when_cancelling_a_payment/correctly_execute_the_request.yml
|
127
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_boleto/correctly_requests_for_boleto_payment.yml
|
128
|
+
- spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_credit/correctly_requests_for_credit_payment.yml
|
95
129
|
- spec/vcr_cassettes/getnet_api/base/valid_bearer.yml
|
96
130
|
- spec/vcr_cassettes/getnet_api/cardtoken/get.yml
|
131
|
+
- spec/vcr_cassettes/getnet_api/payment_cancel/create.yml
|