solidus_inter 0.0.1 → 1.0.0

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: 7c20812d9870dfa0ae087e0cec27ed902b67762ac634a5c43c1dd3ebf68245fd
4
- data.tar.gz: 9fd3d083b2e038f7f824bc3172af422bfbb4941d6ef4b14b311b8140150839b0
3
+ metadata.gz: 7e4f2ec4ad7b0a257eaeb36a071d1536ea55230179d9ed90fbaf91909f1c3fd0
4
+ data.tar.gz: b7f4db3f4c160512bf5666a5b303aa67217ebe1d1a821748954d6602c9338bc5
5
5
  SHA512:
6
- metadata.gz: e3265f529f8c1be4e788994d4cf6ae127691aba0991fcffc77184e6e043d83f5fed0c38407f7643591b5b3f2b8a10dc2e7d809deca5cffabee9576fdbb1b2e8f
7
- data.tar.gz: 9bd964dcd2df8d35cb7b226932c17c9479b6005209d04cd502b1f8b02214031bd7695954f3eb2e7ed64203f23c4fe95f2cad9c42292d92341f90671d802a53d9
6
+ metadata.gz: 429e23c494782d30cd07def008f905c628e80ec646d1d5ac0ffbebcc6a5c49dd1813974020f83607c3286e5870073cd5a97f9f6f0d4435bde03552843f0ff35f
7
+ data.tar.gz: 1775c4ccd206338334dbb9b6403406c4954f7781d1410ca91e479ab9ab12f58e8220ac4257c99d24c37c607fa28582da9d9f00d2b08da36f02a05b27d6493bde
data/README.md CHANGED
@@ -18,56 +18,3 @@ Bundle your dependencies and run the installation generator:
18
18
  ```shell
19
19
  bin/rails generate solidus_inter:install
20
20
  ```
21
-
22
- ## Usage
23
-
24
- <!-- Explain how to use your extension once it's been installed. -->
25
-
26
- ## Development
27
-
28
- ### Testing the extension
29
-
30
- First bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy
31
- app if it does not exist, then it will run specs. The dummy app can be regenerated by using
32
- `bin/rake extension:test_app`.
33
-
34
- ```shell
35
- bin/rake
36
- ```
37
-
38
- To run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run
39
-
40
- ```shell
41
- bundle exec rubocop
42
- ```
43
-
44
- When testing your application's integration with this extension you may use its factories.
45
- You can load Solidus core factories along with this extension's factories using this statement:
46
-
47
- ```ruby
48
- SolidusDevSupport::TestingSupport::Factories.load_for(SolidusInter::Engine)
49
- ```
50
-
51
- ### Running the sandbox
52
-
53
- To run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for
54
- the sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands to
55
- `sandbox/bin/rails`.
56
-
57
- Here's an example:
58
-
59
- ```
60
- $ bin/rails server
61
- => Booting Puma
62
- => Rails 6.0.2.1 application starting in development
63
- * Listening on tcp://127.0.0.1:3000
64
- Use Ctrl-C to stop
65
- ```
66
-
67
- ### Releasing new versions
68
-
69
- Please refer to the [dedicated page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) in the Solidus wiki.
70
-
71
- ## License
72
-
73
- Copyright (c) 2024 ulysses, released under the New BSD License.
@@ -33,7 +33,7 @@ module SolidusInter
33
33
  amount: payment.amount,
34
34
  payer_tax_id: payment.source.payer_tax_id,
35
35
  payer_name: payment.source.payer_name,
36
- expiration: 3000
36
+ expiration: 600
37
37
  )
38
38
  payment.response_code = inter_payment.txid
39
39
  payment.source.assign_attributes(
@@ -61,8 +61,7 @@ module SolidusInter
61
61
  end
62
62
 
63
63
  def purchase(money, source, options = {})
64
- client = set_api_client
65
- inter_payment = client.get_payment(source.txid)
64
+ inter_payment = find_payment(source.txid)
66
65
  if inter_payment.paid?
67
66
  source.update(status: "approved")
68
67
  successful_response("Pagamento realizado", inter_payment.txid)
@@ -71,6 +70,15 @@ module SolidusInter
71
70
  end
72
71
  end
73
72
 
73
+ def should_skip_processing?(source)
74
+ inter_payment = find_payment(source.txid)
75
+ if inter_payment.paid?
76
+ false
77
+ else
78
+ true
79
+ end
80
+ end
81
+
74
82
  private
75
83
 
76
84
  def set_api_client
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusInter
4
- VERSION = "0.0.1"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_inter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core