viva_wallet 0.2.1 → 0.3.2

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: 6bf02afe529b2fd0e38184e4c1d6271b4b8aa4d58218ef003c52f7c62b672d70
4
- data.tar.gz: fd05d55df0f7db50aed301bfc793d73d4319d8d3bc9063ef0901b59214c59264
3
+ metadata.gz: 4aba30b8d87819c4f6fd2c654f6b6e638fc4688d6f71c3a67360d68a97416e61
4
+ data.tar.gz: 2b653343fd8a1cb7cb959e0222084fdfa09df34eb368bbbf2098ea3360f25502
5
5
  SHA512:
6
- metadata.gz: f50e1629f13eaea0a8f0f253b7fd45f36c99e652ccd1c2229968f2b1ae69b1bf32f1dc580d6659c1c88fe5b5d88007c34ecd680bd293065d70724419644caf27
7
- data.tar.gz: f8774f93261fb3f2cd9c6e46dcef6cf9fd1ddf0ec43978212fb2d1866782464e8d8123ee65d6588ea95cbebb3498928c77cb67c17bd4804a4c40977cf2ae0c92
6
+ metadata.gz: 69189aee3118baee4d59e9638b2f445162fd4990356a1573ded7a16a3460c6e3af4dfa9b00af844f639ac7619b2a16c4a998e4b8bb42db073005ede319ff478e
7
+ data.tar.gz: 8d5b5678e35d9b5f3027007c237b57a57cf799602b227df52f17815551988cee69228140ff32b5b57aa94edcb4808c029c6f5fbda3cc61fdf2c1aec455652fdf
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VivaWallet
4
+ class Payment
5
+
6
+ class << self
7
+
8
+ def retrieve(event_id)
9
+ case event_id.to_i
10
+ when 0
11
+ { reason: 'Undefined', explanation: 'System', type: 'System' }
12
+ when 2061
13
+ { reason: '3DS flow incomplete', explanation: 'Browser closed before authentication finished.', type: 'User' }
14
+ when 2062
15
+ { reason: '3DS validation failed', explanation: 'Wrong password or two-factor auth code entered.', type: 'User' }
16
+ when 2108
17
+ { reason: 'Payments Policy Acquiring Restriction', explanation: 'Payments Policy Acquiring Restriction.', type: 'System' }
18
+ when 10001
19
+ { reason: 'Refer to card issuer', explanation: 'The issuing bank prevented the transaction.', type: 'Issuer' }
20
+ when 10003
21
+ { reason: 'Invalid merchant number', explanation: 'Security violation (source is not correct issuer).', type: 'Issuer' }
22
+ when 10004
23
+ { reason: 'Pick up card', explanation: 'The card has been designated as lost or stolen.', type: 'Issuer' }
24
+ when 10005
25
+ { reason: 'Do not honor', explanation: 'The issuing bank declined the transaction without an explanation.', type: 'Issuer' }
26
+ when 10006
27
+ { reason: 'General error', explanation: 'The card issuer has declined the transaction as there is a problem with the card number.', type: 'Issuer' }
28
+ when 10012
29
+ { reason: 'Invalid transaction', explanation: 'The bank has declined the transaction because of an invalid format or field. This indicates the card details were incorrect.', type: 'Issuer' }
30
+ when 10013
31
+ { reason: 'Invalid amount', explanation: 'The card issuer has declined the transaction because of an invalid format or field.', type: 'System' }
32
+ when 10014
33
+ { reason: 'Invalid card number', explanation: 'The card issuer has declined the transaction as the credit card number is incorrectly entered or does not exist.', type: 'User' }
34
+ when 10015
35
+ { reason: 'Invalid issuer', explanation: 'The card issuer doesn\'t exist.', type: 'System' }
36
+ when 10030
37
+ { reason: 'Format error', explanation: 'The card issuer does not recognise the transaction details being entered. This is due to a format error.', type: 'System' }
38
+ when 10041
39
+ { reason: 'Lost card', explanation: 'The card issuer has declined the transaction as the card has been reported lost.', type: 'System' }
40
+ when 10043
41
+ { reason: 'Stolen card', explanation: 'The card has been designated as lost or stolen.', type: 'User' }
42
+ when 10051
43
+ { reason: 'Insufficient funds', explanation: 'The card has insufficient funds to cover the cost of the transaction.', type: 'Issuer' }
44
+ when 10054
45
+ { reason: 'Expired card', explanation: 'The payment gateway declined the transaction because the expiration date is expired or does not match.', type: 'User' }
46
+ when 10057
47
+ { reason: 'Function not permitted to cardholder', explanation: 'The card issuer has declined the transaction as the credit card cannot be used for this type of transaction.', type: 'Issuer' }
48
+ when 10058
49
+ { reason: 'Function not permitted to terminal', explanation: 'The card issuer has declined the transaction as the credit card cannot be used for this type of transaction.', type: 'Issuer' }
50
+ when 10061
51
+ { reason: 'Withdrawal limit exceeded', explanation: 'Exceeds withdrawal amount limit.', type: 'Issuer' }
52
+ when 10062
53
+ { reason: 'Restricted card', explanation: 'The customer\'s bank has declined their card.', type: 'Issuer' }
54
+ when 10063
55
+ { reason: 'Issuer response security violation', explanation: 'Flag raised due to security validation problem.', type: 'Issuer' }
56
+ when 10065
57
+ { reason: 'Soft decline', explanation: 'The issuer requests Strong Customer Authentication. The merchant should retry the transaction after successfully authenticating customer with 3DS first.', type: 'Issuer' }
58
+ when 10070
59
+ { reason: 'Call issuer', explanation: 'Contact card issuer.', type: 'Issuer' }
60
+ when 10075
61
+ { reason: 'PIN entry tries exceeded', explanation: 'Allowable number of PIN tries exceeded.', type: 'User' }
62
+ when 10076
63
+ { reason: 'Invalid / non-existent "to account" specified', explanation: 'Invalid / non-existent OR Invalid / non-existent specified.', type: 'System' }
64
+ when 10096
65
+ { reason: 'System malfunction', explanation: 'A temporary error occurred during the transaction.', type: 'System' }
66
+ when 10200
67
+ { reason: 'Generic error', explanation: 'A temporary error occurred during the transaction.', type: 'System' }
68
+ when 10301
69
+ { reason: 'Soft decline', explanation: 'The issuer requests Strong Customer Authentication. The merchant should retry the transaction after successfully authenticating customer with 3DS first.', type: 'Issuer' }
70
+ else
71
+ { reason: 'Unknown error', explanation: 'Viva Wallet was unable to supply an error reason.', type: 'System' }
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VivaWallet
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.2"
5
5
  end
data/lib/viva_wallet.rb CHANGED
@@ -5,6 +5,7 @@ require 'base64'
5
5
 
6
6
  require_relative "viva_wallet/version"
7
7
  require_relative 'viva_wallet/authentication'
8
+ require_relative 'viva_wallet/event'
8
9
  require_relative 'viva_wallet/payment'
9
10
 
10
11
  module VivaWallet
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viva_wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Dallimore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-10 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -50,6 +50,7 @@ files:
50
50
  - bin/setup
51
51
  - lib/viva_wallet.rb
52
52
  - lib/viva_wallet/authentication.rb
53
+ - lib/viva_wallet/event.rb
53
54
  - lib/viva_wallet/payment.rb
54
55
  - lib/viva_wallet/version.rb
55
56
  - viva_wallet.gemspec