getnet_api 1.0.2 → 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.
Files changed (41) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +40 -0
  3. data/.gitignore +2 -0
  4. data/.rspec +1 -0
  5. data/Gemfile +11 -1
  6. data/Gemfile.lock +63 -10
  7. data/README.md +31 -6
  8. data/lib/getnet_api/base.rb +14 -18
  9. data/lib/getnet_api/boleto.rb +0 -1
  10. data/lib/getnet_api/configure.rb +1 -1
  11. data/lib/getnet_api/customer.rb +5 -5
  12. data/lib/getnet_api/payment.rb +23 -29
  13. data/lib/getnet_api/payment_cancel.rb +1 -1
  14. data/lib/getnet_api/pix.rb +35 -0
  15. data/lib/getnet_api/version.rb +2 -2
  16. data/lib/getnet_api.rb +5 -5
  17. data/spec/lib/getnet_api/address_spec.rb +77 -0
  18. data/spec/lib/getnet_api/base_spec.rb +63 -0
  19. data/spec/lib/getnet_api/boleto_spec.rb +49 -0
  20. data/spec/lib/getnet_api/card_spec.rb +69 -0
  21. data/spec/lib/getnet_api/card_token_spec.rb +15 -0
  22. data/spec/lib/getnet_api/card_verification_spec.rb +30 -0
  23. data/spec/lib/getnet_api/configure_spec.rb +70 -0
  24. data/spec/lib/getnet_api/credit_spec.rb +68 -0
  25. data/spec/lib/getnet_api/customer_spec.rb +130 -0
  26. data/spec/lib/getnet_api/order_spec.rb +30 -0
  27. data/spec/lib/getnet_api/payment_cancel_spec.rb +121 -0
  28. data/spec/lib/getnet_api/payment_spec.rb +163 -0
  29. data/spec/spec_helper.rb +121 -0
  30. data/spec/vcr_cassettes/GetnetApi_Base/_build_request/builds_and_executes_request_based_on.yml +113 -0
  31. data/spec/vcr_cassettes/GetnetApi_CardVerification/_verify/performs_the_request_and_returns_the_verification_result.yml +110 -0
  32. data/spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request.yml +64 -0
  33. data/spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request_and_returns_the_number_token.yml +112 -0
  34. data/spec/vcr_cassettes/GetnetApi_Payment/_create/test/correctly_requests_for_cancelling.yml +67 -0
  35. data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_cancelling_a_payment/correctly_execute_the_request.yml +118 -0
  36. data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_boleto/correctly_requests_for_boleto_payment.yml +60 -0
  37. data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_credit/correctly_requests_for_credit_payment.yml +63 -0
  38. data/spec/vcr_cassettes/getnet_api/base/valid_bearer.yml +58 -0
  39. data/spec/vcr_cassettes/getnet_api/cardtoken/get.yml +55 -0
  40. data/spec/vcr_cassettes/getnet_api/payment_cancel/create.yml +62 -0
  41. metadata +58 -8
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-sandbox.getnet.com.br/v1/payments/credit
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"seller_id":"seller_id","amount":100,"currency":"BRL","order":{"order_id":"123","sales_tax":0,"product_type":"service"},"customer":{"customer_id":"123","first_name":"João","last_name":"da
9
+ Silva","email":"joao@email.com","document_type":"CPF","document_number":"12332112340","phone_number":"5551999887766","name":"João
10
+ da Silva","billing_address":{"street":"Nome da Rua","number":"123","complement":"Complemento","district":"Nome
11
+ do Bairro","city":"São Paulo","state":"SP","postal_code":"01010010","country":"Brasil"}},"credit":{"delayed":false,"authenticated":false,"pre_authorization":false,"save_card_data":false,"transaction_type":"FULL","number_installments":1,"soft_descriptor":"Descrição
12
+ para fatura","dynamic_mcc":1799,"card":{"number_token":"bad203f8101ee124f0fadde3c5200ab130a3ae577d3ecd687e3a8743767bf3ca36fe9b4a1f0698520de1172acda4d5aa8407f4f22035e6dc197a083a88459f9e","cardholder_name":"JOAO
13
+ DA SILVA","security_code":"123","brand":"Mastercard","expiration_month":"12","expiration_year":"23"}}}'
14
+ headers:
15
+ Accept-Encoding:
16
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
17
+ Accept:
18
+ - "*/*"
19
+ User-Agent:
20
+ - Ruby
21
+ Host:
22
+ - api-sandbox.getnet.com.br
23
+ Authorization:
24
+ - Bearer 3e28e48b-478f-4b98-b2ca-c2e82e4d5d14
25
+ Content-Type:
26
+ - application/json
27
+ Seller-Id:
28
+ - seller_id
29
+ response:
30
+ status:
31
+ code: 401
32
+ message: Unauthorized
33
+ headers:
34
+ Server:
35
+ - Apache-Coyote/1.1
36
+ Content-Type:
37
+ - application/json;charset=UTF-8
38
+ Content-Length:
39
+ - '342'
40
+ X-Edgeconnect-Midmile-Rtt:
41
+ - '15'
42
+ X-Edgeconnect-Origin-Mex-Latency:
43
+ - '60'
44
+ X-Powered-By:
45
+ - '23306'
46
+ Date:
47
+ - Wed, 14 Apr 2021 12:27:16 GMT
48
+ Connection:
49
+ - close
50
+ body:
51
+ encoding: UTF-8
52
+ string: |-
53
+ {
54
+ "message": "Unauthorized",
55
+ "name": "GatewayAuthenticationOAuth2ServiceError",
56
+ "status_code": 401,
57
+ "details": [
58
+ {
59
+ "status": "DENIED",
60
+ "error_code": "AUTHENTICATION-401",
61
+ "description": "Unauthorized",
62
+ "description_detail": "Invalid client credentials"
63
+ }
64
+ ]
65
+ }
66
+ recorded_at: Wed, 14 Apr 2021 12:27:16 GMT
67
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,118 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-sandbox.getnet.com.br/v1/payments/credit
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":100,"currency":"BRL","order":{"order_id":"123","sales_tax":0,"product_type":"service"},"customer":{"customer_id":"123","first_name":"João","last_name":"da
9
+ Silva","email":"joao@email.com","document_type":"CPF","document_number":"12332112340","phone_number":"5551999887766","name":"João
10
+ da Silva","billing_address":{"street":"Nome da Rua","number":"123","complement":"Complemento","district":"Nome
11
+ do Bairro","city":"São Paulo","state":"SP","postal_code":"01010010","country":"Brasil"}},"credit":{"delayed":false,"authenticated":false,"pre_authorization":false,"save_card_data":false,"transaction_type":"FULL","number_installments":1,"soft_descriptor":"Descrição
12
+ para fatura","dynamic_mcc":1799,"card":{"number_token":"6340d06dbac68528648f961d2a8dddc95659cacf87eeee451777ba471860b3ee37f316b39191bd40665352406ce476142edb425b9afa600b1b70109f0df68859","cardholder_name":"JOAO
13
+ DA SILVA","security_code":"123","brand":"Mastercard","expiration_month":"12","expiration_year":"23"}}}'
14
+ headers:
15
+ Accept-Encoding:
16
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
17
+ Accept:
18
+ - "*/*"
19
+ User-Agent:
20
+ - Ruby
21
+ Host:
22
+ - api-sandbox.getnet.com.br
23
+ Authorization:
24
+ - Bearer cb65c188-3266-462d-9445-7e5e22f921bb
25
+ Content-Type:
26
+ - application/json
27
+ Seller-Id:
28
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
29
+ response:
30
+ status:
31
+ code: 200
32
+ message: OK
33
+ headers:
34
+ Server:
35
+ - Apache-Coyote/1.1
36
+ Cache-Control:
37
+ - no-cache
38
+ Strict-Transport-Security:
39
+ - max-age=15552000; includeSubDomains
40
+ Preload:
41
+ - ''
42
+ Content-Type:
43
+ - application/json;charset=utf-8
44
+ X-Edgeconnect-Midmile-Rtt:
45
+ - '18'
46
+ X-Edgeconnect-Origin-Mex-Latency:
47
+ - '469'
48
+ X-Powered-By:
49
+ - '23324'
50
+ Vary:
51
+ - Accept-Encoding
52
+ Date:
53
+ - Wed, 14 Apr 2021 14:17:02 GMT
54
+ Content-Length:
55
+ - '545'
56
+ Connection:
57
+ - keep-alive
58
+ body:
59
+ encoding: UTF-8
60
+ string: '{"payment_id":"7961fb34-dc3a-4c43-b1f5-4016bbc3baf2","seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":100,"currency":"BRL","order_id":"123","status":"APPROVED","received_at":"2021-04-14T14:17:02.495Z","credit":{"delayed":false,"authorization_code":"736551874784","authorized_at":"2021-04-14T14:17:02.495Z","reason_code":"0","reason_message":"transaction
61
+ approved","acquirer":"GETNET","soft_descriptor":"EC*SANDBOX","terminal_nsu":"466063","brand":"Mastercard","acquirer_transaction_id":"16084272","transaction_id":"8311439918432371"}}'
62
+ recorded_at: Wed, 14 Apr 2021 14:17:02 GMT
63
+ - request:
64
+ method: post
65
+ uri: https://api-sandbox.getnet.com.br/v1/payments/credit/7961fb34-dc3a-4c43-b1f5-4016bbc3baf2/cancel
66
+ body:
67
+ encoding: UTF-8
68
+ string: '{"payment_id":"7961fb34-dc3a-4c43-b1f5-4016bbc3baf2","cancel_amount":100}'
69
+ headers:
70
+ Accept-Encoding:
71
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
72
+ Accept:
73
+ - "*/*"
74
+ User-Agent:
75
+ - Ruby
76
+ Host:
77
+ - api-sandbox.getnet.com.br
78
+ Authorization:
79
+ - Bearer cb65c188-3266-462d-9445-7e5e22f921bb
80
+ Content-Type:
81
+ - application/json
82
+ Seller-Id:
83
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
84
+ response:
85
+ status:
86
+ code: 200
87
+ message: OK
88
+ headers:
89
+ Server:
90
+ - Apache-Coyote/1.1
91
+ Cache-Control:
92
+ - no-cache
93
+ Strict-Transport-Security:
94
+ - max-age=15552000; includeSubDomains
95
+ Preload:
96
+ - ''
97
+ Content-Type:
98
+ - application/json;charset=utf-8
99
+ X-Edgeconnect-Midmile-Rtt:
100
+ - '15'
101
+ X-Edgeconnect-Origin-Mex-Latency:
102
+ - '584'
103
+ X-Powered-By:
104
+ - '23325'
105
+ Vary:
106
+ - Accept-Encoding
107
+ Date:
108
+ - Wed, 14 Apr 2021 14:17:03 GMT
109
+ Content-Length:
110
+ - '283'
111
+ Connection:
112
+ - keep-alive
113
+ body:
114
+ encoding: UTF-8
115
+ string: '{"payment_id":"7961fb34-dc3a-4c43-b1f5-4016bbc3baf2","seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":100,"currency":"BRL","order_id":"123","status":"CANCELED","credit_cancel":{"canceled_at":"2021-04-14T14:17:02.979Z","message":"Credit
116
+ transaction cancelled sucessfully"}}'
117
+ recorded_at: Wed, 14 Apr 2021 14:17:03 GMT
118
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,60 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-sandbox.getnet.com.br/v1/payments/boleto
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":10000,"currency":"BRL","order":{"order_id":"123","sales_tax":0,"product_type":"service"},"customer":{"customer_id":"123","first_name":"João","last_name":"da
9
+ Silva","email":"joao@email.com","document_type":"CPF","document_number":"12332112340","phone_number":"5551999887766","name":"João
10
+ da Silva","billing_address":{"street":"Nome da Rua","number":"123","complement":"Complemento","district":"Nome
11
+ do Bairro","city":"São Paulo","state":"SP","postal_code":"01010010","country":"Brasil"}},"boleto":{"our_number":"123321123","document_number":"12345678","expiration_date":null,"instructions":"Não
12
+ receber após o vencimento","provider":"santander"}}'
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ Host:
21
+ - api-sandbox.getnet.com.br
22
+ Authorization:
23
+ - Bearer 334de8fe-b9f4-49d3-87db-8188b69504ef
24
+ Content-Type:
25
+ - application/json
26
+ Seller-Id:
27
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
28
+ response:
29
+ status:
30
+ code: 201
31
+ message: Created
32
+ headers:
33
+ Server:
34
+ - Apache-Coyote/1.1
35
+ Cache-Control:
36
+ - no-cache
37
+ Strict-Transport-Security:
38
+ - max-age=15552000; includeSubDomains
39
+ Preload:
40
+ - ''
41
+ Content-Type:
42
+ - application/json;charset=utf-8
43
+ Content-Length:
44
+ - '405'
45
+ X-Edgeconnect-Midmile-Rtt:
46
+ - '8'
47
+ X-Edgeconnect-Origin-Mex-Latency:
48
+ - '35'
49
+ X-Powered-By:
50
+ - '62214'
51
+ Date:
52
+ - Wed, 14 Apr 2021 14:08:34 GMT
53
+ Connection:
54
+ - keep-alive
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: '{"payment_id":"nrxi4nuwv8bvhf6l28m2ae5y","seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":10000,"currency":"BRL","order_id":"123","status":"PENDING","boleto":{"boleto_id":"35efbe68-0df6-4989-bcee-fb4d6b7d4f52","bank":"033","status_code":"1","status_label":"EM
58
+ ABERTO","typeful_line":"01010.01010 01010.010101 01010.010101 1 01010101010101","bar_code":"03393775500000002009589193012345678901230101","issue_date":"14/04/2021","expiration_date":"21/04/2021","our_number":"000123321123","document_number":"000000012345678","_links":[{"href":"/v1/payments/boleto/nrxi4nuwv8bvhf6l28m2ae5y/pdf","rel":"boleto_pdf","type":"GET"},{"href":"/v1/payments/boleto/nrxi4nuwv8bvhf6l28m2ae5y/html","rel":"boleto_html","type":"GET"}]}}'
59
+ recorded_at: Wed, 14 Apr 2021 14:08:34 GMT
60
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-sandbox.getnet.com.br/v1/payments/credit
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":10000,"currency":"BRL","order":{"order_id":"123","sales_tax":0,"product_type":"service"},"customer":{"customer_id":"123","first_name":"João","last_name":"da
9
+ Silva","email":"joao@email.com","document_type":"CPF","document_number":"12332112340","phone_number":"5551999887766","name":"João
10
+ da Silva","billing_address":{"street":"Nome da Rua","number":"123","complement":"Complemento","district":"Nome
11
+ do Bairro","city":"São Paulo","state":"SP","postal_code":"01010010","country":"Brasil"}},"credit":{"delayed":false,"authenticated":false,"pre_authorization":false,"save_card_data":false,"transaction_type":"FULL","number_installments":1,"soft_descriptor":"Descrição
12
+ para fatura","dynamic_mcc":1799,"card":{"number_token":"0afcea9339a585558c6b7d9beaeca015bade50a03112c94372885dc930f75f39ca310e8215f5e2fec4f90eaf834c28ddb5acc5a6f8d3fc1d59e2a421f4b9c5cf","cardholder_name":"JOAO
13
+ DA SILVA","security_code":"123","brand":"Mastercard","expiration_month":"12","expiration_year":"23"}}}'
14
+ headers:
15
+ Accept-Encoding:
16
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
17
+ Accept:
18
+ - "*/*"
19
+ User-Agent:
20
+ - Ruby
21
+ Host:
22
+ - api-sandbox.getnet.com.br
23
+ Authorization:
24
+ - Bearer 334de8fe-b9f4-49d3-87db-8188b69504ef
25
+ Content-Type:
26
+ - application/json
27
+ Seller-Id:
28
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
29
+ response:
30
+ status:
31
+ code: 200
32
+ message: OK
33
+ headers:
34
+ Server:
35
+ - Apache-Coyote/1.1
36
+ Cache-Control:
37
+ - no-cache
38
+ Strict-Transport-Security:
39
+ - max-age=15552000; includeSubDomains
40
+ Preload:
41
+ - ''
42
+ Content-Type:
43
+ - application/json;charset=utf-8
44
+ X-Edgeconnect-Midmile-Rtt:
45
+ - '6'
46
+ X-Edgeconnect-Origin-Mex-Latency:
47
+ - '386'
48
+ X-Powered-By:
49
+ - '62215'
50
+ Vary:
51
+ - Accept-Encoding
52
+ Date:
53
+ - Wed, 14 Apr 2021 14:08:35 GMT
54
+ Content-Length:
55
+ - '547'
56
+ Connection:
57
+ - keep-alive
58
+ body:
59
+ encoding: UTF-8
60
+ string: '{"payment_id":"7f110fde-4f49-45ef-b4fb-ff9778c76d15","seller_id":"67be6e90-00c1-410d-83f5-6d75621effc8","amount":10000,"currency":"BRL","order_id":"123","status":"APPROVED","received_at":"2021-04-14T14:08:35.096Z","credit":{"delayed":false,"authorization_code":"745645643933","authorized_at":"2021-04-14T14:08:35.096Z","reason_code":"0","reason_message":"transaction
61
+ approved","acquirer":"GETNET","soft_descriptor":"EC*SANDBOX","terminal_nsu":"125723","brand":"Mastercard","acquirer_transaction_id":"43310188","transaction_id":"3746025620583979"}}'
62
+ recorded_at: Wed, 14 Apr 2021 14:08:35 GMT
63
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,58 @@
1
+ ---
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
+ - '8'
41
+ X-Edgeconnect-Origin-Mex-Latency:
42
+ - '16'
43
+ X-Powered-By:
44
+ - '62209'
45
+ Vary:
46
+ - Accept-Encoding
47
+ Date:
48
+ - Wed, 14 Apr 2021 14:08:33 GMT
49
+ Content-Length:
50
+ - '127'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: "{\r\n \"access_token\":\"334de8fe-b9f4-49d3-87db-8188b69504ef\",\r\n
56
+ \ \"token_type\":\"Bearer\",\r\n \"expires_in\":3600,\r\n \"scope\":\"oob\"\r\n}"
57
+ recorded_at: Wed, 14 Apr 2021 14:08:33 GMT
58
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,55 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-sandbox.getnet.com.br/v1/tokens/card
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"card_number":"5155901222280001"}'
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 334de8fe-b9f4-49d3-87db-8188b69504ef
20
+ Content-Type:
21
+ - application/json
22
+ Seller-Id:
23
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
24
+ response:
25
+ status:
26
+ code: 201
27
+ message: Created
28
+ headers:
29
+ Server:
30
+ - Apache-Coyote/1.1
31
+ Cache-Control:
32
+ - no-cache
33
+ Strict-Transport-Security:
34
+ - max-age=15552000; includeSubDomains
35
+ Preload:
36
+ - ''
37
+ Content-Type:
38
+ - application/json;charset=utf-8
39
+ Content-Length:
40
+ - '128'
41
+ X-Edgeconnect-Midmile-Rtt:
42
+ - '6'
43
+ X-Edgeconnect-Origin-Mex-Latency:
44
+ - '32'
45
+ X-Powered-By:
46
+ - '62210'
47
+ Date:
48
+ - Wed, 14 Apr 2021 14:08:33 GMT
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: ASCII-8BIT
53
+ string: '{"number_token":"0afcea9339a585558c6b7d9beaeca015bade50a03112c94372885dc930f75f39ca310e8215f5e2fec4f90eaf834c28ddb5acc5a6f8d3fc1d59e2a421f4b9c5cf"}'
54
+ recorded_at: Wed, 14 Apr 2021 14:08:33 GMT
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.2
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: 2020-08-13 00:00:00.000000000 Z
11
+ date: 2025-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -33,7 +33,9 @@ executables: []
33
33
  extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
