aloha_relevant 0.1.0

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.
Files changed (57) hide show
  1. data/Gemfile +4 -0
  2. data/Gemfile.lock +17 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +271 -0
  5. data/Rakefile +3 -0
  6. data/aloha.gemspec +25 -0
  7. data/example/.gitignore +16 -0
  8. data/example/Gemfile +48 -0
  9. data/example/Gemfile.lock +152 -0
  10. data/example/README.rdoc +28 -0
  11. data/example/Rakefile +6 -0
  12. data/example/app/assets/images/.keep +0 -0
  13. data/example/app/assets/javascripts/application.js +16 -0
  14. data/example/app/assets/stylesheets/application.css +13 -0
  15. data/example/app/controllers/application_controller.rb +5 -0
  16. data/example/app/controllers/concerns/.keep +0 -0
  17. data/example/app/helpers/application_helper.rb +2 -0
  18. data/example/app/mailers/.keep +0 -0
  19. data/example/app/models/.keep +0 -0
  20. data/example/app/models/concerns/.keep +0 -0
  21. data/example/app/views/layouts/application.html.erb +14 -0
  22. data/example/bin/bundle +3 -0
  23. data/example/bin/rails +4 -0
  24. data/example/bin/rake +4 -0
  25. data/example/config.ru +4 -0
  26. data/example/config/application.rb +28 -0
  27. data/example/config/boot.rb +4 -0
  28. data/example/config/database.yml.example +60 -0
  29. data/example/config/environment.rb +5 -0
  30. data/example/config/environments/development.rb +29 -0
  31. data/example/config/environments/production.rb +80 -0
  32. data/example/config/environments/test.rb +36 -0
  33. data/example/config/initializers/backtrace_silencers.rb +7 -0
  34. data/example/config/initializers/filter_parameter_logging.rb +4 -0
  35. data/example/config/initializers/inflections.rb +16 -0
  36. data/example/config/initializers/mime_types.rb +5 -0
  37. data/example/config/initializers/secret_token.rb +12 -0
  38. data/example/config/initializers/session_store.rb +3 -0
  39. data/example/config/initializers/wrap_parameters.rb +14 -0
  40. data/example/config/locales/en.yml +23 -0
  41. data/example/config/routes.rb +56 -0
  42. data/example/db/schema.rb +16 -0
  43. data/example/db/seeds.rb +7 -0
  44. data/example/lib/assets/.keep +0 -0
  45. data/example/lib/tasks/.keep +0 -0
  46. data/example/log/.keep +0 -0
  47. data/example/public/404.html +58 -0
  48. data/example/public/422.html +58 -0
  49. data/example/public/500.html +57 -0
  50. data/example/public/favicon.ico +0 -0
  51. data/example/public/robots.txt +5 -0
  52. data/example/vendor/assets/javascripts/.keep +0 -0
  53. data/example/vendor/assets/stylesheets/.keep +0 -0
  54. data/lib/aloha.rb +339 -0
  55. data/lib/aloha/helper.rb +73 -0
  56. data/lib/aloha/version.rb +3 -0
  57. metadata +166 -0
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,56 @@
1
+ Example::Application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
+
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Example resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Example resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Example resource route with more complex sub-resources:
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', on: :collection
40
+ # end
41
+ # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
51
+ # namespace :admin do
52
+ # # Directs /admin/products/* to Admin::ProductsController
53
+ # # (app/controllers/admin/products_controller.rb)
54
+ # resources :products
55
+ # end
56
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 0) do
15
+
16
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
data/example/log/.keep ADDED
File without changes
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
File without changes
File without changes
data/lib/aloha.rb ADDED
@@ -0,0 +1,339 @@
1
+ require 'aloha/version'
2
+ require 'aloha/helper'
3
+ require 'rubygems'
4
+ require 'savon'
5
+ require 'httpclient'
6
+
7
+ module Aloha
8
+ class Soap
9
+ attr_accessor :default_request, :client
10
+
11
+ def initialize(params = {})
12
+ #gem_root = Gem::Specification.find_by_name('aloha').gem_dir
13
+ #default_setting = OpenStruct.new(YAML.load_file(gem_root + '/config/default_setting.yml'))
14
+
15
+ system_id = params[:system_id]# || default_setting.system_id
16
+ company_id = params[:company_id]# || default_setting.company_id
17
+ user_id = params[:user_id]# || default_setting.user_id
18
+ account_password = params[:account_password]# || default_setting.account_password
19
+ system_password = params[:system_password]# || default_setting.system_password
20
+ wsdl_url = params[:wsdl_url]# || default_setting.wsdl_url
21
+ ssl_version = params[:ssl_version] || :SSLv3
22
+ @default_request = {'companyID' => company_id, 'userID' => user_id, 'password' => account_password} if company_id && user_id && account_password
23
+
24
+ @client = Savon.client(soap_header: @default_request) do
25
+ wsdl wsdl_url
26
+ wsse_timestamp true
27
+ wsse_auth system_id, system_password
28
+ log true
29
+ log_level :debug
30
+ pretty_print_xml true
31
+ ssl_version ssl_version
32
+ end if system_id && system_password
33
+ end
34
+
35
+ #### addMemberProfile()
36
+ def add_member_profile(params = {})
37
+ request_params = {
38
+ profile: Aloha::Helper.member_profile(params)
39
+ }
40
+ request_params.merge!(default_request) if default_request
41
+
42
+ response = client.call(:add_member_profile) do
43
+ message(add_member_profile_request: request_params)
44
+ end if client
45
+ Aloha::Helper.aloha_soap_result(response, :add_member_profile)
46
+
47
+ rescue Savon::SOAPFault
48
+ end
49
+
50
+ ### adjustCredit()
51
+ def adjust_credit(params = {})
52
+ request_params = {
53
+ 'cardNumber' => params[:card_number],
54
+ 'BPID' => params[:bpid],
55
+ 'adjustmentType' => params[:adjustment_type],
56
+ 'BPCredit' => params[:bp_credit],
57
+ 'reason' => params[:reason]
58
+ }
59
+ request_params.merge!(default_request) if default_request
60
+
61
+ response = client.call(:adjust_credit) do
62
+ message(adjust_credit_request: request_params)
63
+ end if client
64
+ Aloha::Helper.aloha_soap_result(response, :adjust_credit)
65
+
66
+ rescue Savon::SOAPFault
67
+ end
68
+
69
+ ### getBonusPlanHistory()
70
+ def get_bonus_plan_history(params = {})
71
+ request_params = { card_number: params[:card_number] }
72
+ request_params.merge!(number_of_assignments: params[:number_of_assignments]) if params[:number_of_assignments]
73
+ request_params.merge!(number_of_days: params[:number_of_days]) if params[:number_of_days]
74
+ request_params.merge!(start_date: params[:start_date]) if params[:start_date]
75
+ request_params.merge!(end_date: params[:end_date]) if params[:end_date]
76
+ request_params.merge!(default_request) if default_request
77
+
78
+ response = client.call(:get_bonus_plan_history) do
79
+ message('GetBonusPlanHistoryRequest' => request_params)
80
+ end if client
81
+ Aloha::Helper.aloha_soap_result(response, :get_bonus_plan_history)
82
+
83
+ rescue Savon::SOAPFault
84
+ end
85
+
86
+ ### getBonusPlanStandings()
87
+ def get_bonus_plan_standings(params = {})
88
+ request_params = {
89
+ card_number: params[:card_number],
90
+ available_items_return: params[:available_items_return],
91
+ purchased_items_return: params[:purchased_items_return]
92
+ }
93
+ request_params.merge!(default_request) if default_request
94
+
95
+ response = client.call(:get_bonus_plan_standings) do
96
+ message(get_bonus_plan_standings_request: request_params)
97
+ end if client
98
+ Aloha::Helper.aloha_soap_result(response, :get_bonus_plan_standings)
99
+
100
+ rescue Savon::SOAPFault
101
+ end
102
+
103
+ ### eMailExists()
104
+ def email_exists(params = {})
105
+ request_params = {
106
+ e_mail_address: params[:email_address]
107
+ }
108
+ request_params.merge!(default_request) if default_request
109
+
110
+ response = client.call(:e_mail_exists) do
111
+ message(e_mail_exists_request: request_params)
112
+ end if client
113
+ Aloha::Helper.aloha_soap_result(response, :e_mail_exists)
114
+
115
+ rescue Savon::SOAPFault
116
+ end
117
+
118
+ ### getCardNumberByEmail()
119
+ def get_card_number_by_email(params = {})
120
+ request_params = {
121
+ status: params[:account_status],
122
+ email_address: params[:email_address]
123
+ }
124
+ request_params.merge!(default_request) if default_request
125
+
126
+ response = client.call(:get_card_number_by_email) do
127
+ message('GetCardNumberByEmailRequest' => request_params)
128
+ end if client
129
+ Aloha::Helper.aloha_soap_result(response, :get_card_number_by_email)
130
+
131
+ rescue Savon::SOAPFault
132
+ end
133
+
134
+ ### getCardNumberByPhone()
135
+ def get_card_number_by_phone(params = {})
136
+ request_params = {
137
+ status: params[:account_status],
138
+ phone_number: params[:phone_number]
139
+ }
140
+ request_params.merge!(default_request) if default_request
141
+
142
+ response = client.call(:get_card_number_by_phone) do
143
+ message('GetCardNumberByPhoneRequest' => request_params)
144
+ end if client
145
+ Aloha::Helper.aloha_soap_result(response, :get_card_number_by_phone)
146
+
147
+ rescue Savon::SOAPFault
148
+ end
149
+
150
+ ### getCardStatus()  
151
+ def get_card_status(params = {})
152
+ request_params = {
153
+ card_number: params[:card_number]
154
+ }
155
+ request_params.merge!(default_request) if default_request
156
+
157
+ response = client.call(:get_card_status) do
158
+ message(get_card_status_request: request_params)
159
+ end if client
160
+ Aloha::Helper.aloha_soap_result(response, :get_card_status)
161
+
162
+ rescue Savon::SOAPFault
163
+ end
164
+
165
+ ### getMemberProfile()  
166
+ def get_member_profile(params = {})
167
+ request_params = {
168
+ card_number: params[:card_number]
169
+ }
170
+ request_params.merge!(default_request) if default_request
171
+
172
+ response = client.call(:get_member_profile) do
173
+ message(get_member_profile_request: request_params)
174
+ end if client
175
+ Aloha::Helper.aloha_soap_result(response, :get_member_profile)
176
+
177
+ rescue Savon::SOAPFault
178
+ end
179
+
180
+ ### phoneNumberExists() 
181
+ def phone_number_exists(params = {})
182
+ request_params = {
183
+ phone_number: params[:phone_number]
184
+ }
185
+ request_params.merge!(default_request) if default_request
186
+
187
+ response = client.call(:phone_number_exists) do
188
+ message('PhoneNumberExistsRequest' => request_params)
189
+ end if client
190
+
191
+ Aloha::Helper.aloha_soap_result(response, :phone_number_exists)
192
+ rescue Savon::SOAPFault
193
+ end
194
+
195
+ ### updateMemberProfile()
196
+ def update_member_profile(params = {})
197
+ request_params = {
198
+ profile: Aloha::Helper.member_profile(params)
199
+ }
200
+ request_params.merge!(default_request) if default_request
201
+
202
+ response = client.call(:update_member_profile) do
203
+ message(update_member_profile_request: request_params)
204
+ end if client
205
+ Aloha::Helper.aloha_soap_result(response, :update_member_profile)
206
+
207
+ rescue Savon::SOAPFault
208
+ end
209
+
210
+ ### assignForgottenCard()
211
+ def assign_forgotten_card(params = {})
212
+ request_params = {
213
+ card_number: params[:card_number],
214
+ claim_ID: params[:claim_id]
215
+ }
216
+ request_params.merge!(default_request) if default_request
217
+
218
+ response = client.call(:assign_forgotten_card) do
219
+ message(assign_forgotten_card_request: request_params)
220
+ end if client
221
+ Aloha::Helper.aloha_soap_result(response, :assign_forgotten_card)
222
+
223
+ rescue Savon::SOAPFault
224
+ end
225
+
226
+ ### getCheckDetail()
227
+ def get_check_detail(params = {})
228
+ request_params = {
229
+ claim_ID: params[:claim_id],
230
+ store_ID: params[:store_id],
231
+ date_of_business: params[:date_of_business] || Date.today.to_s
232
+ }
233
+ request_params.merge!(default_request) if default_request
234
+
235
+ response = client.call(:get_check_detail) do
236
+ message('GetCheckDetailRequest' => request_params)
237
+ end if client
238
+ Aloha::Helper.aloha_soap_result(response, :get_check_detail)
239
+
240
+ rescue Savon::SOAPFault
241
+ end
242
+
243
+ ### activateNewCard ()
244
+ def activate_new_card(params = {})
245
+ request_params = {
246
+ 'batchID' => params[:batch_id]
247
+ }
248
+ request_params.merge!(default_request) if default_request
249
+
250
+ response = client.call(:activate_new_card) do
251
+ message('ActivateNewCardRequest' => request_params)
252
+ end if client
253
+ Aloha::Helper.aloha_soap_result(response, :activate_new_card)
254
+
255
+ rescue Savon::SOAPFault
256
+ end
257
+
258
+ ### createVirtualCard()
259
+ def create_virtual_card(params = {})
260
+ request_params = {
261
+ card_series: params[:card_series]
262
+ }
263
+ request_params.merge!(default_request) if default_request
264
+
265
+ response = client.call(:create_virtual_card) do
266
+ message('CreateVirtualCardResult' => request_params)
267
+ end if client
268
+ Aloha::Helper.aloha_soap_result(response, :create_virtual_card)
269
+
270
+ rescue Savon::SOAPFault
271
+ end
272
+
273
+ ### optOut()
274
+ def opt_out(params = {})
275
+ request_params = {
276
+ card_number: params[:card_number]
277
+ }
278
+ request_params.merge!(default_request) if default_request
279
+
280
+ response = client.call(:opt_out) do
281
+ message(opt_out_request: request_params)
282
+ end if client
283
+ Aloha::Helper.aloha_soap_result(response, :opt_out)
284
+
285
+ rescue Savon::SOAPFault
286
+ end
287
+
288
+ ### phoneNumberExists()
289
+ def phone_number_exists(params = {})
290
+ request_params = {
291
+ phone_number: params[:phone_number]
292
+ }
293
+ request_params.merge!(default_request) if default_request
294
+
295
+ response = client.call(:phone_number_exists) do
296
+ message('PhoneNumberExistsRequest' => request_params)
297
+ end if client
298
+ Aloha::Helper.aloha_soap_result(response, :phone_number_exists)
299
+
300
+ rescue Savon::SOAPFault
301
+ end
302
+
303
+ ### newVirtualCard ()
304
+ def new_virtual_card(params = {})
305
+ request_params = {
306
+ card_series: params[:card_series]
307
+ }
308
+ request_params.merge!(default_request) if default_request
309
+
310
+ response = client.call(:new_virtual_card) do
311
+ message('NewVirtualCardRequest' => request_params)
312
+ end if client
313
+ Aloha::Helper.aloha_soap_result(response, :new_virtual_card)
314
+
315
+ rescue Savon::SOAPFault
316
+ end
317
+
318
+ ### createNewCard()
319
+ def create_new_card(params = {})
320
+ request_params = {
321
+ activate_card: params[:activate_card],
322
+ batch_desc: params[:batch_desc],
323
+ 'batchID' => params[:batch_id],
324
+ card_series: params[:card_series],
325
+ number_of_cards: params[:number_of_cards],
326
+ numeric_sequence_type: params[:numeric_sequence_type],
327
+ starting_card_number: params[:starting_card_number]
328
+ }
329
+ response = request_params.merge!(default_request) if default_request
330
+
331
+ client.call(:create_new_card) do
332
+ message('CreateNewCardRequest' => request_params)
333
+ end if client
334
+ Aloha::Helper.aloha_soap_result(response, :create_new_card)
335
+
336
+ rescue Savon::SOAPFault
337
+ end
338
+ end
339
+ end