swiss-activemerchant 1.0.4 → 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: 6bd3579eaee17b94d1a9c93c8429cbb1c6caa89e4148f5d479554c0ea358815b
4
- data.tar.gz: fa466d146593b3123ca8ac0a1b1c78e1e50dc1c8506b61a85355f3948577ca93
3
+ metadata.gz: 1ca4e65b4371a17da4cf7850a83b7d893ac845ea182a2b51c392c5c84c501e5a
4
+ data.tar.gz: 68892e1f40dd978c6ee10c76d8b26cd040eafdd7a5b0089a0d6e26a93a41dd5d
5
5
  SHA512:
6
- metadata.gz: ad6a132123b62e98c1f6ecc55358814258d4bb38fc6dc8986f570f99e4de1207a985385d522cdee1f1167e7c2118d69cd0fd436ff0fe91f7e711c606733a11aa
7
- data.tar.gz: 9415403c023df61a4c97d2027e36c1d72e06e312fe9c2b1d8454bd0e7a66b1555797f815cc2b399620970ad7faccf6a374b22e403e51b9b7fc8d3802d20748a2
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
 
@@ -246,6 +246,7 @@ module ActiveMerchant #:nodoc:
246
246
  post[:shipping_phone] = shipping_address[:phone]
247
247
  end
248
248
 
249
+ debugger
249
250
  if (descriptor = options[:descriptors])
250
251
  post[:descriptor] = options[:descriptor]
251
252
  post[:descriptor_phone] = descriptor[:descriptor_phone]
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.0.4'
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.4
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-08-13 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