+ - ".github/workflows/ruby.yml"
36
37
  - ".gitignore"
38
+ - ".rspec"
37
39
  - Gemfile
38
40
  - Gemfile.lock
39
41
  - LICENSE
@@ -53,12 +55,37 @@ files:
53
55
  - lib/getnet_api/order.rb
54
56
  - lib/getnet_api/payment.rb
55
57
  - lib/getnet_api/payment_cancel.rb
58
+ - lib/getnet_api/pix.rb
56
59
  - lib/getnet_api/version.rb
60
+ - spec/lib/getnet_api/address_spec.rb
61
+ - spec/lib/getnet_api/base_spec.rb
62
+ - spec/lib/getnet_api/boleto_spec.rb
63
+ - spec/lib/getnet_api/card_spec.rb
64
+ - spec/lib/getnet_api/card_token_spec.rb
65
+ - spec/lib/getnet_api/card_verification_spec.rb
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
72
+ - spec/spec_helper.rb
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
81
+ - spec/vcr_cassettes/getnet_api/base/valid_bearer.yml
82
+ - spec/vcr_cassettes/getnet_api/cardtoken/get.yml
83
+ - spec/vcr_cassettes/getnet_api/payment_cancel/create.yml
57
84
  homepage: https://github.com/qw3/getnet_api
