lime_light_platform 1.0.0.18 → 1.0.0.19

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: 5b390368b3a6891b9d338128b76ac534bf62ade8d537da6587403c4c36279664
4
- data.tar.gz: a4ad66ec4dfeb2f61e7eb0f1df60c0995f4f7efd4a9bbbe6f2255464e39d2107
3
+ metadata.gz: 52309598e5b22e72650c6dbdc94a824f535638e4e097c11d8bb8ede10d6b3cbd
4
+ data.tar.gz: 9369cf060257d0094a565ad01b933af733dba6755bc2bcb806851080fb1d6980
5
5
  SHA512:
6
- metadata.gz: 3c788c89d45fe0fa20cf55901a158054d2d152203af3baeaff5cffd3115e5ae7c6893135cbfc00fd80933582e4eba157e552e2f147017227e53caff7e5878cb2
7
- data.tar.gz: 33dc4d2d8411e0db57a6f9be4f172eb8c8b0c298920d69bbb1709c8886727be1b4ceac870c0cee93436ab10a236ed1a2f4043e69f1fa497082d9b571f4fa9351
6
+ metadata.gz: 9d5846862ab6d8275e4422b08289988b27bbb727433be02593c79ea6cde8d78d8a2917dfa066aa2506331896dfbab6d7e4292437ef79fc943c746af22494c4f1
7
+ data.tar.gz: 0072d68acb6ea00d1c9f44b663037c60d69678321d08a6f8be29cba82dfca1940e8bdc54ea196fb189f590f2593c3efbf2f7e11c9f7286eb5ec68fcf2c7f9864
@@ -45,13 +45,47 @@ class LimeLightPlatform < AppBase
45
45
  end
46
46
  end
47
47
 
48
+ # Perform an preauthorization request on a payment method
49
+ # @param request [Hash] Request payload hash
50
+ # @return [Hash] Common response object
51
+ def authorize_payment request={}
52
+ call_params = base_call_params(__method__)
53
+ call_params[:body] = {
54
+ 'billingFirstName' => get_if_exists('billing_first_name', request),
55
+ 'billingLastName' => get_if_exists('billing_last_name', request),
56
+ 'billingAddress1' => get_if_exists('billing_address_1', request),
57
+ 'billingAddress2' => get_if_exists('billing_address_2', request),
58
+ 'billingCity' => get_if_exists('billing_city', request),
59
+ 'billingState' => get_if_exists('billing_state', request),
60
+ 'billingZip' => get_if_exists('billing_zip', request),
61
+ 'billingCountry' => get_if_exists('billing_country', request),
62
+ 'phone' => get_if_exists('phone', request),
63
+ 'email' => get_if_exists('email', request),
64
+ 'creditCardType' => get_if_exists('credit_card_type', request),
65
+ 'creditCardNumber' => get_if_exists('credit_card_number', request),
66
+ 'expirationDate' => get_if_exists('expiration_date', request),
67
+ 'CVV' => get_if_exists('cvv', request),
68
+ 'ipAddress' => get_if_exists('ip_address', request),
69
+ 'productId' => get_if_exists('product_id', request),
70
+ 'campaignId' => get_if_exists('campaign_id', request),
71
+ 'auth_amount' => get_if_exists('auth_amount', request, '1.00'),
72
+ 'cascade_enabled' => get_if_exists('cascade_enabled', request, '0'),
73
+ 'save_customer' => get_if_exists('save_customer', request, '0'),
74
+ 'validate_only_flag' => get_if_exists('validate_only_flag', request, '0'),
75
+ 'void_flag' => get_if_exists('void_flag', request, '0')
76
+ }
77
+ common_perform_post call_params
78
+ end
79
+
48
80
  # Retrieve billing model data for a specified billing model ID
49
81
  # @param request [Hash] Request payload hash
82
+ # @return [Hash] Common response object
50
83
  def billing_model_view request={}
51
84
  common_optional_param_perform_post base_call_params(__method__), ['offer_id', 'billing_model_id'], request
52
85
  end
53
86
 
54
87
  # Return all active campaigns ina CRM instance
88
+ # @return [Hash] Common response object
55
89
  def campaign_find_active
56
90
  response = default_response
57
91
  api_response = perform_api_call base_call_params(__method__)
@@ -81,12 +115,14 @@ class LimeLightPlatform < AppBase
81
115
 
82
116
  # Retrieve campaign data for a specified campaign ID
83
117
  # @param campaign_id [Integer] Campaign ID from CRM instance
118
+ # @return [Hash] Common response object
84
119
  def campaign_view campaign_id
85
120
  common_entity_view_perform_post base_call_params(__method__), 'campaign_id', campaign_id
86
121
  end
87
122
 
88
123
  # Validate a coupon based on promo code and other coupon parameters
89
124
  # @param request [Hash] Request payload hash
125
+ # @return [Hash] Common response object
90
126
  def coupon_validate request={}
91
127
  call_params = base_call_params __method__
