solidus_mp 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 346ae15cf9f026b663c1e80a0d80be4794f33b9fbaa159ce5a5e2446ee9027ee
|
4
|
+
data.tar.gz: '08291d0c68af6ed01d8b0b56e7a23f0de37711b7ffae4a998d259edec9c62498'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ff886729a10a670f7909c01f89e8d79689c2fa6389c88d2921567d1fc745ab572c14109905a7bb268f235f7f07a0bb4f4fd087af05a59fcf815e2fb3b8ec1dd
|
7
|
+
data.tar.gz: 33771b61b3273ff0502c86fcf3e6f6d08c713242f4cc705aa463d9624f66300e7e5d6580f23726ab4d806d2d4426391080ba1c84537195b48f3cbcaf7fac768d
|
data/README.md
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
# Solidus Bling
|
2
2
|
|
3
|
-
[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_bling.svg?style=shield)](https://circleci.com/gh/solidusio-contrib/solidus_bling)
|
4
|
-
[![codecov](https://codecov.io/gh/solidusio-contrib/solidus_bling/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio-contrib/solidus_bling)
|
5
|
-
|
6
|
-
<!-- Explain what your extension does. -->
|
7
|
-
|
8
3
|
## Installation
|
9
4
|
|
10
5
|
Add solidus_bling to your Gemfile:
|
@@ -22,9 +17,6 @@ bin/rails generate solidus_mp:install
|
|
22
17
|
```shell
|
23
18
|
bin/rails assets:precompile
|
24
19
|
```
|
25
|
-
|
26
|
-
## Usage
|
27
|
-
|
28
20
|
## License
|
29
21
|
|
30
22
|
Copyright (c) 2023 ulysses-bull, released under the New BSD License.
|
@@ -18,20 +18,13 @@ module SolidusMp
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_api_payment payment
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
payment.invalidate
|
29
|
-
end
|
30
|
-
rescue MpApi::TooManyRequestsError
|
31
|
-
payment.invalidate
|
32
|
-
rescue MpApi::RequestError
|
33
|
-
payment.invalidate
|
34
|
-
end
|
21
|
+
MpApi.configuration.access_token = preferences[:access_token]
|
22
|
+
MpApi::Payment.new(amount: payment.amount.to_f, payment_method: payment.source.credit_card_brand, payer_email: payment.source.email, payer_identification_type: payment.source.payer_identification_type, payer_identification_number: payment.source.tax_id, token: payment.source.token, issuer_id: payment.source.issuer_id, installments: payment.source.installments, three_d_secure_mode: true, statement_descriptor: payment.source.statement_descriptor, description: payment.source.description, items: payment.source.items).create
|
23
|
+
end
|
24
|
+
|
25
|
+
def cancel_payment payment
|
26
|
+
MpApi.configuration.access_token = preferences[:access_token]
|
27
|
+
MpApi::Payment.find_by_id(payment.source.external_id).update(status: "cancelled")
|
35
28
|
end
|
36
29
|
|
37
30
|
def authorize(money, source, options = {})
|
@@ -18,15 +18,13 @@ module SolidusMp
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_api_payment payment
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
payment.invalidate
|
29
|
-
end
|
21
|
+
MpApi.configuration.access_token = preferences[:access_token]
|
22
|
+
MpApi::Payment.new(payer_email: payment.source.email, payer_identification_type: "CPF", payment_method: "pix", payer_identification_number: payment.source.tax_id, amount: payment.amount.to_f, statement_descriptor: payment.source.statement_descriptor, description: payment.source.description, items: payment.source.items).create
|
23
|
+
end
|
24
|
+
|
25
|
+
def cancel_payment payment
|
26
|
+
MpApi.configuration.access_token = preferences[:access_token]
|
27
|
+
MpApi::Payment.find_by_id(payment.source.external_id).update(status: "cancelled")
|
30
28
|
end
|
31
29
|
|
32
30
|
def authorize(money, source, options = {})
|
data/lib/solidus_mp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_mp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- db/migrate/20231205142931_create_solidus_mp_card_payment_sources.rb
|
114
114
|
- db/migrate/20231221130457_add_items_to_mp_pix.rb
|
115
115
|
- db/migrate/20231221141935_add_items_to_mp_card.rb
|
116
|
+
- db/migrate/20240105143500_add_status_to_payment_source.rb
|
116
117
|
- lib/generators/solidus_mp/install/install_generator.rb
|
117
118
|
- lib/generators/solidus_mp/install/templates/app/javascript/controllers/credit_card_controller.js
|
118
119
|
- lib/generators/solidus_mp/install/templates/app/javascript/controllers/three_ds_controller.js
|