58
85
  licenses:
59
86
  - MIT
60
87
  metadata: {}
61
- post_install_message:
88
+ post_install_message:
62
89
  rdoc_options: []
63
90
  require_paths:
64
91
  - lib
@@ -73,9 +100,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
100
  - !ruby/object:Gem::Version
74
101
  version: '0'
75
102
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.4.8
78
- signing_key:
103
+ rubygems_version: 3.0.3.1
104
+ signing_key:
79
105
  specification_version: 4
80
106
  summary: Getnet API - Meios de Pagamento
81
- test_files: []
107
+ test_files:
108
+ - spec/lib/getnet_api/address_spec.rb
109
+ - spec/lib/getnet_api/base_spec.rb
110
+ - spec/lib/getnet_api/boleto_spec.rb
111
+ - spec/lib/getnet_api/card_spec.rb
112
+ - spec/lib/getnet_api/card_token_spec.rb
113
+ - spec/lib/getnet_api/card_verification_spec.rb
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
120
+ - spec/spec_helper.rb
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
129
+ - spec/vcr_cassettes/getnet_api/base/valid_bearer.yml
130
+ - spec/vcr_cassettes/getnet_api/cardtoken/get.yml
131
+ - spec/vcr_cassettes/getnet_api/payment_cancel/create.yml