92
128
  call_params[:body] = {
@@ -101,18 +137,21 @@ class LimeLightPlatform < AppBase
101
137
 
102
138
  # Retrieve customer data for a specified customer ID
103
139
  # @param customer_id [Integer] Customer ID from CRM instance
140
+ # @return [Hash] Common response object
104
141
  def customer_view customer_id
105
142
  common_entity_view_perform_post base_call_params(__method__), 'customer_id', customer_id
106
143
  end
107
144
 
108
145
  # Retrieve gateway data for a specified gateway ID
109
146
  # @param gateway_id [Integer] Gateway ID from CRM instance
147
+ # @return [Hash] Common response object
110
148
  def gateway_view gateway_id
111
149
  common_entity_view_perform_post base_call_params(__method__), 'gateway_id', gateway_id
112
150
  end
113
151
 
114
152
  # Retrieve alternative provider parameters (paypal, icepay)
115
153
  # @param request [Hash] Request payload hash
154
+ # @return [Hash] Common response object
116
155
  def get_alternative_provider request={}
117
156
  call_params = base_call_params __method__
118
157
  call_params[:body] = {
@@ -130,55 +169,71 @@ class LimeLightPlatform < AppBase
130
169
 
131
170
  # Create and process a new order
132
171
  # @param request [Hash] Request payload hash
172
+ # @return [Hash] Common response object
133
173
  def new_order request={}
134
- method_name = __method__.to_s
135
- call_params = base_call_params method_name.camelize
136
- call_params[:body] = {
137
- 'firstName' => get_if_exists('first_name', request),
138
- 'lastName' => get_if_exists('last_name', request),
139
- 'shippingAddress1' => get_if_exists('shipping_address_1', request),
140
- 'shippingAddress2' => get_if_exists('shipping_address_2', request),
141
- 'shippingCity' => get_if_exists('shipping_city', request),
142
- 'shippingState' => get_if_exists('shipping_state', request),
143
- 'shippingZip' => get_if_exists('shipping_zip', request),
144
- 'shippingCountry' => get_if_exists('shipping_country', request),
145
- 'billingFirstName' => get_if_exists('billing_first_name', request),
146
- 'billingLastName' => get_if_exists('billing_last_name', request),
147
- 'billingAddress1' => get_if_exists('billing_address_1', request),
148
- 'billingAddress2' => get_if_exists('billing_address_2', request),
149
- 'billingCity' => get_if_exists('billing_city', request),
150
- 'billingState' => get_if_exists('billing_state', request),
151
- 'billingZip' => get_if_exists('billing_zip', request),
152
- 'billingCountry' => get_if_exists('billing_country', request),
153
- 'phone' => get_if_exists('phone', request),
154
- 'email' => get_if_exists('email', request),
155
- 'creditCardType' => get_if_exists('credit_card_type', request),
156
- 'creditCardNumber' => get_if_exists('credit_card_number', request),
157
- 'expirationDate' => get_if_exists('expiration_date', request),
158
- 'CVV' => get_if_exists('cvv', request),
159
- 'shippingId' => get_if_exists('shipping_id', request),
160
- 'tranType' => get_if_exists('tran_type', request),
161
- 'ipAddress' => get_if_exists('ip_address', request),
162
- 'campaignId' => get_if_exists('campaign_id', request),
163
- 'notes' => get_if_exists('notes', request),
164
- 'utm_source' => get_if_exists('utm_source', request),
165
- 'utm_medium' => get_if_exists('utm_medium', request),
166
- 'utm_campaign' => get_if_exists('utm_campaign', request),
167
- 'utm_content' => get_if_exists('utm_content', request),
168
- 'utm_term' => get_if_exists('utm_term', request),
169
- 'products' => get_if_exists('products', request)
174
+ common_new_order_request __method__, request
175
+ end
176
+
177
+ # Create and process a new order based upon an existing order
178
+ # @param request [Hash] Request payload hash
179
+ # @return [Hash] Common response object
180
+ def new_order_card_on_file request={}
181
+ common_new_order_request __method__, request
182
+ end
183
+
184
+ # Create and process a new order based upon an existing prospect record
185
+ # @param request [Hash] Request payload hash
186
+ # @return [Hash] Common response object
187
+ def new_order_with_prospect request={}
188
+ common_new_order_request __method__, request
189
+ end
190
+
191
+ # Create a prospect record
192
+ # @param request [Hash] Request payload hash
193
+ # @return [Hash] Common response object
194
+ def new_prospect request={}
195
+ call_params = base_call_params(camel_case_name(__method__))
196
+ body = {
197
+ 'campaignId' => get_if_exists('campaign_id', request),
198
+ 'email' => get_if_exists('email', request),
199
+ 'ipAddress' => get_if_exists('ip_address', request)
170
200
  }
201
+ optional_params = {
202
+ 'first_name' => 'firstName',
203
+ 'last_name' => 'lastName',
204
+ 'address_1' => 'address1',
205
+ 'address_2' => 'address2',
206
+ 'city' => 'city',
207
+ 'state' => 'state',
208
+ 'zip' => 'zip',
209
+ 'country' => 'country',
210
+ 'phone' => 'phone',
211
+ 'afid' => 'AFID',
212
+ 'sid' => 'SID',
213
+ 'affid' => 'AFFID',
214
+ 'c1' => 'C1',
215
+ 'c2' => 'C2',
216
+ 'c3' => 'C3',
217
+ 'aid' => 'AID',
218
+ 'opt' => 'OPT',
219
+ 'click_id' => 'click_id',
220
+ 'notes' => 'notes',
221
+ }
222
+ body = map_param_if_exist optional_params, request, body
223
+ call_params[:body] = body
171
224
  common_perform_post call_params
172
225
  end
173
226
 
174
227
  # Retrieve offer data according to offer ID and/or campaign ID
175
228
  # @param request [Hash] Request payload hash
229
+ # @return [Hash] Common response object
176
230
  def offer_view request={}
177
231
  common_optional_param_perform_post base_call_params(__method__), ['offer_id', 'campaign_id'], request
178
232
  end
179
233
 
180
234
  # Search for one or more order records according to criteria
181
235
  # @param request [Hash] Request payload hash
236
+ # @return [Hash] Common response object
182
237
  def order_find request={}
183
238
  call_params = base_call_params __method__
184
239
  date_times = default_date_times
@@ -210,6 +265,7 @@ class LimeLightPlatform < AppBase
210
265
  # Search for one or more order records according to criteria
211
266
  # Criteria is based on several updated statuses
212
267
  # @param request [Hash] Request payload hash
268
+ # @return [Hash] Common response object
213
269
  def order_find_updated request={}
214
270
  call_params = base_call_params __method__
215
271
  date_times = default_date_times
@@ -224,7 +280,9 @@ class LimeLightPlatform < AppBase
224
280
  common_perform_post call_params
225
281
  end
226
282
 
283
+ # Force rebill an exist order
227
284
  # @param request [Hash] Request payload hash
285
+ # @return [Hash] Common response object
228
286
  def order_force_bill request={}
229
287
  call_params = base_call_params __method__
230
288
  call_params[:body] = {
@@ -244,6 +302,7 @@ class LimeLightPlatform < AppBase
244
302
 
245
303
  # Reprocess a declined order
246
304
  # @param order_id [Integer] The order ID from CRM instance
305
+ # @return [Hash] Common response object
247
306
  def order_reprocess order_id
248
307
  call_params = base_call_params __method__
249
308
  call_params[:body] = { 'order_id' => order_id }
@@ -252,6 +311,7 @@ class LimeLightPlatform < AppBase
252
311
 
253
312
  # Update the recurring properties of an order on an active subscription
254
313
  # @param request [Hash] Request payload hash
314
+ # @return [Hash] Common response object
255
315
  def order_update_recurring request={}
256
316
  call_params = base_call_params __method__
257
317
  call_params[:body] = {
@@ -263,6 +323,7 @@ class LimeLightPlatform < AppBase
263
323
 
264
324
  # Updates an order record according to various criteria
265
325
  # @param request [Hash] Request payload hash
326
+ # @return [Hash] Common response object
266
327
  def order_update request={}
267
328
  call_params = base_call_params __method__
268
329
  call_params[:body] = { 'sync_all' => get_if_exists('sync_all', request, 0) }
@@ -316,15 +377,18 @@ class LimeLightPlatform < AppBase
316
377
  common_update_perform_post call_params, request, 'order_id', update_options
317
378
  end
318
379
 
319
- #
380
+ # Retrieve order data based upon one or more order IDs
320
381
  # @param request [Hash] Request payload hash
382
+ # @return [Hash] Common response object
321
383
  def order_view request={}
322
384
  call_params = base_call_params __method__
323
385
  call_params[:body] = { 'order_id' => get_if_exists('order_id', request, []) }
324
386
  common_perform_post call_params
325
387
  end
326
388
 
389
+ # Retrieve the product variant attributes
327
390
  # @param request [Hash] Request payload hash
391
+ # @return [Hash] Common response object
328
392
  def product_attribute_index request={}
329
393
  call_params = base_call_params __method__
330
394
  call_params[:body] = { 'product_id' => get_if_exists('product_id', request, []) }
@@ -332,6 +396,7 @@ class LimeLightPlatform < AppBase
332
396
  end
333
397
 
334
398
  # Return all product bundles in a CRM instance
399
+ # @return [Hash] Common response object
335
400
  def product_bundle_index
336
401
  common_perform_post base_call_params(__method__)
337
402
  end
@@ -339,12 +404,14 @@ class LimeLightPlatform < AppBase
339
404
  # Retrieve product bundle data for a specified product ID
340
405
  # This product must be a bundle
341
406
  # @param product_id [Integer] Product ID from CRM instance
407
+ # @return [Hash] Common response object
342
408
  def product_bundle_view product_id
343
409
  common_entity_view_perform_post base_call_params(__method__), 'product_id', product_id
344
410
  end
345
411
 
346
412
  # Copy a product record
347
413
  # @param request [Hash] Request payload hash
414
+ # @return [Hash] Common response object
348
415
  def product_copy request={}
349
416
  call_params = base_call_params __method__
350
417
  call_params[:body] = { 'product_id' => get_if_exists('product_id', request, 0) }
@@ -358,6 +425,7 @@ class LimeLightPlatform < AppBase
358
425
 
359
426
  # Create a product record
360
427
  # @param request [Hash] Request payload hash
428
+ # @return [Hash] Common response object
361
429
  def product_create request={}
362
430
  call_params = base_call_params __method__
363
431
  call_params[:body] = {
@@ -387,12 +455,14 @@ class LimeLightPlatform < AppBase
387
455
 
388
456
  # Delete a product record
389
457
  # @param product_id [Integer] Product ID from CRM instance
458
+ # @return [Hash] Common response object
390
459
  def product_delete product_id
391
460
  common_entity_view_perform_post base_call_params(__method__), 'product_id', product_id
392
461
  end
393
462
 
394
463
  # Update a product record
395
464
  # @param request [Hash] Request payload hash
465
+ # @return [Hash] Common response object
396
466
  def product_update request={}
397
467
  call_params = base_call_params __method__
398
468
  update_options = [
@@ -422,6 +492,7 @@ class LimeLightPlatform < AppBase
422
492
 
423
493
  # Search for a prospect record according to one or more criteria
424
494
  # @param request [Hash] Request payload hash
495
+ # @return [Hash] Common response object
425
496
  def prospect_find request={}
426
497
  call_params = base_call_params __method__
427
498
  date_times = default_date_times
@@ -443,6 +514,7 @@ class LimeLightPlatform < AppBase
443
514
 
444
515
  # Update a prospect record
445
516
  # @param request [Hash] Request payload hash
517
+ # @return [Hash] Common response object
446
518
  def prospect_update request={}
447
519
  call_params = base_call_params __method__
448
520
  update_options = [
@@ -463,6 +535,7 @@ class LimeLightPlatform < AppBase
463
535
 
464
536
  # Retrieve prospect data for a specified prospect ID
465
537
  # @param request [Hash] Request payload hash
538
+ # @return [Hash] Common response object
466
539
  def prospect_view request={}
467
540
  call_params = base_call_params __method__
468
541
  call_params[:body] = {
@@ -473,12 +546,14 @@ class LimeLightPlatform < AppBase
473
546
 
474
547
  # Attempt to send an order to fulfillment
475
548
  # @param order_id [Integer] The order ID from CRM instance
549
+ # @return [Hash] Common response object
476
550
  def repost_to_fulfillment order_id
477
551
  common_entity_view_perform_post base_call_params(__method__), 'order_id', order_id
478
552
  end
479
553
 
480
554
  # Retrieve shipping method data based upon criteria
481
555
  # @param request [Hash] Request payload hash
556
+ # @return [Hash] Common response object
482
557
  def shipping_method_find request={}
483
558
  call_params = base_call_params __method__
484
559
  call_params[:body] = {
@@ -496,6 +571,7 @@ class LimeLightPlatform < AppBase
496
571
 
497
572
  # Retrieve shipping method data for a specified shipping ID
498
573
  # @param shipping_id [Integer] The shipping method ID from CRM instance
574
+ # @return [Hash] Common response object
499
575
  def shipping_method_view shipping_id
500
576
  common_entity_view_perform_post base_call_params(__method__), 'shipping_id', shipping_id
501
577
  end
@@ -503,12 +579,14 @@ class LimeLightPlatform < AppBase
503
579
  # Skips the next billing cycle on a recurring subscription by updating the recurring date
504
580
  # according to billing model configurations
505
581
  # @param subscription_id [String] Subscription ID on the order
582
+ # @return [Hash] Common response object
506
583
  def skip_next_billing subscription_id
507
584
  common_entity_view_perform_post base_call_params(__method__), 'subscription_id', subscription_id
508
585
  end
509
586
 
510
587
  # Update one or more dynamic properties on a recurring subscription
511
588
  # @param request [Hash] Request payload hash
589
+ # @return [Hash] Common response object
512
590
  def subscription_order_update request={}
513
591
  call_params = base_call_params __method__
514
592
  call_params[:body]['order_id'] = get_if_exists 'order_id', request
@@ -527,14 +605,24 @@ class LimeLightPlatform < AppBase
527
605
 
528
606
  # Stop, start, or reset a subscription
529
607
  # @param request [Hash] Request payload hash
608
+ # @return [Hash] Common response object
530
609
  def subscription_update request={}
531
610
  call_params = base_call_params __method__
532
611
  call_params[:body] = { 'subscription_id' => get_if_exists('subscription_id', request, {}) }
533
612
  common_perform_post call_params
534
613
  end
535
614
 
615
+ # Provide data necessary to redirect the customer
616
+ # to their personal bank URL for 3D Secure payments
617
+ # @param order_id [Integer] The order ID from CRM instance
618
+ # @return [Hash] Common response object
619
+ def three_d_redirect order_id
620
+ common_entity_view_perform_post base_call_params(__method__), 'order_id', order_id
621
+ end
622
+
536
623
  # Stops the recurring status of an upsell product on a subscriptions
537
624
  # @param request [Hash] Request payload hash
625
+ # @return [Hash] Common response object
538
626
  def upsell_stop_recurring request={}
539
627
  call_params = base_call_params __method__
540
628
  call_params[:body] = {
@@ -545,6 +633,7 @@ class LimeLightPlatform < AppBase
545
633
  end
546
634
 
547
635
  # Validates the API user username and password
636
+ # @return [Hash] Common response object
548
637
  def validate_credentials
549
638
  common_perform_post(base_call_params(__method__))
550
639
  end
@@ -655,4 +744,108 @@ class LimeLightPlatform < AppBase
655
744
  def default_date_times
656
745
  { today: Time.now.strftime('%m/%d/%Y'), start_time: '00:00:00', end_time: '23:59:59' }
657
746
  end
747
+
748
+ def camel_case_name name
749
+ method_name = name.to_s
750
+ method_name.camelize
751
+ end
752
+
753
+ def common_new_order_parameters request={}
754
+ new_order_params = {
755
+ # Needed for NewOrder
756
+ customer_shipping_data: {
757
+ 'first_name' => 'firstName',
758
+ 'last_name' => 'lastName',
759
+ 'shipping_address_1' => 'shippingAddress1',
760
+ 'shipping_address_2' => 'shippingAddress2',
761
+ 'shipping_city' => 'shippingCity',
762
+ 'shipping_state' => 'shippingState',
763
+ 'shipping_zip' => 'shippingZip',
764
+ 'shipping_country' => 'shippingCountry',
765
+ },
766
+ # Needed for NewOrder, NewOrderWithProspect
767
+ customer_billing_data: {
768
+ 'billing_first_name' => 'billingFirstName',
769
+ 'billing_last_name' => 'billingLastName',
770
+ 'billing_address_1' => 'billingAddress1',
771
+ 'billing_address_2' => 'billingAddress2',
772
+ 'billing_city' => 'billingCity',
773
+ 'billing_state' => 'billingState',
774
+ 'billing_zip' => 'billingZip',
775
+ 'billing_country' => 'billingCountry',
776
+ },
777
+ # Needed for NewOrder, NewOrderWithProspect
778
+ customer_payment_data: {
779
+ 'credit_card_type' => 'creditCardType',
780
+ 'credit_card_number' => 'creditCardNumber',
781
+ 'expiration_date' => 'expirationDate',
782
+ 'cvv' => 'CVV',
783
+ 'check_account_number' => 'checkAccountNumber',
784
+ 'check_routing_number' => 'checkRoutingNumber',
785
+ 'sepa_iban' => 'sepa_iban',
786
+ 'sepa_bic' => 'sepa_bic',
787
+ 'eurodebit_acct_num' => 'eurodebit_acct_num',
788
+ 'eurodebit_route_num' => 'eurodebit_route_num'
789
+ },
790
+ customer_critical_data: {
791
+ 'tran_type' => 'tranType',
792
+ 'phone' => 'phone',
793
+ 'email' => 'email',
794
+ 'shipping_id' => 'shippingId',
795
+ 'ip_address' => 'ipAddress',
796
+ 'campaign_id' => 'campaignId',
797
+ 'products' => 'products',
798
+ },
799
+ optional_params: {
800
+ 'prospect_id' => 'prospectId',
801
+ 'previous_order_id' => 'previousOrderId',
802
+ 'force_gateway_id' => 'forceGatewayId',
803
+ 'preserve_force_gateway' => 'preserve_force_gateway',
804
+ 'created_by' => 'createdBy',
805
+ 'thm_session_id' => 'thm_session_id',
806
+ 'total_installments' => 'total_installments',
807
+ 'alt_pay_token' => 'alt_pay_token',
808
+ 'alt_pay_payer_id' => 'alt_pay_payer_id',
809
+ 'secret_ssn' => 'secretSSN',
810
+ 'master_order_id' => 'master_order_id',
811
+ 'promo_code' => 'promoCode',
812
+ 'temp_customer_id' => 'temp_customer_id',
813
+ 'three_d_redirect_url' => 'three_d_redirect_url',
814
+ 'alt_pay_return_url' => 'alt_pay_return_url',
815
+ 'session_id' => 'sessionId',
816
+ 'cascade_override' => 'cascade_override',
817
+ 'create_member' => 'create_member',
818
+ 'event_id' => 'event_id',
819
+ 'ssn_nmi' => 'ssn_nmi',
820
+ 'device_category' => 'device_category',
821
+ 'notes' => 'notes',
822
+ 'utm_source' => 'utm_source',
823
+ 'utm_medium' => 'utm_medium',
824
+ 'utm_campaign' => 'utm_campaign',
825
+ 'utm_content' => 'utm_content',
826
+ 'utm_term' => 'utm_term',
827
+ 'afid' => 'AFID',
828
+ 'sid' => 'SID',
829
+ 'affid' => 'AFFID',
830
+ 'c1' => 'C1',
831
+ 'c2' => 'C2',
832
+ 'c3' => 'C3',
833
+ 'aid' => 'AID',
834
+ 'opt' => 'OPT',
835
+ 'click_id' => 'click_id',
836
+ 'initialize_new_subscription' => 'initializeNewSubscription'
837
+ }
838
+ }
839
+ body = map_param_if_exist new_order_params[:customer_shipping_data], request
840
+ body = map_param_if_exist new_order_params[:customer_billing_data], request, body
841
+ body = map_param_if_exist new_order_params[:customer_payment_data], request, body
842
+ body = map_param_if_exist new_order_params[:customer_critical_data], request, body
843
+ map_param_if_exist new_order_params[:optional_params], request, body
844
+ end
845
+
846
+ def common_new_order_request method_name, request
847
+ call_params = base_call_params(camel_case_name(method_name))
848
+ call_params[:body] = common_new_order_parameters request
849
+ common_perform_post call_params
850
+ end
658
851
  end
@@ -18,6 +18,18 @@ module Helpers
18
18
  hash[key]
19
19
  end
20
20
 
21
+ def map_param_if_exist param_map, request, body={}
22
+ param_map.each do |key, mapped_key|
23
+ str_mapped_key = key.to_s
24
+
25
+ if key_exists(str_mapped_key, request)
26
+ body[mapped_key] = request[str_mapped_key]
27
+ end
28
+ end
29
+
30
+ body
31
+ end
32
+
21
33
  def get_response_code hash={}
22
34
  response_code = ''
23
35
 
Binary file
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'lime_light_platform'
3
- s.version = '1.0.0.18'
3
+ s.version = '1.0.0.19'
4
4
  s.date = '2018-05-07'
5
5
  s.summary = "Official Lime Light eCommerce Platform API Ruby Gem (In Development)"
6
6
  s.description = "Official Lime Light eCommerce Platform API Ruby Gem (In Development)"
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+ require 'faker'
3
+ Faker::Config.locale = 'en-US'
4
+
5
+ RSpec.describe LimeLightPlatform, "#authorize_payment" do
6
+ context "Lime Light Platform - Transact API - authorize_payment" do
7
+ it "Performs a preauthorization request" do
8
+ lime_light = LimeLightPlatform.new(
9
+ ENV['APP_KEY'],
10
+ ENV['API_USERNAME'],
11
+ ENV['API_PASSWORD'],
12
+ ENV['DEV_SUB'],
13
+ true
14
+ )
15
+ response = lime_light.authorize_payment({
16
+ 'billing_first_name' => Faker::Name.first_name,
17
+ 'billing_last_name' => Faker::Name.last_name,
18
+ 'billing_address_1' => Faker::Address.street_address,
19
+ 'billing_address_2' => Faker::Address.secondary_address,
20
+ 'billing_city' => Faker::Address.city,
21
+ 'billing_state' => Faker::Address.state_abbr,
22
+ 'billing_zip' => Faker::Address.postcode,
23
+ 'billing_country' => ENV['TEST_AUTHORIZE_PAYMENT_BILLING_COUNTRY'],
24
+ 'phone' => Faker::PhoneNumber.phone_number,
25
+ 'email' => Faker::Internet.email,
26
+ 'credit_card_type' => ENV['TEST_AUTHORIZE_PAYMENT_CREDIT_CARD_TYPE'],
27
+ 'credit_card_number' => ENV['TEST_AUTHORIZE_PAYMENT_CREDIT_CARD_NUMBER'],
28
+ 'expiration_date' => ENV['TEST_AUTHORIZE_PAYMENT_EXPIRATION_DATE'],
29
+ 'cvv' => ENV['TEST_AUTHORIZE_PAYMENT_CVV'],
30
+ 'ip_address' => ENV['TEST_AUTHORIZE_PAYMENT_IP_ADDRESS'],
31
+ 'product_id' => ENV['TEST_AUTHORIZE_PAYMENT_PRODUCT_ID'],
32
+ 'campaign_id' => ENV['TEST_AUTHORIZE_PAYMENT_CAMPAIGN_ID'],
33
+ 'auth_amount' => ENV['TEST_AUTHORIZE_PAYMENT_AUTH_AMOUNT'],
34
+ 'cascade_enabled' => ENV['TEST_AUTHORIZE_PAYMENT_CASCADE_ENABLED'],
35
+ 'save_customer' => ENV['TEST_AUTHORIZE_PAYMENT_SAVE_CUSTOMER'],
36
+ 'validate_only_flag' => ENV['TEST_AUTHORIZE_PAYMENT_VALIDATE_ONLY_FLAG'],
37
+ 'void_flag' => ENV['TEST_AUTHORIZE_PAYMENT_VOID_FLAG']
38
+ })
39
+ expect(response[:success]).to eq true
40
+ end
41
+ end
42
+ end
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#coupon_validate " do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  products = [
14
14
  {
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#get_alternative_provider" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  products = [
14
14
  {
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+ require 'faker'
3
+ Faker::Config.locale = 'en-US'
4
+
5
+ RSpec.describe LimeLightPlatform, "#NewOrderCardOnFile" do
6
+ context "Lime Light Platform - Transact API - NewOrderCardOnFile" do
7
+ it "Creates and processes a new order based upon an existing order" do
8
+ lime_light = LimeLightPlatform.new(
9
+ ENV['APP_KEY'],
10
+ ENV['API_USERNAME'],
11
+ ENV['API_PASSWORD'],
12
+ ENV['DEV_SUB'],
13
+ true
14
+ )
15
+ response = lime_light.new_order_card_on_file({
16
+ 'previous_order_id' => ENV['TEST_NEW_ORDER_CARD_ON_FILE_PREVIOUS_ORDER_ID'],
17
+ # 'cvv' => ENV['TEST_CVV'],
18
+ 'products' => {
19
+ ENV['TEST_PRODUCT_1'] => {
20
+ 'offer_id' => ENV['TEST_OFFER_ID_1'],
21
+ 'billing_model_id' => ENV['TEST_BILLING_MODEL_ID_1'],
22
+ 'quantity' => ENV['TEST_QUANTITY_1']
23
+ },
24
+ ENV['TEST_PRODUCT_2'] => {
25
+ 'offer_id' => ENV['TEST_OFFER_ID_2'],
26
+ 'billing_model_id' => ENV['TEST_BILLING_MODEL_ID_2'],
27
+ 'quantity' => ENV['TEST_QUANTITY_2']
28
+ }
29
+ },
30
+ 'shipping_id' => ENV['TEST_SHIPPINGID'],
31
+ 'campaign_id' => ENV['TEST_CAMPAIGNID'],
32
+ 'notes' => Faker::FamilyGuy.quote,
33
+ 'utm_source' => Faker::FamilyGuy.quote,
34
+ 'utm_medium' => Faker::FamilyGuy.quote,
35
+ 'utm_campaign' => Faker::FamilyGuy.quote,
36
+ 'utm_content' => Faker::FamilyGuy.quote,
37
+ 'utm_term' => Faker::FamilyGuy.quote
38
+ })
39
+ expect(response[:success]).to eq true
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,58 @@
1
+ require 'spec_helper'
2
+ require 'faker'
3
+ Faker::Config.locale = 'en-US'
4
+
5
+ RSpec.describe LimeLightPlatform, "#NewOrderWithProspect" do
6
+ context "Lime Light Platform - Transact API - NewOrderWithProspect" do
7
+ it "Creates and processes a new order based upon an existing prospect record" do
8
+ lime_light = LimeLightPlatform.new(
9
+ ENV['APP_KEY'],
10
+ ENV['API_USERNAME'],
11
+ ENV['API_PASSWORD'],
12
+ ENV['DEV_SUB'],
13
+ true
14
+ )
15
+ response = lime_light.new_order_with_prospect({
16
+ 'prospect_id' => ENV['TEST_NEW_ORDER_WITH_PROSPECT_PROSPECT_ID'],
17
+ 'shipping_country' => ENV['TEST_SHIPPINGCOUNTRY'],
18
+ 'billing_first_name' => Faker::Name.first_name,
19
+ 'billing_last_name' => Faker::Name.last_name,
20
+ 'billing_address_1' => Faker::Address.street_address,
21
+ 'billing_address_2' => Faker::Address.secondary_address,
22
+ 'billing_city' => Faker::Address.city,
23
+ 'billing_state' => Faker::Address.state_abbr,
24
+ 'billing_zip' => Faker::Address.postcode,
25
+ 'billing_country' => ENV['TEST_BILLINGCOUNTRY'],
26
+ 'phone' => Faker::PhoneNumber.phone_number,
27
+ 'email' => Faker::Internet.email,
28
+ 'credit_card_type' => ENV['TEST_CREDITCARDTYPE'],
29
+ 'credit_card_number' => ENV['TEST_CREDITCARDNUMBER'],
30
+ 'expiration_date' => ENV['TEST_EXPIRATIONDATE'],
31
+ 'cvv' => ENV['TEST_CVV'],
32
+ 'shipping_id' => ENV['TEST_SHIPPINGID'],
33
+ 'tran_type' => ENV['TEST_TRANTYPE'],
34
+ 'ip_address' => ENV['TEST_IPADDRESS'],
35
+ 'campaign_id' => ENV['TEST_CAMPAIGNID'],
36
+ 'notes' => Faker::FamilyGuy.quote,
37
+ 'utm_source' => Faker::FamilyGuy.quote,
38
+ 'utm_medium' => Faker::FamilyGuy.quote,
39
+ 'utm_campaign' => Faker::FamilyGuy.quote,
40
+ 'utm_content' => Faker::FamilyGuy.quote,
41
+ 'utm_term' => Faker::FamilyGuy.quote,
42
+ 'products' => {
43
+ ENV['TEST_PRODUCT_1'] => {
44
+ 'offer_id' => ENV['TEST_OFFER_ID_1'],
45
+ 'billing_model_id' => ENV['TEST_BILLING_MODEL_ID_1'],
46
+ 'quantity' => ENV['TEST_QUANTITY_1']
47
+ },
48
+ ENV['TEST_PRODUCT_2'] => {
49
+ 'offer_id' => ENV['TEST_OFFER_ID_2'],
50
+ 'billing_model_id' => ENV['TEST_BILLING_MODEL_ID_2'],
51
+ 'quantity' => ENV['TEST_QUANTITY_2']
52
+ }
53
+ }
54
+ })
55
+ expect(response[:success]).to eq true
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+ require 'faker'
3
+ Faker::Config.locale = 'en-US'
4
+
5
+ RSpec.describe LimeLightPlatform, "#NewProspect" do
6
+ context "Lime Light Platform - Transact API - NewProspect" do
7
+ it "Creates a prospect record" do
8
+ lime_light = LimeLightPlatform.new(
9
+ ENV['APP_KEY'],
10
+ ENV['API_USERNAME'],
11
+ ENV['API_PASSWORD'],
12
+ ENV['DEV_SUB'],
13
+ true
14
+ )
15
+ response = lime_light.new_prospect({
16
+ 'campaign_id' => ENV['TEST_NEW_PROSPECT_CAMPAIGN_ID'],
17
+ 'ip_address' => ENV['TEST_NEW_PROSPECT_IP_ADDRESS'],
18
+ 'email' => Faker::Internet.email,
19
+ 'first_name' => Faker::Name.first_name,
20
+ 'last_name' => Faker::Name.last_name,
21
+ 'address_1' => Faker::Address.street_address,
22
+ 'address_2' => Faker::Address.secondary_address,
23
+ 'city' => Faker::Address.city,
24
+ 'state' => Faker::Address.state_abbr,
25
+ 'zip' => Faker::Address.postcode,
26
+ 'country' => ENV['TEST_SHIPPINGCOUNTRY'],
27
+ 'phone' => Faker::PhoneNumber.phone_number,
28
+ 'afid' => Faker::Pokemon.name,
29
+ 'afid' => Faker::Pokemon.name,
30
+ 'affid' => Faker::Pokemon.name,
31
+ 'c1' => Faker::Pokemon.name,
32
+ 'c2' => Faker::Pokemon.name,
33
+ 'c3' => Faker::Pokemon.name,
34
+ 'aid' => Faker::Pokemon.name,
35
+ 'opt' => Faker::Pokemon.name,
36
+ 'click_id' => Faker::PhoneNumber.phone_number,
37
+ 'notes' => Faker::FamilyGuy.quote,
38
+ })
39
+ expect(response[:success]).to eq true
40
+ end
41
+ end
42
+ end
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#order_find_updated" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  group_key_options = [
14
14
  [
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#repost_to_fulfillment" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  response = lime_light.repost_to_fulfillment ENV['TEST_REPOST_TO_FULFILLMENT_ORDER_ID']
14
14
  expect(response[:success]).to eq true
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#shipping_method_find" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  criteria = [
14
14
  { 'code' => ENV['TEST_SHIPPING_METHOD_FIND_CRITERIA_CODE'] },
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#shipping_method_view" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  response = lime_light.shipping_method_view ENV['TEST_SHIPPING_METHOD_VIEW_SHIPPING_ID']
14
14
  expect(response[:success]).to eq true
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#skip_next_billing" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  response = lime_light.skip_next_billing ENV['TEST_SKIP_NEXT_BILLING_SUBSCRIPTION_ID']
14
14
  expect(response[:success]).to eq true
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#subscription_order_update" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  response = lime_light.subscription_order_update({
14
14
  'order_id' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_ORDER_ID'],
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#subscription_update" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  response = lime_light.subscription_update({
14
14
  'subscription_id' => {
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe LimeLightPlatform, "#three_d_secure" do
4
+ context "Lime Light Platform - Transact API - three_d_secure" do
5
+ it "Returns 3DS data for customer redirect" do
6
+ lime_light = LimeLightPlatform.new(
7
+ ENV['APP_KEY'],
8
+ ENV['API_USERNAME'],
9
+ ENV['API_PASSWORD'],
10
+ ENV['DEV_SUB'],
11
+ true
12
+ )
13
+ response = lime_light.three_d_redirect ENV['TEST_THREE_D_REDIRECT_ORDER_ID']
14
+ expect(response[:success]).to eq true
15
+ end
16
+ end
17
+ end
@@ -8,7 +8,7 @@ RSpec.describe LimeLightPlatform, "#upsell_stop_recurring" do
8
8
  ENV['API_USERNAME'],
9
9
  ENV['API_PASSWORD'],
10
10
  ENV['DEV_SUB'],
11
- true
11
+ false
12
12
  )
13
13
  response = lime_light.upsell_stop_recurring({
14
14
  'order_id' => ENV['TEST_UPSELL_STOP_RECURRING_ORDER_ID'],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lime_light_platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.18
4
+ version: 1.0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Titus-Casseus
@@ -28,7 +28,9 @@ files:
28
28
  - lime_light_platform-1.0.0.15.gem
29
29
  - lime_light_platform-1.0.0.16.gem
30
30
  - lime_light_platform-1.0.0.17.gem
31
+ - lime_light_platform-1.0.0.18.gem
31
32
  - lime_light_platform.gemspec
33
+ - spec/authorize_payment_spec.rb
32
34
  - spec/billing_model_view_spec.rb
33
35
  - spec/campaign_find_active_spec.rb
34
36
  - spec/campaign_view_spec.rb
@@ -36,7 +38,10 @@ files:
36
38
  - spec/customer_view_spec.rb
37
39
  - spec/gateway_view_spec.rb
38
40
  - spec/get_alternative_provider_spec.rb
41
+ - spec/new_order_card_on_file_spec.rb
39
42
  - spec/new_order_spec.rb
43
+ - spec/new_order_with_prospect_spec.rb
44
+ - spec/new_prospect_spec.rb
40
45
  - spec/offer_view_spec.rb
41
46
  - spec/order_find_spec.rb
42
47
  - spec/order_find_updated_spec.rb
@@ -62,6 +67,7 @@ files:
62
67
  - spec/spec_helper.rb
63
68
  - spec/subscription_order_update_spec.rb
64
69
  - spec/subscription_update_spec.rb
70
+ - spec/three_d_redirect_spec.rb
65
71
  - spec/upsell_stop_recurring_spec.rb
66
72
  - spec/validate_credentials_spec.rb
67
73
  homepage: https://rubygems.org/gems/lime_light_platform