judopay 2.1.0 → 2.1.3
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 +5 -5
- data/.gitignore +24 -23
- data/.rspec +1 -1
- data/.rubocop.yml +54 -51
- data/.travis.yml +6 -6
- data/CHANGELOG.md +17 -17
- data/Gemfile +4 -4
- data/LICENSE +21 -21
- data/README.md +96 -94
- data/Rakefile +22 -22
- data/judopay.gemspec +38 -38
- data/lib/certs/digicert_sha256_ca.pem +49 -49
- data/lib/certs/rapidssl_ca.crt +63 -63
- data/lib/faraday/judo_mashify.rb +11 -11
- data/lib/faraday/raise_http_exception.rb +19 -19
- data/lib/judopay.rb +70 -70
- data/lib/judopay/api.rb +10 -10
- data/lib/judopay/connection.rb +77 -77
- data/lib/judopay/core_ext/hash.rb +29 -29
- data/lib/judopay/core_ext/string.rb +32 -32
- data/lib/judopay/error.rb +117 -115
- data/lib/judopay/mash.rb +11 -11
- data/lib/judopay/model.rb +134 -134
- data/lib/judopay/models/android_payment.rb +26 -26
- data/lib/judopay/models/android_preauth.rb +8 -8
- data/lib/judopay/models/apple_payment.rb +26 -26
- data/lib/judopay/models/apple_preauth.rb +9 -9
- data/lib/judopay/models/card_address.rb +11 -11
- data/lib/judopay/models/card_payment.rb +33 -33
- data/lib/judopay/models/card_preauth.rb +11 -11
- data/lib/judopay/models/collection.rb +16 -16
- data/lib/judopay/models/encrypt_details.rb +18 -0
- data/lib/judopay/models/inner/pk_payment.rb +17 -17
- data/lib/judopay/models/inner/pk_payment_token.rb +13 -13
- data/lib/judopay/models/inner/transmitted_field.rb +39 -39
- data/lib/judopay/models/inner/wallet.rb +30 -30
- data/lib/judopay/models/market/collection.rb +10 -10
- data/lib/judopay/models/market/payment.rb +10 -10
- data/lib/judopay/models/market/preauth.rb +10 -10
- data/lib/judopay/models/market/refund.rb +10 -10
- data/lib/judopay/models/market/transaction.rb +10 -10
- data/lib/judopay/models/one_use_token_payment.rb +29 -0
- data/lib/judopay/models/payment.rb +8 -8
- data/lib/judopay/models/preauth.rb +8 -8
- data/lib/judopay/models/refund.rb +16 -16
- data/lib/judopay/models/register_card.rb +27 -27
- data/lib/judopay/models/save_card.rb +24 -25
- data/lib/judopay/models/token_payment.rb +30 -30
- data/lib/judopay/models/token_preauth.rb +10 -10
- data/lib/judopay/models/transaction.rb +8 -8
- data/lib/judopay/models/void.rb +19 -19
- data/lib/judopay/models/web_payments/payment.rb +28 -28
- data/lib/judopay/models/web_payments/preauth.rb +10 -10
- data/lib/judopay/models/web_payments/transaction.rb +19 -19
- data/lib/judopay/models/web_payments/web_payment_operation.rb +8 -8
- data/lib/judopay/null_logger.rb +9 -11
- data/lib/judopay/request.rb +50 -50
- data/lib/judopay/response.rb +7 -7
- data/lib/judopay/serializer.rb +27 -27
- data/lib/judopay/version.rb +4 -4
- data/spec/factories.rb +227 -208
- data/spec/faraday/response_spec.rb +27 -27
- data/spec/fixtures/card_payments/create.json +21 -21
- data/spec/fixtures/card_payments/create_3dsecure.json +7 -7
- data/spec/fixtures/card_payments/create_bad_request.json +12 -12
- data/spec/fixtures/card_payments/create_declined.json +23 -23
- data/spec/fixtures/card_payments/validate.json +4 -4
- data/spec/fixtures/token_payments/create.json +21 -21
- data/spec/fixtures/transactions/all.json +237 -237
- data/spec/fixtures/transactions/android_payment.json +26 -26
- data/spec/fixtures/transactions/apple_payment.json +26 -26
- data/spec/fixtures/transactions/find.json +22 -22
- data/spec/fixtures/transactions/find_not_found.json +4 -4
- data/spec/fixtures/transactions/register_card.json +28 -28
- data/spec/fixtures/transactions/save_card.json +27 -27
- data/spec/fixtures/transactions/void.json +26 -26
- data/spec/fixtures/web_payments/payments/create.json +3 -3
- data/spec/fixtures/web_payments/payments/find.json +38 -38
- data/spec/judopay/android_payment_spec.rb +74 -74
- data/spec/judopay/apple_payment_spec.rb +80 -80
- data/spec/judopay/card_address_spec.rb +10 -10
- data/spec/judopay/card_payment_spec.rb +51 -63
- data/spec/judopay/card_preauth_spec.rb +35 -35
- data/spec/judopay/collection_spec.rb +26 -26
- data/spec/judopay/core_ext/hash_spec.rb +24 -24
- data/spec/judopay/core_ext/string_spec.rb +16 -16
- data/spec/judopay/error_spec.rb +70 -70
- data/spec/judopay/judopay_spec.rb +19 -19
- data/spec/judopay/market/collection_spec.rb +26 -26
- data/spec/judopay/market/payment_spec.rb +14 -14
- data/spec/judopay/market/preauth_spec.rb +14 -14
- data/spec/judopay/market/refund_spec.rb +26 -26
- data/spec/judopay/market/transaction_spec.rb +14 -14
- data/spec/judopay/payment_spec.rb +14 -14
- data/spec/judopay/preauth_spec.rb +14 -14
- data/spec/judopay/refund_spec.rb +26 -26
- data/spec/judopay/register_card_spec.rb +24 -24
- data/spec/judopay/save_card_spec.rb +23 -23
- data/spec/judopay/token_payment_spec.rb +22 -22
- data/spec/judopay/token_preauth_spec.rb +22 -22
- data/spec/judopay/transaction_spec.rb +51 -51
- data/spec/judopay/void_spec.rb +24 -24
- data/spec/judopay/web_payments/payment_spec.rb +16 -16
- data/spec/judopay/web_payments/preauth_spec.rb +16 -16
- data/spec/judopay/web_payments/transaction_spec.rb +15 -15
- data/spec/spec_helper.rb +41 -41
- data/test/additions_payment_test.rb +30 -0
- data/test/authentication_test.rb +23 -23
- data/test/base/integration_base.rb +20 -20
- data/test/base/payments_tests.rb +47 -47
- data/test/base/token_payment_tests.rb +98 -98
- data/test/card_details_test.rb +21 -21
- data/test/configuration_test.rb +35 -35
- data/test/helper/assertion_helper.rb +29 -29
- data/test/payment_test.rb +10 -10
- data/test/preauth_test.rb +10 -10
- data/test/register_card_test.rb +42 -42
- data/test/save_card_test.rb +23 -0
- data/test/token_payment_test.rb +10 -10
- data/test/token_preauth_test.rb +10 -10
- data/test/void_test.rb +45 -45
- metadata +18 -12
data/lib/judopay/mash.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'hashie'
|
2
|
-
|
3
|
-
module Judopay
|
4
|
-
class Mash < ::Hashie::Mash
|
5
|
-
protected
|
6
|
-
|
7
|
-
def convert_key(key)
|
8
|
-
key.to_s.underscore
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
require 'hashie'
|
2
|
+
|
3
|
+
module Judopay
|
4
|
+
class Mash < ::Hashie::Mash
|
5
|
+
protected
|
6
|
+
|
7
|
+
def convert_key(key)
|
8
|
+
key.to_s.underscore
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/judopay/model.rb
CHANGED
@@ -1,134 +1,134 @@
|
|
1
|
-
require 'addressable/uri'
|
2
|
-
require 'virtus'
|
3
|
-
require 'active_model'
|
4
|
-
require_relative 'core_ext/hash'
|
5
|
-
require_relative 'error'
|
6
|
-
|
7
|
-
module Judopay
|
8
|
-
# Base model for Judopay API model objects
|
9
|
-
class Model
|
10
|
-
send :include, Virtus.model
|
11
|
-
include ActiveModel::Validations
|
12
|
-
VALID_PAGING_OPTIONS = [:sort, :offset, :page_size].freeze
|
13
|
-
|
14
|
-
class << self
|
15
|
-
@resource_path = nil
|
16
|
-
@valid_api_methods = []
|
17
|
-
attr_accessor :resource_path, :valid_api_methods
|
18
|
-
|
19
|
-
# List all records
|
20
|
-
#
|
21
|
-
# @param options [Hash] Paging options (sort, offset and page_size)
|
22
|
-
# @return [Judopay::Mash] Mash of the API response
|
23
|
-
def all(options = {})
|
24
|
-
check_api_method_is_supported(__method__)
|
25
|
-
api = Judopay::API.new
|
26
|
-
valid_options = self.valid_options(options).camel_case_keys!
|
27
|
-
uri = resource_path + '?' + valid_options.to_query_string
|
28
|
-
api.get(uri)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Retrieve a specific record
|
32
|
-
#
|
33
|
-
# @param receipt_id [Integer] ID of particular transaction
|
34
|
-
# @return [Judopay::Mash] Mash of the API response
|
35
|
-
def find(receipt_id)
|
36
|
-
check_api_method_is_supported(__method__)
|
37
|
-
api = Judopay::API.new
|
38
|
-
api.get(resource_path + receipt_id.to_i.to_s)
|
39
|
-
end
|
40
|
-
|
41
|
-
# Check if the specified API method is supported by the current model
|
42
|
-
#
|
43
|
-
# @raise [Judopay::Error] if the API method is not supported
|
44
|
-
def check_api_method_is_supported(method)
|
45
|
-
raise Judopay::ValidationError, 'API method not supported' if valid_api_methods.nil? || !valid_api_methods.include?(method.to_sym)
|
46
|
-
end
|
47
|
-
|
48
|
-
# Take an paging options hash and filter all but the valid keys
|
49
|
-
def valid_options(options)
|
50
|
-
valid_options = {}
|
51
|
-
options.each do |key, value|
|
52
|
-
next unless VALID_PAGING_OPTIONS.include?(key)
|
53
|
-
valid_options[key] = value
|
54
|
-
end
|
55
|
-
valid_options
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# Create a new record
|
60
|
-
#
|
61
|
-
# @return [Judopay::Mash] Mash of the API response
|
62
|
-
def create
|
63
|
-
check_api_method_is_supported(__method__)
|
64
|
-
check_judo_id
|
65
|
-
check_validation
|
66
|
-
api = Judopay::API.new
|
67
|
-
api.post(resource_path, self)
|
68
|
-
end
|
69
|
-
|
70
|
-
# Validates a request
|
71
|
-
#
|
72
|
-
# @return [Judopay::Mash] Mash of the API response
|
73
|
-
def validate
|
74
|
-
check_api_method_is_supported(__method__)
|
75
|
-
check_judo_id
|
76
|
-
check_validation
|
77
|
-
api = Judopay::API.new
|
78
|
-
api.post(resource_path + '/validate', self)
|
79
|
-
end
|
80
|
-
|
81
|
-
# Retrieve the current API resource path (e.g. /transactions/payments)
|
82
|
-
#
|
83
|
-
# @return [String] Resource path
|
84
|
-
def resource_path
|
85
|
-
self.class.resource_path
|
86
|
-
end
|
87
|
-
|
88
|
-
# Retrieve an array of valid API methods for the current model
|
89
|
-
# e.g [:find, :create]
|
90
|
-
#
|
91
|
-
# @return [Array<Symbol>] Valid API methods
|
92
|
-
def valid_api_methods
|
93
|
-
self.class.valid_api_methods
|
94
|
-
end
|
95
|
-
|
96
|
-
# Verify if an API method is supported for the current model
|
97
|
-
def check_api_method_is_supported(method)
|
98
|
-
self.class.check_api_method_is_supported(method)
|
99
|
-
end
|
100
|
-
|
101
|
-
# Use judo_id from configuration if it hasn't been explicitly set
|
102
|
-
def check_judo_id
|
103
|
-
return unless respond_to?('judo_id') && judo_id.nil?
|
104
|
-
self.judo_id = Judopay.configuration.judo_id
|
105
|
-
end
|
106
|
-
|
107
|
-
protected
|
108
|
-
|
109
|
-
# Has the pre-validation found any problems?
|
110
|
-
# We check the basics have been completed to avoid round trip to API
|
111
|
-
#
|
112
|
-
# @return nil
|
113
|
-
# @raise [Judopay::ValidationError] if there are validation errors on the model
|
114
|
-
def check_validation
|
115
|
-
raise Judopay::ValidationError.new('Missing required fields', errors) unless valid?
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
module ActiveModel
|
121
|
-
module Validations
|
122
|
-
module ClassMethods
|
123
|
-
def validate_nested_model(*attr_names)
|
124
|
-
validates_with BlockValidator, _merge_attributes(attr_names) do |model, attr, value|
|
125
|
-
if value.is_a?(Judopay::Model) && !value.valid?
|
126
|
-
value.errors.each { |field, message| model.errors["#{attr}.#{field}"] = message }
|
127
|
-
elsif !value.is_a?(Judopay::Model)
|
128
|
-
model.errors[attr] = 'should be valid Model object'
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
1
|
+
require 'addressable/uri'
|
2
|
+
require 'virtus'
|
3
|
+
require 'active_model'
|
4
|
+
require_relative 'core_ext/hash'
|
5
|
+
require_relative 'error'
|
6
|
+
|
7
|
+
module Judopay
|
8
|
+
# Base model for Judopay API model objects
|
9
|
+
class Model
|
10
|
+
send :include, Virtus.model
|
11
|
+
include ActiveModel::Validations
|
12
|
+
VALID_PAGING_OPTIONS = [:sort, :offset, :page_size].freeze
|
13
|
+
|
14
|
+
class << self
|
15
|
+
@resource_path = nil
|
16
|
+
@valid_api_methods = []
|
17
|
+
attr_accessor :resource_path, :valid_api_methods
|
18
|
+
|
19
|
+
# List all records
|
20
|
+
#
|
21
|
+
# @param options [Hash] Paging options (sort, offset and page_size)
|
22
|
+
# @return [Judopay::Mash] Mash of the API response
|
23
|
+
def all(options = {})
|
24
|
+
check_api_method_is_supported(__method__)
|
25
|
+
api = Judopay::API.new
|
26
|
+
valid_options = self.valid_options(options).camel_case_keys!
|
27
|
+
uri = resource_path + '?' + valid_options.to_query_string
|
28
|
+
api.get(uri)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Retrieve a specific record
|
32
|
+
#
|
33
|
+
# @param receipt_id [Integer] ID of particular transaction
|
34
|
+
# @return [Judopay::Mash] Mash of the API response
|
35
|
+
def find(receipt_id)
|
36
|
+
check_api_method_is_supported(__method__)
|
37
|
+
api = Judopay::API.new
|
38
|
+
api.get(resource_path + receipt_id.to_i.to_s)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Check if the specified API method is supported by the current model
|
42
|
+
#
|
43
|
+
# @raise [Judopay::Error] if the API method is not supported
|
44
|
+
def check_api_method_is_supported(method)
|
45
|
+
raise Judopay::ValidationError, 'API method not supported' if valid_api_methods.nil? || !valid_api_methods.include?(method.to_sym)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Take an paging options hash and filter all but the valid keys
|
49
|
+
def valid_options(options)
|
50
|
+
valid_options = {}
|
51
|
+
options.each do |key, value|
|
52
|
+
next unless VALID_PAGING_OPTIONS.include?(key)
|
53
|
+
valid_options[key] = value
|
54
|
+
end
|
55
|
+
valid_options
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Create a new record
|
60
|
+
#
|
61
|
+
# @return [Judopay::Mash] Mash of the API response
|
62
|
+
def create
|
63
|
+
check_api_method_is_supported(__method__)
|
64
|
+
check_judo_id
|
65
|
+
check_validation
|
66
|
+
api = Judopay::API.new
|
67
|
+
api.post(resource_path, self)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Validates a request
|
71
|
+
#
|
72
|
+
# @return [Judopay::Mash] Mash of the API response
|
73
|
+
def validate
|
74
|
+
check_api_method_is_supported(__method__)
|
75
|
+
check_judo_id
|
76
|
+
check_validation
|
77
|
+
api = Judopay::API.new
|
78
|
+
api.post(resource_path + '/validate', self)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Retrieve the current API resource path (e.g. /transactions/payments)
|
82
|
+
#
|
83
|
+
# @return [String] Resource path
|
84
|
+
def resource_path
|
85
|
+
self.class.resource_path
|
86
|
+
end
|
87
|
+
|
88
|
+
# Retrieve an array of valid API methods for the current model
|
89
|
+
# e.g [:find, :create]
|
90
|
+
#
|
91
|
+
# @return [Array<Symbol>] Valid API methods
|
92
|
+
def valid_api_methods
|
93
|
+
self.class.valid_api_methods
|
94
|
+
end
|
95
|
+
|
96
|
+
# Verify if an API method is supported for the current model
|
97
|
+
def check_api_method_is_supported(method)
|
98
|
+
self.class.check_api_method_is_supported(method)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Use judo_id from configuration if it hasn't been explicitly set
|
102
|
+
def check_judo_id
|
103
|
+
return unless respond_to?('judo_id') && judo_id.nil?
|
104
|
+
self.judo_id = Judopay.configuration.judo_id
|
105
|
+
end
|
106
|
+
|
107
|
+
protected
|
108
|
+
|
109
|
+
# Has the pre-validation found any problems?
|
110
|
+
# We check the basics have been completed to avoid round trip to API
|
111
|
+
#
|
112
|
+
# @return nil
|
113
|
+
# @raise [Judopay::ValidationError] if there are validation errors on the model
|
114
|
+
def check_validation
|
115
|
+
raise Judopay::ValidationError.new('Missing required fields', errors) unless valid?
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
module ActiveModel
|
121
|
+
module Validations
|
122
|
+
module ClassMethods
|
123
|
+
def validate_nested_model(*attr_names)
|
124
|
+
validates_with BlockValidator, _merge_attributes(attr_names) do |model, attr, value|
|
125
|
+
if value.is_a?(Judopay::Model) && !value.valid?
|
126
|
+
value.errors.each { |field, message| model.errors["#{attr}.#{field}"] = message }
|
127
|
+
elsif !value.is_a?(Judopay::Model)
|
128
|
+
model.errors[attr] = 'should be valid Model object'
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -1,26 +1,26 @@
|
|
1
|
-
require_relative '../model'
|
2
|
-
require_relative 'inner/wallet'
|
3
|
-
|
4
|
-
module Judopay
|
5
|
-
class AndroidPayment < Model
|
6
|
-
@resource_path = 'transactions/payments'
|
7
|
-
@valid_api_methods = [:create]
|
8
|
-
|
9
|
-
attribute :your_consumer_reference, String # required
|
10
|
-
attribute :your_payment_reference, String # required
|
11
|
-
attribute :your_payment_meta_data, Hash
|
12
|
-
attribute :judo_id, String # required
|
13
|
-
attribute :amount, Float # required
|
14
|
-
attribute :currency, String
|
15
|
-
attribute :client_details, Hash
|
16
|
-
attribute :wallet, Judopay::Wallet
|
17
|
-
|
18
|
-
validates_presence_of :your_consumer_reference,
|
19
|
-
:your_payment_reference,
|
20
|
-
:judo_id,
|
21
|
-
:amount,
|
22
|
-
:currency
|
23
|
-
|
24
|
-
validate_nested_model :wallet
|
25
|
-
end
|
26
|
-
end
|
1
|
+
require_relative '../model'
|
2
|
+
require_relative 'inner/wallet'
|
3
|
+
|
4
|
+
module Judopay
|
5
|
+
class AndroidPayment < Model
|
6
|
+
@resource_path = 'transactions/payments'
|
7
|
+
@valid_api_methods = [:create]
|
8
|
+
|
9
|
+
attribute :your_consumer_reference, String # required
|
10
|
+
attribute :your_payment_reference, String # required
|
11
|
+
attribute :your_payment_meta_data, Hash
|
12
|
+
attribute :judo_id, String # required
|
13
|
+
attribute :amount, Float # required
|
14
|
+
attribute :currency, String
|
15
|
+
attribute :client_details, Hash
|
16
|
+
attribute :wallet, Judopay::Wallet
|
17
|
+
|
18
|
+
validates_presence_of :your_consumer_reference,
|
19
|
+
:your_payment_reference,
|
20
|
+
:judo_id,
|
21
|
+
:amount,
|
22
|
+
:currency
|
23
|
+
|
24
|
+
validate_nested_model :wallet
|
25
|
+
end
|
26
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require_relative '../model'
|
2
|
-
require_relative 'android_payment'
|
3
|
-
|
4
|
-
module Judopay
|
5
|
-
class AndroidPreauth < AndroidPayment
|
6
|
-
@resource_path = 'transactions/preauths'
|
7
|
-
end
|
8
|
-
end
|
1
|
+
require_relative '../model'
|
2
|
+
require_relative 'android_payment'
|
3
|
+
|
4
|
+
module Judopay
|
5
|
+
class AndroidPreauth < AndroidPayment
|
6
|
+
@resource_path = 'transactions/preauths'
|
7
|
+
end
|
8
|
+
end
|
@@ -1,26 +1,26 @@
|
|
1
|
-
require_relative '../model'
|
2
|
-
require_relative 'inner/pk_payment'
|
3
|
-
|
4
|
-
module Judopay
|
5
|
-
class ApplePayment < Model
|
6
|
-
@resource_path = 'transactions/payments'
|
7
|
-
@valid_api_methods = [:create]
|
8
|
-
|
9
|
-
attribute :your_consumer_reference, String # required
|
10
|
-
attribute :your_payment_reference, String # required
|
11
|
-
attribute :your_payment_meta_data, Hash
|
12
|
-
attribute :judo_id, String # required
|
13
|
-
attribute :amount, Float # required
|
14
|
-
attribute :currency, String
|
15
|
-
attribute :client_details, Hash
|
16
|
-
attribute :pk_payment, Judopay::PkPayment
|
17
|
-
|
18
|
-
validates_presence_of :your_consumer_reference,
|
19
|
-
:your_payment_reference,
|
20
|
-
:judo_id,
|
21
|
-
:amount,
|
22
|
-
:currency
|
23
|
-
|
24
|
-
validate_nested_model :pk_payment
|
25
|
-
end
|
26
|
-
end
|
1
|
+
require_relative '../model'
|
2
|
+
require_relative 'inner/pk_payment'
|
3
|
+
|
4
|
+
module Judopay
|
5
|
+
class ApplePayment < Model
|
6
|
+
@resource_path = 'transactions/payments'
|
7
|
+
@valid_api_methods = [:create]
|
8
|
+
|
9
|
+
attribute :your_consumer_reference, String # required
|
10
|
+
attribute :your_payment_reference, String # required
|
11
|
+
attribute :your_payment_meta_data, Hash
|
12
|
+
attribute :judo_id, String # required
|
13
|
+
attribute :amount, Float # required
|
14
|
+
attribute :currency, String
|
15
|
+
attribute :client_details, Hash
|
16
|
+
attribute :pk_payment, Judopay::PkPayment
|
17
|
+
|
18
|
+
validates_presence_of :your_consumer_reference,
|
19
|
+
:your_payment_reference,
|
20
|
+
:judo_id,
|
21
|
+
:amount,
|
22
|
+
:currency
|
23
|
+
|
24
|
+
validate_nested_model :pk_payment
|
25
|
+
end
|
26
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require_relative '../model'
|
2
|
-
require_relative 'apple_payment'
|
3
|
-
|
4
|
-
module Judopay
|
5
|
-
class ApplePreauth < ApplePayment
|
6
|
-
@resource_path = 'transactions/preauths'
|
7
|
-
@valid_api_methods = [:create]
|
8
|
-
end
|
9
|
-
end
|
1
|
+
require_relative '../model'
|
2
|
+
require_relative 'apple_payment'
|
3
|
+
|
4
|
+
module Judopay
|
5
|
+
class ApplePreauth < ApplePayment
|
6
|
+
@resource_path = 'transactions/preauths'
|
7
|
+
@valid_api_methods = [:create]
|
8
|
+
end
|
9
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative '../model'
|
2
|
-
|
3
|
-
module Judopay
|
4
|
-
class CardAddress < Model
|
5
|
-
attribute :line1, String
|
6
|
-
attribute :line2, String
|
7
|
-
attribute :line3, String
|
8
|
-
attribute :town, String
|
9
|
-
attribute :postcode, String
|
10
|
-
end
|
11
|
-
end
|
1
|
+
require_relative '../model'
|
2
|
+
|
3
|
+
module Judopay
|
4
|
+
class CardAddress < Model
|
5
|
+
attribute :line1, String
|
6
|
+
attribute :line2, String
|
7
|
+
attribute :line3, String
|
8
|
+
attribute :town, String
|
9
|
+
attribute :postcode, String
|
10
|
+
end
|
11
|
+
end
|