solidus_six_saferpay 0.1.1 → 0.1.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: 62b084c8228f6b7536f8a6344b228449d76139957232c22ed9a113228d0a4a82
4
- data.tar.gz: b7840dadd009148e4ac91cebedd8f6b37cd2420a4b5a946cf235a6388bd1dca3
3
+ metadata.gz: ccb5b89d37a205f093576ec9a755e3fbc54d362fc45010fc5c7164b699810583
4
+ data.tar.gz: b115f124017c811c3fd2964dbd26d86a74c4cc74e9a934014d81a1a96ce6561e
5
5
  SHA512:
6
- metadata.gz: 7b98d5ab6de7bfc969dacb92a286cb91119145151f3941e22351b5ae348e09c9f5e7dc94002de8103d45457a88443ac626aa893e523d3c7762e932adc7976b1e
7
- data.tar.gz: 9565a255da9145c861eefa07ea8066a83e081e26e169d27808d6dc6ce9d11b765009d11378823dff942bb8e4c244381c6a02f52d4b9dac2b4996a198c16297f8
6
+ metadata.gz: 17b439ff9f469106de99a5f8dd4060fecd786525580b9f04f5d5f5ce9b26c32fc92138725457c836297f579d3208daa30f6768b5fe3acfb35fc7c5a1fdc860fc
7
+ data.tar.gz: 69d2115b15b049ab4d27e680c8d2169fcb2db70ebde4c0402424ff47924fcbb7adc97a941e82d9494c0981b550f446476133895f43102c8033fadc630be04aa3
@@ -18,9 +18,7 @@ let SaferpayPayment = {
18
18
  },
19
19
 
20
20
  error: function(xhr) {
21
- // debugger;
22
- alert(xhr.responseText);
23
- console.info(xhr.responseText);
21
+ console.error(xhr.responseText);
24
22
  return false;
25
23
  },
26
24
  })
@@ -19,7 +19,7 @@
19
19
  }
20
20
 
21
21
  @keyframes sk-scaleout {
22
- 0% {
22
+ 0% {
23
23
  -webkit-transform: scale(0);
24
24
  transform: scale(0);
25
25
  } 100% {
@@ -1,10 +1,8 @@
1
1
  .saferpay-payment {
2
2
  &.void {
3
-
4
3
  .amount {
5
4
  text-decoration: line-through;
6
5
  }
7
6
  }
8
7
  }
9
8
 
10
-
@@ -30,40 +30,53 @@ module Spree
30
30
  @address ||= order.bill_address
31
31
  end
32
32
 
33
+ # This memoization only works if response_payment_means is not nil.
33
34
  def payment_means
34
- @payment_means ||= ::SixSaferpay::ResponsePaymentMeans.new(response_hash[:payment_means])
35
+ @payment_means ||= begin
36
+ if payment_means_response = response_hash[:payment_means]
37
+ ::SixSaferpay::ResponsePaymentMeans.new(payment_means_response)
38
+ end
39
+ end
35
40
  end
36
41
 
37
42
  def transaction
38
- @transaction ||= ::SixSaferpay::Transaction.new(response_hash[:transaction])
43
+ @transaction ||= begin
44
+ if transaction_response = response_hash[:transaction]
45
+ ::SixSaferpay::Transaction.new(transaction_response)
46
+ end
47
+ end
39
48
  end
40
49
 
41
50
  def liability
42
- @liability ||= ::SixSaferpay::Liability.new(response_hash[:liability])
51
+ @liability ||= begin
52
+ if liability_response = response_hash[:liability]
53
+ ::SixSaferpay::Liability.new(liability_response)
54
+ end
55
+ end
43
56
  end
44
57
 
45
58
  def card
46
- payment_means.card
59
+ payment_means&.card
47
60
  end
48
61
 
49
62
  def name
50
- card.holder_name
63
+ card&.holder_name
51
64
  end
52
65
 
53
66
  def brand_name
54
- payment_means.brand.name
67
+ payment_means&.brand&.name
55
68
  end
56
69
 
57
70
  def month
58
- card.exp_month
71
+ card&.exp_month
59
72
  end
60
73
 
61
74
  def year
62
- card.exp_year
75
+ card&.exp_year
63
76
  end
64
77
 
65
78
  def icon_name
66
- payment_means.brand.payment_method.downcase
79
+ payment_means&.brand&.payment_method&.downcase
67
80
  end
68
81
  end
69
82
  end
@@ -25,7 +25,7 @@ module Spree
25
25
  specific_error = I18n.t(inquiry.error_name, scope: [:six_saferpay, :error_names])
26
26
  @user_message = "#{general_error}: #{specific_error}"
27
27
  end
28
-
28
+
29
29
  @success = true
30
30
 
31
31
  self
@@ -28,7 +28,6 @@ module Spree
28
28
 
29
29
  rescue ::SolidusSixSaferpay::InvalidSaferpayPayment => e
30
30
  cancel_saferpay_payment
31
- # TODO: Check if messages from liability shift check and PaymentValidator are appropriate for user!
32
31
  @user_message = e.full_message
33
32
  @success = false
34
33
 
@@ -20,7 +20,7 @@ module SolidusSixSaferpay
20
20
  # To ensure that solidus sets the response_code after successful capture,
21
21
  # we need to pass it as an "authorization", however if we do this then
22
22
  # solidus also expects there to be an "avs_result"
23
- #
23
+ #
24
24
  # see https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment/processing.rb#L171
25
25
  def avs_result
26
26
  {}
@@ -29,7 +29,7 @@ module SolidusSixSaferpay
29
29
  # To ensure that solidus sets the response_code after successful capture,
30
30
  # we need to pass it as an "authorization", however if we do this then
31
31
  # solidus also expects this response to respond to :cvv_result
32
- #
32
+ #
33
33
  # see https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment/processing.rb#L171
34
34
  def cvv_result
35
35
  nil
@@ -1,3 +1,3 @@
1
1
  module SolidusSixSaferpay
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_six_saferpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Kiener
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-19 00:00:00.000000000 Z
11
+ date: 2019-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.1'
75
+ version: '2.2'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.1'
82
+ version: '2.2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: sqlite3
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -245,9 +245,6 @@ files:
245
245
  - app/controllers/spree/solidus_six_saferpay/checkout_controller.rb
246
246
  - app/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller.rb
247
247
  - app/controllers/spree/solidus_six_saferpay/transaction/checkout_controller.rb
248
- - app/helpers/solidus_six_saferpay/application_helper.rb
249
- - app/jobs/solidus_six_saferpay/application_job.rb
250
- - app/mailers/solidus_six_saferpay/application_mailer.rb
251
248
  - app/models/solidus_six_saferpay/application_record.rb
252
249
  - app/models/spree/payment_method/saferpay_payment_method.rb
253
250
  - app/models/spree/payment_method/saferpay_payment_page.rb
@@ -291,7 +288,6 @@ files:
291
288
  - lib/solidus_six_saferpay/payment_page_gateway.rb
292
289
  - lib/solidus_six_saferpay/transaction_gateway.rb
293
290
  - lib/solidus_six_saferpay/version.rb
294
- - lib/tasks/solidus_six_saferpay_tasks.rake
295
291
  homepage: http://fadendaten.ch
296
292
  licenses:
297
293
  - MIT
@@ -1,4 +0,0 @@
1
- module SolidusSixSaferpay
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module SolidusSixSaferpay
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
@@ -1,6 +0,0 @@
1
- module SolidusSixSaferpay
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
5
- end
6
- end
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :solidus_six_saferpay do
3
- # # Task goes here
4
- # end