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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +14 -2
  3. data/.gitignore +2 -0
  4. data/Gemfile.lock +8 -8
  5. data/README.md +27 -6
  6. data/lib/getnet_api/base.rb +14 -18
  7. data/lib/getnet_api/boleto.rb +0 -1
  8. data/lib/getnet_api/customer.rb +5 -5
  9. data/lib/getnet_api/payment.rb +23 -29
  10. data/lib/getnet_api/pix.rb +35 -0
  11. data/lib/getnet_api/version.rb +2 -2
  12. data/lib/getnet_api.rb +5 -7
  13. data/spec/lib/getnet_api/address_spec.rb +77 -0
  14. data/spec/lib/getnet_api/base_spec.rb +6 -8
  15. data/spec/lib/getnet_api/boleto_spec.rb +49 -0
  16. data/spec/lib/getnet_api/card_spec.rb +69 -0
  17. data/spec/lib/getnet_api/card_verification_spec.rb +30 -0
  18. data/spec/lib/getnet_api/configure_spec.rb +9 -0
  19. data/spec/lib/getnet_api/credit_spec.rb +68 -0
  20. data/spec/lib/getnet_api/customer_spec.rb +130 -0
  21. data/spec/lib/getnet_api/order_spec.rb +30 -0
  22. data/spec/lib/getnet_api/payment_cancel_spec.rb +121 -0
  23. data/spec/lib/getnet_api/payment_spec.rb +163 -0
  24. data/spec/spec_helper.rb +1 -0
  25. data/spec/vcr_cassettes/{getnet_api/base/build_request.yml → GetnetApi_Base/_build_request/builds_and_executes_request_based_on.yml} +12 -12
  26. data/spec/vcr_cassettes/GetnetApi_CardVerification/_verify/performs_the_request_and_returns_the_verification_result.yml +110 -0
  27. data/spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request.yml +64 -0
  28. data/spec/vcr_cassettes/GetnetApi_Customer/_create/performs_the_request_and_returns_the_number_token.yml +112 -0
  29. data/spec/vcr_cassettes/GetnetApi_Payment/_create/test/correctly_requests_for_cancelling.yml +67 -0
  30. data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_cancelling_a_payment/correctly_execute_the_request.yml +118 -0
  31. data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_boleto/correctly_requests_for_boleto_payment.yml +60 -0
  32. data/spec/vcr_cassettes/GetnetApi_Payment/_create/when_paying_by_credit/correctly_requests_for_credit_payment.yml +63 -0
  33. data/spec/vcr_cassettes/getnet_api/base/valid_bearer.yml +5 -5
  34. data/spec/vcr_cassettes/getnet_api/cardtoken/get.yml +8 -63
  35. data/spec/vcr_cassettes/getnet_api/payment_cancel/create.yml +62 -0
  36. metadata +43 -8
