activemerchant 1.63.0 → 1.64.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.
@@ -77,12 +77,14 @@ module ActiveMerchant #:nodoc:
77
77
  self.homepage_url = 'http://www.usaepay.com/'
78
78
  self.display_name = 'USA ePay Advanced SOAP Interface'
79
79
 
80
- CUSTOMER_OPTIONS = {
80
+ CUSTOMER_PROFILE_OPTIONS = {
81
81
  :id => [:string, 'CustomerID'], # merchant assigned number
82
82
  :notes => [:string, 'Notes'],
83
83
  :data => [:string, 'CustomData'],
84
- :url => [:string, 'URL'],
85
- # Recurring Billing
84
+ :url => [:string, 'URL']
85
+ } #:nodoc:
86
+
87
+ CUSTOMER_RECURRING_BILLING_OPTIONS = {
86
88
  :enabled => [:boolean, 'Enabled'],
87
89
  :schedule => [:string, 'Schedule'],
88
90
  :number_left => [:integer, 'NumLeft'],
@@ -92,18 +94,24 @@ module ActiveMerchant #:nodoc:
92
94
  :user => [:string, 'User'],
93
95
  :source => [:string, 'Source'],
94
96
  :send_receipt => [:boolean, 'SendReceipt'],
95
- :receipt_note => [:string, 'ReceiptNote'],
96
- # Point of Sale
97
+ :receipt_note => [:string, 'ReceiptNote']
98
+ } #:nodoc:
99
+
100
+ CUSTOMER_POINT_OF_SALE_OPTIONS = {
97
101
  :price_tier => [:string, 'PriceTier'],
98
102
  :tax_class => [:string, 'TaxClass'],
99
103
  :lookup_code => [:string, 'LookupCode']
100
104
  } #:nodoc:
101
105
 
102
- ADDRESS_OPTIONS = {
106
+ CUSTOMER_OPTIONS = [
107
+ CUSTOMER_PROFILE_OPTIONS,
108
+ CUSTOMER_RECURRING_BILLING_OPTIONS,
109
+ CUSTOMER_POINT_OF_SALE_OPTIONS
110
+ ].inject(:merge) #:nodoc:
111
+
112
+ COMMON_ADDRESS_OPTIONS = {
103
113
  :first_name => [:string, 'FirstName'],
104
114
  :last_name => [:string, 'LastName'],
105
- :address1 => [:string, 'Street'],
106
- :address2 => [:string, 'Street2'],
107
115
  :city => [:string, 'City'],
108
116
  :state => [:string, 'State'],
109
117
  :zip => [:string, 'Zip'],
@@ -114,6 +122,32 @@ module ActiveMerchant #:nodoc:
114
122
  :company => [:string, 'Company']
115
123
  } #:nodoc:
116
124
 
125
+ ADDRESS_OPTIONS = [
126
+ COMMON_ADDRESS_OPTIONS,
127
+ {
128
+ :address1 => [:string, 'Street'],
129
+ :address2 => [:string, 'Street2'],
130
+ }
131
+ ].inject(:merge) #:nodoc
132
+
133
+ CUSTOMER_UPDATE_DATA_FIELDS = [
134
+ CUSTOMER_PROFILE_OPTIONS,
135
+ CUSTOMER_RECURRING_BILLING_OPTIONS,
136
+ COMMON_ADDRESS_OPTIONS,
137
+ {
138
+ :address1 => [:string, 'Address'],
139
+ :address2 => [:string, 'Address2'],
140
+ },
141
+ {
142
+ :card_number => [:string, 'CardNumber'],
143
+ :card_exp => [:string, 'CardExp'],
144
+ :account => [:string, 'Account'],
145
+ :routing => [:string, 'Routing'],
146
+ :check_format => [:string, 'CheckFormat'],
147
+ :record_type => [:string, 'RecordType'],
148
+ }
149
+ ].inject(:merge) #:nodoc
150
+
117
151
  CUSTOMER_TRANSACTION_REQUEST_OPTIONS = {
118
152
  :command => [:string, 'Command'],
119
153
  :ignore_duplicate => [:boolean, 'IgnoreDuplicate'],
@@ -354,6 +388,55 @@ module ActiveMerchant #:nodoc:
354
388
  commit(__method__, request)
355
389
  end
356
390
 
391
+ # Update a customer by replacing only the provided fields.
392
+ #
393
+ # ==== Required
394
+ # * <tt>:customer_number</tt> -- customer to update
395
+ # * <tt>:update_data</tt> -- FieldValue array of fields to retrieve
396
+ # * <tt>:first_name</tt>
397
+ # * <tt>:last_name</tt>
398
+ # * <tt>:id</tt>
399
+ # * <tt>:company</tt>
400
+ # * <tt>:address</tt>
401
+ # * <tt>:address2</tt>
402
+ # * <tt>:city</tt>
403
+ # * <tt>:state</tt>
404
+ # * <tt>:zip</tt>
405
+ # * <tt>:country</tt>
406
+ # * <tt>:phone</tt>
407
+ # * <tt>:fax</tt>
408
+ # * <tt>:email</tt>
409
+ # * <tt>:url</tt>
410
+ # * <tt>:receipt_note</tt>
411
+ # * <tt>:send_receipt</tt>
412
+ # * <tt>:notes</tt>
413
+ # * <tt>:description</tt>
414
+ # * <tt>:order_id</tt>
415
+ # * <tt>:enabled</tt>
416
+ # * <tt>:schedule</tt>
417
+ # * <tt>:next</tt>
418
+ # * <tt>:num_left</tt>
419
+ # * <tt>:amount</tt>
420
+ # * <tt>:custom_data</tt>
421
+ # * <tt>:source</tt>
422
+ # * <tt>:user</tt>
423
+ # * <tt>:card_number</tt>
424
+ # * <tt>:card_exp</tt>
425
+ # * <tt>:account</tt>
426
+ # * <tt>:routing</tt>
427
+ # * <tt>:check_format</tt> or <tt>:record_type</tt>
428
+ #
429
+ # ==== Response
430
+ # * <tt>#message</tt> -- boolean; Returns true if successful. Exception thrown all failures.
431
+ #
432
+ def quick_update_customer(options={})
433
+ requires! options, :customer_number
434
+ requires! options, :update_data
435
+
436
+ request = build_request(__method__, options)
437
+ commit(__method__, request)
438
+ end
439
+
357
440
  # Enable a customer for recurring billing.
358
441
  #
359
442
  # Note: Customer does not need to have all recurring parameters to succeed.
@@ -1019,6 +1102,14 @@ module ActiveMerchant #:nodoc:
1019
1102
  build_customer(soap, options, 'deleteCustomer')
1020
1103
  end
1021
1104
 
1105
+ def build_quick_update_customer(soap, options)
1106
+ soap.tag! "ns1:quickUpdateCustomer" do
1107
+ build_token soap, options
1108
+ build_tag soap, :integer, 'CustNum', options[:customer_number]
1109
+ build_field_value_array soap, "UpdateData", "FieldValue", options[:update_data], CUSTOMER_UPDATE_DATA_FIELDS
1110
+ end
1111
+ end
1112
+
1022
1113
  def build_add_customer_payment_method(soap, options)
1023
1114
  soap.tag! "ns1:addCustomerPaymentMethod" do
1024
1115
  build_token soap, options
@@ -1408,6 +1499,21 @@ module ActiveMerchant #:nodoc:
1408
1499
  end
1409
1500
  end
1410
1501
 
1502
+ def build_field_value_array(soap, tag_name, type, custom_data, fields)
1503
+ soap.tag! tag_name, 'SOAP-ENC:arryType' => "xsd:#{type}[#{options.length}]", 'xsi:type' => "ns1:#{type}Array" do
1504
+ custom_data.each do |k, v|
1505
+ build_field_value soap, fields[k][1], v, fields[k][0] if fields.keys.include? k
1506
+ end
1507
+ end
1508
+ end
1509
+
1510
+ def build_field_value(soap, field, value, value_type)
1511
+ soap.FieldValue 'xsi:type' => 'ns1:FieldValue' do
1512
+ build_tag soap, :string, 'Field', field
1513
+ build_tag soap, value_type, 'Value', value
1514
+ end
1515
+ end
1516
+
1411
1517
  def build_line_items(soap, options) # TODO
1412
1518
  end
1413
1519
 
@@ -1511,4 +1617,3 @@ module ActiveMerchant #:nodoc:
1511
1617
  end
1512
1618
  end
1513
1619
  end
1514
-
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  self.default_currency = 'USD'
11
11
  self.display_name = 'WePay'
12
12
 
13
- API_VERSION = "2016-12-07"
13
+ API_VERSION = "2017-02-01"
14
14
 
15
15
  def initialize(options = {})
16
16
  requires!(options, :client_id, :account_id, :access_token)
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.63.0"
2
+ VERSION = "1.64.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.63.0
4
+ version: 1.64.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-02 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -206,6 +206,7 @@ files:
206
206
  - lib/active_merchant/billing/gateways/cyber_source.rb
207
207
  - lib/active_merchant/billing/gateways/data_cash.rb
208
208
  - lib/active_merchant/billing/gateways/dibs.rb
209
+ - lib/active_merchant/billing/gateways/digitzs.rb
209
210
  - lib/active_merchant/billing/gateways/efsnet.rb
210
211
  - lib/active_merchant/billing/gateways/elavon.rb
211
212
  - lib/active_merchant/billing/gateways/element.rb
@@ -243,6 +244,7 @@ files:
243
244
  - lib/active_merchant/billing/gateways/itransact.rb
244
245
  - lib/active_merchant/billing/gateways/jetpay.rb
245
246
  - lib/active_merchant/billing/gateways/komoju.rb
247
+ - lib/active_merchant/billing/gateways/kushki.rb
246
248
  - lib/active_merchant/billing/gateways/latitude19.rb
247
249
  - lib/active_merchant/billing/gateways/linkpoint.rb
248
250
  - lib/active_merchant/billing/gateways/litle.rb
@@ -404,7 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
406
  version: '0'
405
407
  requirements: []
406
408
  rubyforge_project: activemerchant
407
- rubygems_version: 2.5.1
409
+ rubygems_version: 2.5.2
408
410
  signing_key:
409
411
  specification_version: 4
410
412
  summary: Framework and tools for dealing with credit card transactions.