windcave_rest 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ module WindcaveRest
2
+ class Card < WindcaveRest::Base
3
+ # Windcave generated id for the card object instance
4
+ api_attribute :id
5
+
6
+ # (required) card holder name as displayed on card
7
+ api_attribute :card_holder_name
8
+
9
+ # (required) 13 - 19 digit card number obfuscated
10
+ api_attribute :card_number
11
+
12
+ # (required) (MM) month of expiry as displayed on the card
13
+ api_attribute :date_expiry_month
14
+
15
+ # (required) (YY) year of expiry as displayed on the card
16
+ api_attribute :date_expiry_year
17
+
18
+ # (required) card brand, eg: visa
19
+ api_attribute :type
20
+
21
+ # if enabled Windcave generated luhn-able 16 digit card number alternative card id
22
+ api_attribute :card_number2
23
+
24
+ # cvc2 (cvv) security value printed on rear of card. required only for first use of card.
25
+ api_attribute :cvc2
26
+ end
27
+ end
@@ -0,0 +1,75 @@
1
+ module WindcaveRest
2
+ class CreateSessionRequest < WindcaveRest::Base
3
+ # The checkout type (purchase, auth, validate) [STRING]
4
+ # ammount and currency are required for purchase and auth type
5
+ api_attribute :type
6
+
7
+ # The client type (internet, moto) [STRING]
8
+ api_attribute :client_type
9
+
10
+ api_attribute :amount
11
+
12
+ # (optional) amount of pre-calculated merchant specified surcharge value
13
+ api_attribute :amount_surcharge
14
+
15
+ # ISO 4217 3 letter code
16
+ api_attribute :currency
17
+
18
+ # Cart / Order reference Number
19
+ api_attribute :merchant_reference
20
+
21
+ # US, (string, optional) - sets the default language of the hpp. Ensure language is supported first. If not specified english is used. format is a variant of bcp47 https://tools.ietf.org/html/bcp47, specifically ISO 639-1 optionally followed by ISO 3166-1 alpha-2 separated by a '-'.
22
+ api_attribute :language
23
+
24
+ # this is empty or one or more array string values representing the method used
25
+ # card => 0, account2account => 1, alipay => 2, applepay => 3, paypal => 4,
26
+ # interac => 5, unionpay => 6, oxipay => 7, visacheckout => 8, wechat => 9
27
+ api_attribute :methods, :'Array<String>'
28
+
29
+ # (optional) RFC-3339 Date indicates when session should expire
30
+ api_attribute :expires, :'Date'
31
+
32
+ # [Object] CallbackUrls
33
+ api_attribute :callback_urls, :'CallbackUrls'
34
+
35
+ # (optional) url for specifying alternative notification of session completion
36
+ api_attribute :notification_url
37
+
38
+ #######################
39
+ # Windcave generated id of a previously created card object
40
+ api_attribute :card_id
41
+ ####### OR ############
42
+ # luhn-able 16 digit card number substitute card id
43
+ api_attribute :card_number2
44
+ # store a card collected during session
45
+ api_attribute :store_card, :'BOOLEAN'
46
+ #######################
47
+
48
+ # card storage reason.
49
+ # Any one of: single, recurring, installment, recurringnoexpiry, recurringinitial, installmentinitial,
50
+ # credentialonfileinitial, unscheduledcredentialonfileinitial, credentialonfile, unscheduledcredentialonfile,
51
+ # incremental, resubmission, reauthorisation, delayedcharges, noshow
52
+ api_attribute :stored_card_indicator
53
+
54
+ # value is used to indicate the total number of payments for an installment transaction.
55
+ api_attribute :installment_count, :'Integer'
56
+
57
+ # 1-based value that is used to indicate the current payment number for an installment transaction. For example, if the consumer is making payment 1 of 12, then this value should be set to 1
58
+ api_attribute :installment_number, :'Integer'
59
+
60
+ # set it to 1 to indicate that this is a debt repayment transaction.
61
+ api_attribute :debt_repayment_indicator, :'Integer'
62
+
63
+ # [Object] Customer
64
+ api_attribute :customer, :'Customer'
65
+
66
+ # Windcave id reference for existing customer object
67
+ api_attribute :customer_id
68
+
69
+ # (optional) array of string values free text relevant to your payment
70
+ api_attribute :meta_data, :'Array<String>'
71
+
72
+ # [Object] Browser
73
+ api_attribute :browser, :'Browser'
74
+ end
75
+ end
@@ -0,0 +1,80 @@
1
+ module WindcaveRest
2
+ class CreateTransactionRequest < WindcaveRest::Base
3
+ # transaction type, one of: (purchase, auth, refund, complete, validate, void) [STRING]
4
+ api_attribute :type
5
+
6
+ # base amount of the payment (not including specified surcharges) format appropriately for currency
7
+ api_attribute :amount
8
+
9
+ # ISO 4217 3 letter code
10
+ api_attribute :currency
11
+
12
+ # any one of: internet, moto, unattended
13
+ api_attribute :client_type
14
+
15
+ # free text field as a main reference for the transaction (max: 64) (typically invoice number or order number)
16
+ api_attribute :merchant_reference
17
+
18
+ # [Object] Card
19
+ api_attribute :card, :'Card'
20
+
21
+ #########################
22
+
23
+ # Windcave generated id of a previously created card object
24
+ api_attribute :card_id
25
+
26
+ ######### OR ###########
27
+
28
+ # luhn-able 16 digit card number substitute card id
29
+ api_attribute :card_number2
30
+
31
+ ######### OR ###########
32
+
33
+ # TODO: Not implementing now
34
+ # api_attribute :applepay
35
+
36
+ ######### OR ###########
37
+
38
+ # Windcave generated id of previously processed transaction
39
+ api_attribute :transaction_id
40
+ # [Object] Customer
41
+ api_attribute :customer
42
+
43
+ ######### OR ###########
44
+
45
+ # Windcave generated id of the customer
46
+ api_attribute :customer_id
47
+
48
+ #########################
49
+
50
+ # [Object] Browser
51
+ api_attribute :browser, :'Browser'
52
+
53
+ # [Object] Avs
54
+ api_attribute :avs, :'Avs'
55
+
56
+ # [Array<Object>]
57
+ api_attribute :meta_data, :'Array<String>'
58
+
59
+ # amount of pre-calculated merchant specified surcharge value
60
+ api_attribute :amount_surcharge
61
+
62
+ # store the card object given
63
+ api_attribute :store_card, :'BOOLEAN'
64
+
65
+ # use case for storing or use of stored card. Any one of: single, recurring, .... https://px5.docs.apiary.io/#reference/0/transactions/create-transaction
66
+ api_attribute :stored_card_indicator
67
+
68
+ # value is used to indicate the total number of payments for an installment transaction.
69
+ api_attribute :installment_count, :'Integer'
70
+
71
+ # 1-based value that is used to indicate the current payment number for an installment transaction. For example, if the consumer is making payment 1 of 12, then this value should be set to 1
72
+ api_attribute :installment_number, :'Integer'
73
+
74
+ # set it to 1 to indicate that this is a debt repayment transaction.
75
+ api_attribute :debt_repayment_indicator, :'Integer'
76
+
77
+ # url for notification of transaction completion
78
+ api_attribute :notification_url
79
+ end
80
+ end
@@ -0,0 +1,23 @@
1
+ module WindcaveRest
2
+ class Customer < WindcaveRest::Base
3
+ # Windcave generated id of the customer
4
+ api_attribute :id
5
+
6
+ api_attribute :first_name
7
+
8
+ api_attribute :last_name
9
+
10
+ # (required)
11
+ api_attribute :email
12
+
13
+ api_attribute :phone_number
14
+
15
+ api_attribute :account
16
+
17
+ # [Object] Address
18
+ api_attribute :shipping, :'Address'
19
+
20
+ # [Object] Address
21
+ api_attribute :billing, :'Address'
22
+ end
23
+ end
@@ -0,0 +1,12 @@
1
+ module WindcaveRest
2
+ class Link < WindcaveRest::Base
3
+ # URL relevant to the link
4
+ api_attribute :href
5
+
6
+ # what the link is for semantically, eg: hpp
7
+ api_attribute :rel
8
+
9
+ # how to use the link programmatically, eg: REDIRECT
10
+ api_attribute :method
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module WindcaveRest
2
+ class Risk < WindcaveRest::Base
3
+ # what the risk engine has determined the required action to take was either: decline, warning, noaction
4
+ api_attribute :action
5
+
6
+ # actual score total from all risk assessment
7
+ api_attribute :score, :'Integer'
8
+
9
+ # possible score total from all risk assessment
10
+ api_attribute :possible, :'Integer'
11
+
12
+ # textual single field representation of risk assessment results (format subject to change)
13
+ api_attribute :summary_text
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ module WindcaveRest
2
+ class Session < WindcaveRest::Base
3
+ api_attribute :id
4
+ api_attribute :state
5
+
6
+ # [Array Object] Link
7
+ api_attribute :links, :'Array<Link>'
8
+
9
+ # [Array Object] Transaction
10
+ api_attribute :transactions, :'Array<Transaction>'
11
+
12
+ api_attribute :customerId
13
+
14
+ def select_card_id(session_id, merchant_id, purchase_type)
15
+ transactions.detect do |x|
16
+ x.session_id == session_id &&
17
+ x.merchant_reference == merchant_id &&
18
+ x.type == purchase_type
19
+ end&.card&.id
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,110 @@
1
+ module WindcaveRest
2
+ class Transaction < WindcaveRest::Base
3
+ # (required) Windcave generated id of the object instance / transaction_id
4
+ api_attribute :id
5
+
6
+ # the Windcave user which made the transaction
7
+ api_attribute :username
8
+
9
+ # the Windcave device id of the device which made the transaction (card present originated transaction)
10
+ api_attribute :device_id
11
+
12
+ # (required) true or false; true indicating the transaction was successfully authorised.
13
+ api_attribute :authorised, :'BOOLEAN'
14
+
15
+ # (required) true or false; true indicating that the declined result is caused by a temporal condition only and thus should be retried (change the X-ID !)
16
+ api_attribute :allow_retry, :'BOOLEAN'
17
+
18
+ # (required) Windcave response code. this can indicate both authorised and declined conditions. eg: 00
19
+ api_attribute :re_co
20
+
21
+ # (required) Windcave response text. human readable value matching the indicated reCo condition. eg: APPROVED
22
+ api_attribute :response_text
23
+
24
+ # (required) transaction type, eg: purchase
25
+ api_attribute :type
26
+
27
+ # (required) physical system method used processing. card
28
+ api_attribute :method
29
+
30
+ # (required) time zone abbreviation (ignoring day light savings)
31
+ api_attribute :local_time_zone
32
+
33
+ # (required) RFC-3339 in tz UTC
34
+ api_attribute :date_time_utc
35
+
36
+ # (required) RFC-3339 in tz as per localTimeZone
37
+ api_attribute :date_time_local
38
+
39
+ # (required) date of settlement (no time/tz associated)
40
+ api_attribute :settlement_date
41
+
42
+ # (required) base amount of the transaction (not including specified surcharges)
43
+ api_attribute :amount
44
+
45
+ # amount of residual account balance if determinable and applicable
46
+ api_attribute :balance_amount
47
+
48
+ # (required) ISO 4217 3 letter code of the currency of transaction
49
+ api_attribute :currency
50
+
51
+ # (required) ISO 3166 number of the currency of the transaction
52
+ api_attribute :currency_numeric, :'Integer'
53
+
54
+ # (required) Enum client type values are any, internet, moto, unattended, recurringmoto, recurringecom
55
+ api_attribute :client_type
56
+
57
+ api_attribute :merchant_reference
58
+
59
+ # [Object] Card
60
+ api_attribute :card, :'Card'
61
+
62
+ # eg: standard, 3ds1verifiedbyvisa, 3ds1mastercardsecurecode, 3ds1amexsafekey, 3ds1other, 3ds2frictionless, 3ds2challenge
63
+ api_attribute :liability_indicator
64
+
65
+ # eg: M, N, P, S, U
66
+ api_attribute :cvc2_result_code
67
+
68
+ # card storage reason as given in request
69
+ api_attribute :stored_card_indicator
70
+
71
+ # value is used to indicate the total number of payments for an installment transaction.
72
+ api_attribute :installment_count, :'Integer'
73
+
74
+ # 1-based value that is used to indicate the current payment number for an installment transaction. For example, if the consumer is making payment 1 of 12, then this value should be set to 1
75
+ api_attribute :installment_number, :'Integer'
76
+
77
+ # set it to 1 to indicate that this is a debt repayment transaction.
78
+ api_attribute :debt_repayment_indicator, :'Integer'
79
+
80
+ # url for notification of transaction completion
81
+ api_attribute :notification_url
82
+
83
+ # [Object] Customer
84
+ api_attribute :customer, :'Customer'
85
+
86
+ # [Object] Avs
87
+ api_attribute :avs, :'Avs'
88
+
89
+ # 32 character string representation of the sessionId
90
+ api_attribute :session_id
91
+
92
+ # [Object] Browser
93
+ api_attribute :browser, :'Browser'
94
+
95
+ # [Array<String>]
96
+ api_attribute :meta_data, :'Array<String>'
97
+
98
+ # amount of calculated surcharge value ( merchant or Windcave generated)
99
+ api_attribute :amount_surcharge
100
+
101
+ # (required)
102
+ api_attribute :is_surcharge, :'BOOLEAN'
103
+
104
+ # [Object] Risk
105
+ api_attribute :risk, :'Risk'
106
+
107
+ # [Array<Object>] Link
108
+ api_attribute :links, :'Array<Link>'
109
+ end
110
+ end
@@ -0,0 +1,3 @@
1
+ module WindcaveRest
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,26 @@
1
+ require_relative 'lib/windcave_rest/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "windcave_rest"
5
+ spec.version = WindcaveRest::VERSION
6
+ spec.authors = ["Anto Dominic"]
7
+ spec.email = ["anto.dominic@reinteractive.com"]
8
+
9
+ spec.summary = "Windcave / Payment Express new Rest API"
10
+ spec.description = "Windcave REST API initial build"
11
+ spec.homepage = "https://storeconnect.app/"
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+
14
+ # Specify which files should be added to the gem when it is released.
15
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
16
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ end
19
+
20
+ spec.add_runtime_dependency 'typhoeus'
21
+ spec.add_runtime_dependency 'json'
22
+
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: windcave_rest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Anto Dominic
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-04-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: typhoeus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Windcave REST API initial build
42
+ email:
43
+ - anto.dominic@reinteractive.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - ".travis.yml"
51
+ - CODE_OF_CONDUCT.md
52
+ - Gemfile
53
+ - Gemfile.lock
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - bin/console
58
+ - bin/setup
59
+ - lib/windcave_rest.rb
60
+ - lib/windcave_rest/api/base_api.rb
61
+ - lib/windcave_rest/api/sessions_api.rb
62
+ - lib/windcave_rest/api/transactions_api.rb
63
+ - lib/windcave_rest/api_client.rb
64
+ - lib/windcave_rest/api_error.rb
65
+ - lib/windcave_rest/configuration.rb
66
+ - lib/windcave_rest/models/address.rb
67
+ - lib/windcave_rest/models/avs.rb
68
+ - lib/windcave_rest/models/base.rb
69
+ - lib/windcave_rest/models/browser.rb
70
+ - lib/windcave_rest/models/callback_urls.rb
71
+ - lib/windcave_rest/models/card.rb
72
+ - lib/windcave_rest/models/create_session_request.rb
73
+ - lib/windcave_rest/models/create_transaction_request.rb
74
+ - lib/windcave_rest/models/customer.rb
75
+ - lib/windcave_rest/models/link.rb
76
+ - lib/windcave_rest/models/risk.rb
77
+ - lib/windcave_rest/models/session.rb
78
+ - lib/windcave_rest/models/transaction.rb
79
+ - lib/windcave_rest/version.rb
80
+ - windcave_rest.gemspec
81
+ homepage: https://storeconnect.app/
82
+ licenses: []
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 2.3.0
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubygems_version: 3.0.3
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: Windcave / Payment Express new Rest API
103
+ test_files: []