@@ -0,0 +1,110 @@
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
+ - '130'
41
+ X-Edgeconnect-Midmile-Rtt:
42
+ - '8'
43
+ X-Edgeconnect-Origin-Mex-Latency:
44
+ - '84'
45
+ X-Powered-By:
46
+ - '62211'
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":"20fab04ff355fd0ec046137cc81a75f6f49ed1aa6b1700e40421824bf732447f105fa1740774782bad3c19c1a461f6c4f363ed95738e882635e19dad452c29d5"}'
54
+ recorded_at: Wed, 14 Apr 2021 14:08:33 GMT
55
+ - request:
56
+ method: post
57
+ uri: https://api-sandbox.getnet.com.br/v1/cards/verification
58
+ body:
59
+ encoding: UTF-8
60
+ string: '{"number_token":"20fab04ff355fd0ec046137cc81a75f6f49ed1aa6b1700e40421824bf732447f105fa1740774782bad3c19c1a461f6c4f363ed95738e882635e19dad452c29d5","cardholder_name":"JOAO
61
+ DA SILVA","expiration_month":"12","expiration_year":"20","security_code":"123"}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - "*/*"
67
+ User-Agent:
68
+ - Ruby
69
+ Host:
70
+ - api-sandbox.getnet.com.br
71
+ Authorization:
72
+ - Bearer 334de8fe-b9f4-49d3-87db-8188b69504ef
73
+ Content-Type:
74
+ - application/json
75
+ Seller-Id:
76
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Server:
83
+ - Apache-Coyote/1.1
84
+ Cache-Control:
85
+ - no-cache
86
+ Strict-Transport-Security:
87
+ - max-age=15552000; includeSubDomains
88
+ Preload:
89
+ - ''
90
+ Content-Type:
91
+ - application/json;charset=utf-8
92
+ X-Edgeconnect-Midmile-Rtt:
93
+ - '6'
94
+ X-Edgeconnect-Origin-Mex-Latency:
95
+ - '826'
96
+ X-Powered-By:
97
+ - '62212'
98
+ Vary:
99
+ - Accept-Encoding
100
+ Date:
101
+ - Wed, 14 Apr 2021 14:08:34 GMT
102
+ Content-Length:
103
+ - '120'
104
+ Connection:
105
+ - keep-alive
106
+ body:
107
+ encoding: UTF-8
108
+ string: '{"status":"VERIFIED","verification_id":"52eed537-e894-4b1e-a037-98601aa4b942","authorization_code":"205833985653860670"}'
109
+ recorded_at: Wed, 14 Apr 2021 14:08:34 GMT
110
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-sandbox.getnet.com.br/v1/customers
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"customer_id":"123","first_name":"João","last_name":"da Silva","email":"joao@email.com","document_type":"CPF","document_number":"12332112340","phone_number":"5551999887766","address":{"street":"Nome
9
+ da Rua","number":"123","complement":"Complemento","district":"Nome do Bairro","city":"São
10
+ Paulo","state":"SP","postal_code":"01010010","country":"Brasil"}}'
11
+ headers:
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ Host:
19
+ - api-sandbox.getnet.com.br
20
+ Authorization:
21
+ - Bearer 3e28e48b-478f-4b98-b2ca-c2e82e4d5d14
22
+ Content-Type:
23
+ - application/json
24
+ Seller-Id:
25
+ - seller_id
26
+ response:
27
+ status:
28
+ code: 401
29
+ message: Unauthorized
30
+ headers:
31
+ Server:
32
+ - Apache-Coyote/1.1
33
+ Content-Type:
34
+ - application/json;charset=UTF-8
35
+ Content-Length:
36
+ - '342'
37
+ X-Edgeconnect-Midmile-Rtt:
38
+ - '11'
39
+ X-Edgeconnect-Origin-Mex-Latency:
40
+ - '48'
41
+ X-Powered-By:
42
+ - '58105'
43
+ Date:
44
+ - Tue, 13 Apr 2021 19:23:49 GMT
45
+ Connection:
46
+ - close
47
+ body:
48
+ encoding: UTF-8
49
+ string: |-
50
+ {
51
+ "message": "Unauthorized",
52
+ "name": "GatewayAuthenticationOAuth2ServiceError",
53
+ "status_code": 401,
54
+ "details": [
55
+ {
56
+ "status": "DENIED",
57
+ "error_code": "AUTHENTICATION-401",
58
+ "description": "Unauthorized",
59
+ "description_detail": "Invalid client credentials"
60
+ }
61
+ ]
62
+ }
63
+ recorded_at: Tue, 13 Apr 2021 19:23:49 GMT
64
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,112 @@
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
+ - '11'
41
+ X-Edgeconnect-Origin-Mex-Latency:
42
+ - '19'
43
+ X-Powered-By:
44
+ - '51305'
45
+ Vary:
46
+ - Accept-Encoding
47
+ Date:
48
+ - Mon, 12 Apr 2021 20:38:45 GMT
49
+ Content-Length:
50
+ - '127'
51
+ Connection:
52
+ - keep-alive
53
+ body:
54
+ encoding: UTF-8
55
+ string: "{\r\n \"access_token\":\"b4679010-cf4f-4804-a5fc-d59cba7675d5\",\r\n
56
+ \ \"token_type\":\"Bearer\",\r\n \"expires_in\":3600,\r\n \"scope\":\"oob\"\r\n}"
57
+ recorded_at: Mon, 12 Apr 2021 20:38:45 GMT
58
+ - request:
59
+ method: post
60
+ uri: https://api-sandbox.getnet.com.br/v1/customers
61
+ body:
62
+ encoding: UTF-8
63
+ string: '{"customer_id":"123","first_name":"João","last_name":"da Silva","email":"joao@email.com","document_type":"CPF","document_number":"12332112340","phone_number":"5551999887766","address":{"street":"Nome
64
+ da Rua","number":"123","complement":"Complemento","district":"Nome do Bairro","city":"São
65
+ Paulo","state":"SP","postal_code":"01010010","country":"Brasil"}}'
66
+ headers:
67
+ Accept-Encoding:
68
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
69
+ Accept:
70
+ - "*/*"
71
+ User-Agent:
72
+ - Ruby
73
+ Host:
74
+ - api-sandbox.getnet.com.br
75
+ Authorization:
76
+ - Bearer b4679010-cf4f-4804-a5fc-d59cba7675d5
77
+ Content-Type:
78
+ - application/json
79
+ Seller-Id:
80
+ - 67be6e90-00c1-410d-83f5-6d75621effc8
81
+ response:
82
+ status:
83
+ code: 501
84
+ message: Not Implemented
85
+ headers:
86
+ Server:
87
+ - Apache-Coyote/1.1
88
+ Cache-Control:
89
+ - no-cache
90
+ Strict-Transport-Security:
91
+ - max-age=15552000; includeSubDomains
92
+ Preload:
93
+ - ''
94
+ Content-Type:
95
+ - application/json;charset=utf-8
96
+ Content-Length:
97
+ - '85'
98
+ X-Edgeconnect-Midmile-Rtt:
99
+ - '11'
100
+ X-Edgeconnect-Origin-Mex-Latency:
101
+ - '81'
102
+ X-Powered-By:
103
+ - '51306'
104
+ Date:
105
+ - Mon, 12 Apr 2021 20:38:45 GMT
106
+ Connection:
107
+ - close
108
+ body:
109
+ encoding: ASCII-8BIT
110
+ string: '{"message":"Not Implemented","name":"","status_code":501,"details":[]}'
111
+ recorded_at: Mon, 12 Apr 2021 20:38:45 GMT
112
+ recorded_with: VCR 6.0.0
@@ -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
@@ -39,20 +39,20 @@ http_interactions:
39
39
  X-Edgeconnect-Midmile-Rtt:
40
40
  - '8'
41
41
  X-Edgeconnect-Origin-Mex-Latency:
42
- - '29'
42
+ - '16'
43
43
  X-Powered-By:
44
- - '63123'
44
+ - '62209'
45
45
  Vary:
46
46
  - Accept-Encoding
47
47
  Date:
48
- - Tue, 06 Apr 2021 16:45:43 GMT
48
+ - Wed, 14 Apr 2021 14:08:33 GMT
49
49
  Content-Length:
50
50
  - '127'
51
51
  Connection:
52
52
  - keep-alive
53
53
  body:
54
54
  encoding: UTF-8
55
- string: "{\r\n \"access_token\":\"3e28e48b-478f-4b98-b2ca-c2e82e4d5d14\",\r\n
55
+ string: "{\r\n \"access_token\":\"334de8fe-b9f4-49d3-87db-8188b69504ef\",\r\n
56
56
  \ \"token_type\":\"Bearer\",\r\n \"expires_in\":3600,\r\n \"scope\":\"oob\"\r\n}"
57
- recorded_at: Tue, 06 Apr 2021 16:45:43 GMT
57
+ recorded_at: Wed, 14 Apr 2021 14:08:33 GMT
58
58
  recorded_with: VCR 6.0.0