solidus_sicoob 0.0.2 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3485ae76c32819dba0b23a83ec37015966711204fbd778d1087065a3911f428e
4
- data.tar.gz: a02fe345338d32472553b30b584e4ff7b518084b372867544d09f03d6a51aac1
3
+ metadata.gz: c7fcf5044fe4d6d1f222b2b32e21b1c1e303095db40abc0649bed5c90f4584db
4
+ data.tar.gz: 19343e81cf137feeeca2ad983693c1546e73c0bcf24e80af503307eb0dfdf6a7
5
5
  SHA512:
6
- metadata.gz: 54370e45afa0180e80de232d4f4d2d80e993b08af90f18b1ad000fa4d3335ccdba317ff2c84b43d21dd574c6338b2e80bdaba42d5043ac78e510e8045b7c3fcb
7
- data.tar.gz: 333743a5c8372761112f2917db9021237ae14b4d652c56eb8a3d184dd560ee88f8620b137466cc2e8b4b8a3f8462782a93b03832d4b5393cbea08e0db3ccff94
6
+ metadata.gz: 55fab3f1438a118eb526f579045796a84f25687e293fb834dc5177e979ee2827213e6630b3b056c8422cee19e5665fe6a4948b251d8ffdb51c31b6bb6112c0fe
7
+ data.tar.gz: d4d6342d73b071398c580d9fb33603bad64dc339c1ea4fab6e5ece96603b10a01cba25214a9b3da493649d38b58719e069431aa206cfcdaf03fbbabf59cce925
@@ -8,8 +8,6 @@ module SolidusSicoob
8
8
  if sicoob_payment.paid?
9
9
  source.update(status: "approved", paid_amount: sicoob_payment.valor_pago, e2e_id: sicoob_payment.end_to_end_id)
10
10
  successful_response("Pagamento realizado", sicoob_payment.txid)
11
- else
12
- failure_response(sicoob_payment.internal_error || "Ocorreu um erro no pagamento.")
13
11
  end
14
12
  end
15
13
 
@@ -109,11 +109,7 @@ module SolidusSicoob
109
109
  expiration: sicoob_payment.expiracao
110
110
  )
111
111
 
112
- if sicoob_payment.internal_error
113
- handle_payment_error(payment, sicoob_payment)
114
- else
115
- update_payment_status(payment, sicoob_payment)
116
- end
112
+ update_payment_status(payment, sicoob_payment)
117
113
  end
118
114
 
119
115
  def update_payment_status(payment, inter_payment)
@@ -123,14 +119,6 @@ module SolidusSicoob
123
119
  payment.source.update(status: status)
124
120
  end
125
121
 
126
- def handle_payment_error(payment, inter_payment)
127
- payment.invalidate
128
- error_message = inter_payment.internal_error || "Erro ao criar o pagamento"
129
- response = failure_response(error_message)
130
- payment.log_entries.create(parsed_payment_response_details_with_fallback: response)
131
- payment.source.update(internal_error: error_message, status: "error")
132
- end
133
-
134
122
  def init_source(order)
135
123
  PixPaymentSource.new(
136
124
  amount: order.total,
@@ -147,11 +135,11 @@ module SolidusSicoob
147
135
  chave_pix: preferences[:chave_pix],
148
136
  crt: temp_file(preferences[:crt]).path,
149
137
  key: temp_file(preferences[:key]).path,
150
- token: account&.token,
138
+ access_token: account&.token,
151
139
  token_expires_at: account&.expires_at
152
140
  )
153
141
  SolidusSicoob::Account.upsert(
154
- {token: client.token, expires_at: client.token_expires_at, chave_pix: client.chave_pix,
142
+ {token: client.access_token, expires_at: client.token_expires_at, chave_pix: client.chave_pix,
155
143
  spree_payment_method_id: id}, unique_by: :chave_pix
156
144
  )
157
145
  client
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusSicoob
4
- VERSION = "0.0.2"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_sicoob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamilton
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-28 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: solidus_core
@@ -89,7 +88,6 @@ files:
89
88
  homepage: https://github.com/todasessascoisas/solidus_sicoob
90
89
  licenses: []
91
90
  metadata: {}
92
- post_install_message:
93
91
  rdoc_options: []
94
92
  require_paths:
95
93
  - lib
@@ -107,8 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
105
  - !ruby/object:Gem::Version
108
106
  version: '0'
109
107
  requirements: []
110
- rubygems_version: 3.5.10
111
- signing_key:
108
+ rubygems_version: 3.6.9
112
109
  specification_version: 4
113
110
  summary: ''
114
111
  test_files: []