swiss-activemerchant 1.0.3 → 1.0.5

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: 0c66df163d153edf8a62f2395d9fae5f5c1b20a6795ff6fbb1f6f3cfc7482c43
4
- data.tar.gz: b227b14b4ec4b26058de6fd0c90565cf1bb76e01d80b4a1e25b4553823cf774f
3
+ metadata.gz: 1ca4e65b4371a17da4cf7850a83b7d893ac845ea182a2b51c392c5c84c501e5a
4
+ data.tar.gz: 68892e1f40dd978c6ee10c76d8b26cd040eafdd7a5b0089a0d6e26a93a41dd5d
5
5
  SHA512:
6
- metadata.gz: 22cda31d6b255520c3c01309e1353b1616d66f62c009d8af8b400e99bb5d0b25e5d53670b4ce64ba3b482b8bac779b4b3fda215a4c1660bf58ef484ebf6b0e38
7
- data.tar.gz: cc3136f9966f13cad62d10c1d6b7e9fa82191b952af2a26041fdae385bca0c638a6c93e2f68326810d4513c9fa8e2983a93c473e4b4250078d687c5656db3a3b
6
+ metadata.gz: 249a74b5d612fcd1d68eb3e3420dab33b5fe278fa1011a6efa21974d1b7a4ca3ff435924d190ac37b3f272780d3f1983d958488d10ad95e221d5d964c62ea423
7
+ data.tar.gz: d4fcad1ae822bde689ae32ebf728a37ae16e88ff45a5c7d559c7f8ff05b701146e8ff465869407669d22f481389950cf75dcd8acbaac9247982b626766dc38bd
@@ -241,14 +241,14 @@ module ActiveMerchant #:nodoc:
241
241
  end
242
242
 
243
243
  def success_from(response)
244
- response['msg'] == 'success'
244
+ response.dig('data', 'response') == 'approved'
245
245
  end
246
246
 
247
247
  def message_from(succeeded, response)
248
248
  if succeeded
249
249
  'Succeeded'
250
250
  else
251
- response['msg']
251
+ "#{response.dig('data', 'response')&.capitalize}-#{response.dig('data', 'response_body', "card", "processor_response_text")}"
252
252
  end
253
253
  end
254
254
 
@@ -3,7 +3,7 @@ require 'nokogiri'
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class IxopayGateway < Gateway
6
- self.test_url = 'https://secure.ixopay.com/transaction'
6
+ self.test_url = 'https://secure.cardflo.io/transaction'
7
7
  self.live_url = 'https://secure.ixopay.com/transaction'
8
8
 
9
9
  self.supported_countries = %w(AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW)
@@ -102,7 +102,7 @@ module ActiveMerchant #:nodoc:
102
102
 
103
103
  def generate_signature(http_method, xml, timestamp)
104
104
  content_type = 'text/xml; charset=utf-8'
105
- message = "#{http_method}\n#{Digest::MD5.hexdigest(xml)}\n#{content_type}\n#{timestamp}\n\n/transaction"
105
+ message = "#{http_method}\n#{Digest::SHA512.hexdigest(xml)}\n#{content_type}\n#{timestamp}\n\n/transaction"
106
106
  digest = OpenSSL::Digest.new('sha512')
107
107
  hmac = OpenSSL::HMAC.digest(digest, @secret, message)
108
108
 
@@ -118,7 +118,7 @@ module ActiveMerchant #:nodoc:
118
118
 
119
119
  def build_xml_request
120
120
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
121
- xml.transactionWithCard 'xmlns' => 'http://secure.ixopay.com/Schema/V2/TransactionWithCard' do
121
+ xml.transactionWithCard 'xmlns' => 'https://secure.cardflo.io/Schema/V2/TransactionWithCard' do
122
122
  xml.username @options[:username]
123
123
  xml.password Digest::SHA1.hexdigest(@options[:password])
124
124
  yield(xml)
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
151
151
  xml.amount localized_amount(money, currency)
152
152
  xml.currency currency
153
153
  xml.description description
154
- xml.callbackUrl(options[:callback_url])
154
+ xml.callbackUrl("https://www.google.com/")
155
155
  add_stored_credentials(xml, options)
156
156
  end
157
157
  end
@@ -281,12 +281,14 @@ module ActiveMerchant #:nodoc:
281
281
 
282
282
  def commit(request)
283
283
  url = (test? ? test_url : live_url)
284
-
284
+ url = "#{url}/#{options[:api_key]}/debit"
285
285
  # ssl_post raises an exception for any non-2xx HTTP status from the gateway
286
+ debugger
286
287
  response =
287
288
  begin
288
289
  parse(ssl_post(url, request, headers(request)))
289
290
  rescue StandardError => error
291
+ debugger
290
292
  parse(error.response.body)
291
293
  end
292
294
 
@@ -223,7 +223,6 @@ module ActiveMerchant #:nodoc:
223
223
  def add_customer_data(post, options)
224
224
  post[:email] = options[:email]
225
225
  post[:ipaddress] = options[:ip]
226
- post[:customer_id] = options[:customer_id] || options[:customer]
227
226
 
228
227
  if (billing_address = options[:billing_address] || options[:address])
229
228
  post[:company] = billing_address[:company]
@@ -247,6 +246,7 @@ module ActiveMerchant #:nodoc:
247
246
  post[:shipping_phone] = shipping_address[:phone]
248
247
  end
249
248
 
249
+ debugger
250
250
  if (descriptor = options[:descriptors])
251
251
  post[:descriptor] = options[:descriptor]
252
252
  post[:descriptor_phone] = descriptor[:descriptor_phone]
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swiss-activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-23 00:00:00.000000000 Z
11
+ date: 2024-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -499,7 +499,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
499
499
  - !ruby/object:Gem::Version
500
500
  version: '0'
501
501
  requirements: []
502
- rubygems_version: 3.4.10
502
+ rubygems_version: 3.3.7
503
503
  signing_key:
504
504
  specification_version: 4
505
505
  summary: Framework and tools for dealing with credit card transactions.