mp_api 0.3.11 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mp_api/payment.rb +4 -2
- data/lib/mp_api/payment_error.rb +2 -1
- data/lib/mp_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f698c10976e005ed5fb524e6ff6a92005ae477ce7218a54b29783849fbe85048
|
4
|
+
data.tar.gz: cdce89a4463b792079923cb701ebe92a1b2b4c32e8a9a6aab67cd5660114921a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7f8e4fa1fb084aa51134a39451d0b644ac00a821bbfc367c76bbe491e9ce2ce31e23ba1f4f535b5879a16186bc4d691d2c3ae90f8bd7b1f1dbb71620fc66c6f
|
7
|
+
data.tar.gz: f3e034f371edd0f4203798d31c7879e52f9393b5165eb65fa26f44a2383849f1317b2d0971d2b730da471315b077e9e629837805097a2b1049cdc7c8d56f5731
|
data/lib/mp_api/payment.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module MpApi
|
2
2
|
class Payment
|
3
|
-
attr_reader :status_detail, :three_ds_info_creq, :three_ds_info_external_resource_url, :three_d_secure_mode, :id, :description, :date_approved, :date_created, :money_release_date, :payer_email, :payer_identification_type, :payer_identification_number, :payment_method, :payment_type, :qr_code, :qr_code_base_64, :transaction_id, :ticket_url, :status, :amount, :token, :issuer_id, :installments, :statement_descriptor, :items, :error, :internal_error, :capture, :date_of_expiration
|
4
|
-
def initialize(payer_email:, payer_identification_type:, payer_identification_number:, payment_method:, amount:, status_detail: nil, three_ds_info_creq: nil, three_ds_info_external_resource_url: nil, three_d_secure_mode: nil, id: nil, description: nil, date_approved: nil, date_created: nil, money_release_date: nil, payment_type: nil, qr_code: nil, qr_code_base_64: nil, transaction_id: nil, ticket_url: nil, status: nil, token: nil, issuer_id: nil, installments: nil, items: nil, statement_descriptor: nil, error: nil, internal_error: nil, capture: nil, date_of_expiration: nil)
|
3
|
+
attr_reader :status_detail, :three_ds_info_creq, :three_ds_info_external_resource_url, :three_d_secure_mode, :id, :description, :date_approved, :date_created, :money_release_date, :payer_email, :payer_identification_type, :payer_identification_number, :payment_method, :last_four_digits, :payment_type, :qr_code, :qr_code_base_64, :transaction_id, :ticket_url, :status, :amount, :token, :issuer_id, :installments, :statement_descriptor, :items, :error, :internal_error, :capture, :date_of_expiration
|
4
|
+
def initialize(payer_email:, payer_identification_type:, payer_identification_number:, payment_method:, last_four_digits: nil, amount:, status_detail: nil, three_ds_info_creq: nil, three_ds_info_external_resource_url: nil, three_d_secure_mode: nil, id: nil, description: nil, date_approved: nil, date_created: nil, money_release_date: nil, payment_type: nil, qr_code: nil, qr_code_base_64: nil, transaction_id: nil, ticket_url: nil, status: nil, token: nil, issuer_id: nil, installments: nil, items: nil, statement_descriptor: nil, error: nil, internal_error: nil, capture: nil, date_of_expiration: nil)
|
5
5
|
@id = id
|
6
6
|
@description = description
|
7
7
|
@date_approved = date_approved
|
@@ -11,6 +11,7 @@ module MpApi
|
|
11
11
|
@payer_identification_type = payer_identification_type
|
12
12
|
@payer_identification_number = payer_identification_number
|
13
13
|
@payment_method = payment_method
|
14
|
+
@last_four_digits = last_four_digits
|
14
15
|
@payment_type = payment_type
|
15
16
|
@qr_code = qr_code
|
16
17
|
@qr_code_base_64 = qr_code_base_64
|
@@ -106,6 +107,7 @@ module MpApi
|
|
106
107
|
payer_identification_type: json_response.dig("payer", "identification", "type"),
|
107
108
|
payer_identification_number: json_response.dig("payer", "identification", "number"),
|
108
109
|
payment_method: json_response.dig("payment_method_id"),
|
110
|
+
last_four_digits: json_response.dig("card", "last_four_digits"),
|
109
111
|
payment_type: json_response.dig("payment_type_id"),
|
110
112
|
qr_code: json_response.dig("point_of_interaction", "transaction_data", "qr_code"),
|
111
113
|
qr_code_base_64: json_response.dig("point_of_interaction", "transaction_data", "qr_code_base64"),
|
data/lib/mp_api/payment_error.rb
CHANGED
@@ -32,7 +32,8 @@ module MpApi
|
|
32
32
|
"cc_rejected_bad_filled_security_code" => "Pagamento recusado. Confira o código de segurança (CVV) do cartão.",
|
33
33
|
"cc_rejected_insufficient_amount" => "Pagamento recusado. Limite insuficiente.",
|
34
34
|
"cc_rejected_call_for_authorize" => "Pagamento recusado.",
|
35
|
-
"cc_rejected_other_reason" => "Pagamento recusado."
|
35
|
+
"cc_rejected_other_reason" => "Pagamento recusado.",
|
36
|
+
"cc_rejected_high_risk" => "Pagamento recusado."
|
36
37
|
}[status_detail]
|
37
38
|
end
|
38
39
|
|
data/lib/mp_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mp_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ac
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.5.10
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: ''
|