authorizenet 1.9.3 → 1.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/authorize_net/api/api_transaction.rb +1 -0
- data/lib/authorize_net/api/constants.yml +1 -1
- data/lib/authorize_net/api/schema.rb +162 -26
- data/lib/authorize_net/api/transaction.rb +42 -37
- data/lib/authorize_net/authorize_net.rb +45 -38
- data/lib/authorize_net/response.rb +5 -3
- data/lib/authorize_net/sim/transaction.rb +3 -3
- data/lib/authorize_net/transaction.rb +14 -8
- metadata +33 -19
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OGRkMWUxNmJjZTkxNGUyZTQ2NGE3M2UzNTMxM2ViMjQzZDEzZDhhYg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fdc6b7f7d2066705389a3e6de82342122e5f0269
|
4
|
+
data.tar.gz: af3dfb28bfd9821e610a811464970066b7c6fcb4
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
N2ZhNWM5ZTI5YzM1YTIyN2EzYTJmN2NhNTI0NWVkZWIwYmVmMjU5ZjRmMDU2
|
11
|
-
MjNiNjE3ODk1NjhmMWQ1NWU2MWQ1MTA2YTlkNTFlMmQyMTY3YjQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MTVmMGZlZmJiNTg3YTJlMWQzMWM2YjRkMjY2ZWFjZjQ3Y2I5OWNjMjRmNmU2
|
14
|
-
NjVlOGViNGJkNjQ5YmZjZWUzMzJkNmMyOWY1NjY2NGFjMDc4NzFkNWMzZDQz
|
15
|
-
N2NkNWFlNmQ4NGE5OTJlNzEwOGVmOWQ5ZGUzMTVkMWQzYzA5YTM=
|
6
|
+
metadata.gz: a3c1047f8a572d31cf9798f2343043c85a8913abb42e24117253d052c79fbd03174f33f8b343be732685f8bdfaa4bf0bb457a1cce3bd62270b0b432fae07eb2d
|
7
|
+
data.tar.gz: 4ce68ca0f15b4a0304541927ba010bc7e5373c8acef649cca9356bcded77a55aa47bfab552ddf1c8c2299c13547393116b75a0cd5e47fac0bbfa8e1b6d5be617
|
@@ -51,6 +51,7 @@ module AuthorizeNet::API
|
|
51
51
|
API_GET_MERCHANT_DETAILS = "getMerchantDetailsRequest"
|
52
52
|
API_GET_HOSTED_PAYMENT_PAGE = "getHostedPaymentPageRequest"
|
53
53
|
API_UDPATE_HELD_TRANSACTION = "updateHeldTransactionRequest"
|
54
|
+
API_UPDATE_MERCHANT_DETAILS = "updateMerchantDetailsRequest"
|
54
55
|
|
55
56
|
end
|
56
57
|
|
@@ -1 +1 @@
|
|
1
|
-
clientId: sdk-ruby-1.9.
|
1
|
+
clientId: sdk-ruby-1.9.4
|
@@ -24,10 +24,6 @@ module AuthorizeNet::API
|
|
24
24
|
class ArrayOfBatchStatisticType < ::Array
|
25
25
|
end
|
26
26
|
|
27
|
-
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfSetting
|
28
|
-
class ArrayOfSetting < ::Array
|
29
|
-
end
|
30
|
-
|
31
27
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}emailSettingsType
|
32
28
|
# setting - SettingType
|
33
29
|
# xmlattr_version - SOAP::SOAPInteger
|
@@ -244,10 +240,14 @@ module AuthorizeNet::API
|
|
244
240
|
include ROXML
|
245
241
|
xml_accessor :marketType
|
246
242
|
xml_accessor :deviceType
|
243
|
+
xml_accessor :customerSignature
|
244
|
+
xml_accessor :terminalNumber
|
247
245
|
|
248
|
-
def initialize(marketType = nil, deviceType = nil)
|
246
|
+
def initialize(marketType = nil, deviceType = nil, customerSignature = nil, terminalNumber = nil)
|
249
247
|
@marketType = marketType
|
250
248
|
@deviceType = deviceType
|
249
|
+
@customerSignature = customerSignature
|
250
|
+
@terminalNumber = terminalNumber
|
251
251
|
end
|
252
252
|
end
|
253
253
|
|
@@ -313,12 +313,14 @@ module AuthorizeNet::API
|
|
313
313
|
xml_accessor :expirationDate
|
314
314
|
xml_accessor :cardType
|
315
315
|
xml_accessor :cardArt
|
316
|
+
xml_accessor :issuerNumber
|
316
317
|
|
317
|
-
def initialize(cardNumber = nil, expirationDate = nil, cardType = nil)
|
318
|
+
def initialize(cardNumber = nil, expirationDate = nil, cardType = nil, cardArt = nil, issuerNumber = nil)
|
318
319
|
@cardNumber = cardNumber
|
319
320
|
@expirationDate = expirationDate
|
320
321
|
@cardType = cardType
|
321
322
|
@cardArt = cardArt
|
323
|
+
@issuerNumber = issuerNumber
|
322
324
|
end
|
323
325
|
end
|
324
326
|
|
@@ -995,7 +997,41 @@ end
|
|
995
997
|
end
|
996
998
|
end
|
997
999
|
|
998
|
-
|
1000
|
+
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}subMerchantType
|
1001
|
+
# identifier - SOAP::SOAPString
|
1002
|
+
# doingBusinessAs - SOAP::SOAPString
|
1003
|
+
# paymentServiceProviderName - SOAP::SOAPString
|
1004
|
+
# paymentServiceFacilitator - SOAP::SOAPString
|
1005
|
+
# streetAddress - SOAP::SOAPString
|
1006
|
+
class SubMerchantType
|
1007
|
+
include ROXML
|
1008
|
+
xml_accessor :identifier
|
1009
|
+
xml_accessor :doingBusinessAs
|
1010
|
+
xml_accessor :paymentServiceProviderName
|
1011
|
+
xml_accessor :paymentServiceFacilitator
|
1012
|
+
xml_accessor :streetAddress
|
1013
|
+
xml_accessor :phone
|
1014
|
+
xml_accessor :email
|
1015
|
+
xml_accessor :postalCode
|
1016
|
+
xml_accessor :city
|
1017
|
+
xml_accessor :regionCode
|
1018
|
+
xml_accessor :countryCode
|
1019
|
+
|
1020
|
+
def initialize(identifier = nil, doingBusinessAs = nil, paymentServiceProviderName = nil, paymentServiceFacilitator = nil, streetAddress = nil, phone = nil, email = nil, postalCode = nil, city = nil, regionCode = nil, countryCode = nil )
|
1021
|
+
@identifier = identifier
|
1022
|
+
@doingBusinessAs = doingBusinessAs
|
1023
|
+
@paymentServiceProviderName = paymentServiceProviderName
|
1024
|
+
@paymentServiceFacilitator = paymentServiceFacilitator
|
1025
|
+
@streetAddress = streetAddress
|
1026
|
+
@phone = phone
|
1027
|
+
@email = email
|
1028
|
+
@postalCode = postalCode
|
1029
|
+
@city = city
|
1030
|
+
@regionCode = regionCode
|
1031
|
+
@countryCode = countryCode
|
1032
|
+
end
|
1033
|
+
end
|
1034
|
+
|
999
1035
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}settingType
|
1000
1036
|
# settingName - SOAP::SOAPString
|
1001
1037
|
# settingValue - SOAP::SOAPString
|
@@ -1017,7 +1053,7 @@ end
|
|
1017
1053
|
@settings = settings
|
1018
1054
|
end
|
1019
1055
|
end
|
1020
|
-
|
1056
|
+
|
1021
1057
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}permissionType
|
1022
1058
|
# permissionName - SOAP::SOAPString
|
1023
1059
|
class PermissionType
|
@@ -1698,7 +1734,7 @@ end
|
|
1698
1734
|
xml_accessor :marketType
|
1699
1735
|
xml_accessor :product
|
1700
1736
|
xml_accessor :mobileDeviceId
|
1701
|
-
xml_accessor :subscription
|
1737
|
+
xml_accessor :subscription, :as => SubscriptionPaymentType
|
1702
1738
|
xml_accessor :hasReturnedItems
|
1703
1739
|
xml_accessor :fraudInformation
|
1704
1740
|
xml_accessor :profile, :as => CustomerProfileIdType
|
@@ -1724,6 +1760,26 @@ end
|
|
1724
1760
|
end
|
1725
1761
|
end
|
1726
1762
|
|
1763
|
+
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}arbTransaction
|
1764
|
+
# transId - (any)
|
1765
|
+
# response - SOAP::SOAPString
|
1766
|
+
# submitTimeUTC - SOAP::SOAPDateTime
|
1767
|
+
# payNum - SOAP::SOAPString
|
1768
|
+
class ArbTransaction
|
1769
|
+
include ROXML
|
1770
|
+
xml_accessor :transId
|
1771
|
+
xml_accessor :response
|
1772
|
+
xml_accessor :submitTimeUTC
|
1773
|
+
xml_accessor :payNum
|
1774
|
+
|
1775
|
+
def initialize(transId = nil, response = nil, submitTimeUTC = nil, payNum = nil)
|
1776
|
+
@transId = transId
|
1777
|
+
@response = response
|
1778
|
+
@submitTimeUTC = submitTimeUTC
|
1779
|
+
@payNum = payNum
|
1780
|
+
end
|
1781
|
+
end
|
1782
|
+
|
1727
1783
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfTransactionSummaryType
|
1728
1784
|
class ArrayOfTransactionSummaryType < ::Array
|
1729
1785
|
include ROXML
|
@@ -1733,7 +1789,16 @@ end
|
|
1733
1789
|
@transaction = transaction
|
1734
1790
|
end
|
1735
1791
|
end
|
1736
|
-
|
1792
|
+
|
1793
|
+
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ARBTransactionList
|
1794
|
+
class ARBTransactionList < ::Array
|
1795
|
+
include ROXML
|
1796
|
+
xml_accessor :arbTransaction, :as => [ArbTransaction]
|
1797
|
+
|
1798
|
+
def initialize(arbTransaction = [])
|
1799
|
+
@arbTransaction = arbTransaction
|
1800
|
+
end
|
1801
|
+
end
|
1737
1802
|
|
1738
1803
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}batchStatisticType
|
1739
1804
|
# accountType - SOAP::SOAPString
|
@@ -1967,7 +2032,7 @@ end
|
|
1967
2032
|
xml_accessor :transactionStatus
|
1968
2033
|
xml_accessor :responseCode
|
1969
2034
|
xml_accessor :responseReasonCode
|
1970
|
-
xml_accessor :subscription
|
2035
|
+
xml_accessor :subscription, :as => SubscriptionPaymentType
|
1971
2036
|
xml_accessor :responseReasonDescription
|
1972
2037
|
xml_accessor :authCode
|
1973
2038
|
xml_accessor :aVSResponse
|
@@ -1998,9 +2063,12 @@ end
|
|
1998
2063
|
xml_accessor :returnedItems, :as => ArrayOfReturnedItem
|
1999
2064
|
xml_accessor :solution
|
2000
2065
|
xml_accessor :emvDetails, :as => EmvDetails
|
2001
|
-
|
2066
|
+
xml_accessor :profile, :as => CustomerProfileIdType
|
2067
|
+
xml_accessor :surcharge, :as => ExtendedAmountType
|
2068
|
+
xml_accessor :employeeId
|
2069
|
+
xml_accessor :tip, :as => ExtendedAmountType
|
2002
2070
|
|
2003
|
-
def initialize(transId = nil, refTransId = nil, splitTenderId = nil, submitTimeUTC = nil, submitTimeLocal = nil, transactionType = nil, transactionStatus = nil, responseCode = nil, responseReasonCode = nil, subscription = nil, responseReasonDescription = nil, authCode = nil, aVSResponse = nil, cardCodeResponse = nil, cAVVResponse = nil, fDSFilterAction = nil, fDSFilters = nil, batch = nil, order = nil, requestedAmount = nil, authAmount = nil, settleAmount = nil, tax = nil, shipping = nil, duty = nil, lineItems = nil, prepaidBalanceRemaining = nil, taxExempt = nil, payment = nil, customer = nil, billTo = nil, shipTo = nil, recurringBilling = nil, customerIP = nil, product = nil, marketType = nil, mobileDeviceId = nil, returnedItems = nil, solution = nil, emvDetails = nil, profile = nil)
|
2071
|
+
def initialize(transId = nil, refTransId = nil, splitTenderId = nil, submitTimeUTC = nil, submitTimeLocal = nil, transactionType = nil, transactionStatus = nil, responseCode = nil, responseReasonCode = nil, subscription = nil, responseReasonDescription = nil, authCode = nil, aVSResponse = nil, cardCodeResponse = nil, cAVVResponse = nil, fDSFilterAction = nil, fDSFilters = nil, batch = nil, order = nil, requestedAmount = nil, authAmount = nil, settleAmount = nil, tax = nil, shipping = nil, duty = nil, lineItems = nil, prepaidBalanceRemaining = nil, taxExempt = nil, payment = nil, customer = nil, billTo = nil, shipTo = nil, recurringBilling = nil, customerIP = nil, product = nil, marketType = nil, mobileDeviceId = nil, returnedItems = nil, solution = nil, emvDetails = nil, profile = nil, surcharge = nil, employeeId = nil, tip = nil)
|
2004
2072
|
@transId = transId
|
2005
2073
|
@refTransId = refTransId
|
2006
2074
|
@splitTenderId = splitTenderId
|
@@ -2041,7 +2109,10 @@ end
|
|
2041
2109
|
@returnedItems = returnedItems
|
2042
2110
|
@solution = solution
|
2043
2111
|
@emvDetails = emvDetails
|
2044
|
-
|
2112
|
+
@profile = profile
|
2113
|
+
@surcharge = surcharge
|
2114
|
+
@employeeId = employeeId
|
2115
|
+
@tip = tip
|
2045
2116
|
end
|
2046
2117
|
end
|
2047
2118
|
|
@@ -2535,7 +2606,7 @@ end
|
|
2535
2606
|
# cardCode - (any)
|
2536
2607
|
class PaymentProfile
|
2537
2608
|
include ROXML
|
2538
|
-
xml_accessor :paymentProfileId, :as =>
|
2609
|
+
xml_accessor :paymentProfileId, :as => Integer
|
2539
2610
|
xml_accessor :cardCode
|
2540
2611
|
|
2541
2612
|
def initialize(paymentProfileId = nil, cardCode = nil)
|
@@ -2552,9 +2623,9 @@ end
|
|
2552
2623
|
class CustomerProfilePaymentType
|
2553
2624
|
include ROXML
|
2554
2625
|
xml_accessor :createProfile
|
2555
|
-
xml_accessor :customerProfileId, :as =>
|
2626
|
+
xml_accessor :customerProfileId, :as => Integer
|
2556
2627
|
xml_accessor :paymentProfile, :as => PaymentProfile
|
2557
|
-
xml_accessor :shippingProfileId, :as =>
|
2628
|
+
xml_accessor :shippingProfileId, :as => Integer
|
2558
2629
|
|
2559
2630
|
def initialize(createProfile = nil, customerProfileId = nil, paymentProfile = nil, shippingProfileId = nil)
|
2560
2631
|
@createProfile = createProfile
|
@@ -2747,6 +2818,8 @@ end
|
|
2747
2818
|
MerchantEmail = SettingNameEnum.new("merchantEmail")
|
2748
2819
|
RecurringBilling = SettingNameEnum.new("recurringBilling")
|
2749
2820
|
TestRequest = SettingNameEnum.new("testRequest")
|
2821
|
+
TypeEmailReceipt = SettingNameEnum.new("typeEmailReceipt")
|
2822
|
+
HostedProfilePaymentOptions = SettingNameEnum.new("hostedProfilePaymentOptions")
|
2750
2823
|
end
|
2751
2824
|
|
2752
2825
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ARBGetSubscriptionListSearchTypeEnum
|
@@ -3165,14 +3238,16 @@ end
|
|
3165
3238
|
xml_accessor :merchantCustomerId
|
3166
3239
|
xml_accessor :email
|
3167
3240
|
xml_accessor :unmaskExpirationDate
|
3241
|
+
xml_accessor :includeIssuerInfo
|
3168
3242
|
|
3169
|
-
def initialize(merchantAuthentication = nil, refId = nil, customerProfileId = nil, unmaskExpirationDate = nil, merchantCustomerId = nil, email = nil)
|
3243
|
+
def initialize(merchantAuthentication = nil, refId = nil, customerProfileId = nil, unmaskExpirationDate = nil, merchantCustomerId = nil, email = nil, includeIssuerInfo = nil)
|
3170
3244
|
@merchantAuthentication = merchantAuthentication
|
3171
3245
|
@refId = refId
|
3172
3246
|
@customerProfileId = customerProfileId
|
3173
3247
|
@merchantCustomerId = merchantCustomerId
|
3174
3248
|
@email = email
|
3175
3249
|
@unmaskExpirationDate = unmaskExpirationDate
|
3250
|
+
@includeIssuerInfo = includeIssuerInfo
|
3176
3251
|
end
|
3177
3252
|
end
|
3178
3253
|
|
@@ -3212,13 +3287,15 @@ end
|
|
3212
3287
|
xml_accessor :customerProfileId
|
3213
3288
|
xml_accessor :customerPaymentProfileId
|
3214
3289
|
xml_accessor :unmaskExpirationDate
|
3290
|
+
xml_accessor :includeIssuerInfo
|
3215
3291
|
|
3216
|
-
def initialize(merchantAuthentication = nil, refId = nil, customerProfileId = nil, customerPaymentProfileId = nil, unmaskExpirationDate = nil)
|
3292
|
+
def initialize(merchantAuthentication = nil, refId = nil, customerProfileId = nil, customerPaymentProfileId = nil, unmaskExpirationDate = nil, includeIssuerInfo = nil)
|
3217
3293
|
@merchantAuthentication = merchantAuthentication
|
3218
3294
|
@refId = refId
|
3219
3295
|
@customerProfileId = customerProfileId
|
3220
3296
|
@customerPaymentProfileId = customerPaymentProfileId
|
3221
3297
|
@unmaskExpirationDate = unmaskExpirationDate
|
3298
|
+
@includeIssuerInfo = includeIssuerInfo
|
3222
3299
|
end
|
3223
3300
|
end
|
3224
3301
|
|
@@ -3864,7 +3941,7 @@ end
|
|
3864
3941
|
# merchantAuthentication - MerchantAuthenticationType
|
3865
3942
|
# refId - SOAP::SOAPString
|
3866
3943
|
# customerProfileId - (any)
|
3867
|
-
# hostedProfileSettings -
|
3944
|
+
# hostedProfileSettings - Settings
|
3868
3945
|
class GetHostedProfilePageRequest
|
3869
3946
|
include ROXML
|
3870
3947
|
xml_accessor :merchantAuthentication
|
@@ -4276,7 +4353,7 @@ end
|
|
4276
4353
|
# customerIP - SOAP::SOAPString
|
4277
4354
|
# cardholderAuthentication - CcAuthenticationType
|
4278
4355
|
# retail - TransRetailInfoType
|
4279
|
-
# transactionSettings -
|
4356
|
+
# transactionSettings - Settings
|
4280
4357
|
# userFields - TransactionRequestType::UserFields
|
4281
4358
|
class TransactionRequestType
|
4282
4359
|
include ROXML
|
@@ -4305,8 +4382,12 @@ end
|
|
4305
4382
|
xml_accessor :retail, :as => TransRetailInfoType
|
4306
4383
|
xml_accessor :transactionSettings, :as => Settings
|
4307
4384
|
xml_accessor :userFields, :as => UserFields
|
4385
|
+
xml_accessor :surcharge, :as => ExtendedAmountType
|
4386
|
+
xml_accessor :merchantDescriptor
|
4387
|
+
xml_accessor :subMerchant, :as => SubMerchantType
|
4388
|
+
xml_accessor :tip, :as => ExtendedAmountType
|
4308
4389
|
|
4309
|
-
def initialize(transactionType = nil, amount = nil, currencyCode = nil, payment = nil, profile = nil, solution = nil, callId = nil, authCode = nil, refTransId = nil, splitTenderId = nil, order = nil, lineItems = nil, tax = nil, duty = nil, shipping = nil, taxExempt = nil, poNumber = nil, customer = nil, billTo = nil, shipTo = nil, customerIP = nil, cardholderAuthentication = nil, retail = nil, transactionSettings = nil, userFields = nil)
|
4390
|
+
def initialize(transactionType = nil, amount = nil, currencyCode = nil, payment = nil, profile = nil, solution = nil, callId = nil, authCode = nil, refTransId = nil, splitTenderId = nil, order = nil, lineItems = nil, tax = nil, duty = nil, shipping = nil, taxExempt = nil, poNumber = nil, customer = nil, billTo = nil, shipTo = nil, customerIP = nil, cardholderAuthentication = nil, retail = nil, transactionSettings = nil, userFields = nil, surcharge = nil, merchantDescriptor = nil, subMerchant = nil, tip = nil)
|
4310
4391
|
@transactionType = transactionType
|
4311
4392
|
@amount = amount
|
4312
4393
|
@currencyCode = currencyCode
|
@@ -4332,6 +4413,10 @@ end
|
|
4332
4413
|
@retail = retail
|
4333
4414
|
@transactionSettings = transactionSettings
|
4334
4415
|
@userFields = userFields
|
4416
|
+
@surcharge = surcharge
|
4417
|
+
@merchantDescriptor = merchantDescriptor
|
4418
|
+
@subMerchant = subMerchant
|
4419
|
+
@tip = tip
|
4335
4420
|
end
|
4336
4421
|
end
|
4337
4422
|
|
@@ -4524,8 +4609,9 @@ end
|
|
4524
4609
|
xml_accessor :status
|
4525
4610
|
xml_accessor :profile, :as => SubscriptionCustomerProfileType
|
4526
4611
|
xml_accessor :order, :as => OrderType
|
4612
|
+
xml_accessor :arbTransactions, :as => ARBTransactionList
|
4527
4613
|
|
4528
|
-
def initialize(name = nil, paymentSchedule = nil, amount = nil, trialAmount = nil, status = nil, profile = nil, order = nil)
|
4614
|
+
def initialize(name = nil, paymentSchedule = nil, amount = nil, trialAmount = nil, status = nil, profile = nil, order = nil, arbTransactions = nil)
|
4529
4615
|
@name = name
|
4530
4616
|
@paymentSchedule = paymentSchedule
|
4531
4617
|
@amount = amount
|
@@ -4533,6 +4619,7 @@ end
|
|
4533
4619
|
@status = status
|
4534
4620
|
@profile = profile
|
4535
4621
|
@order = order
|
4622
|
+
@arbTransactions = arbTransactions
|
4536
4623
|
end
|
4537
4624
|
end
|
4538
4625
|
|
@@ -4540,16 +4627,19 @@ end
|
|
4540
4627
|
# merchantAuthentication - MerchantAuthenticationType
|
4541
4628
|
# refId - SOAP::SOAPString
|
4542
4629
|
# subscriptionId - (any)
|
4630
|
+
# includeTransactions - (any)
|
4543
4631
|
class ARBGetSubscriptionRequest
|
4544
4632
|
include ROXML
|
4545
4633
|
xml_accessor :merchantAuthentication, :as => MerchantAuthenticationType
|
4546
4634
|
xml_accessor :refId
|
4547
4635
|
xml_accessor :subscriptionId
|
4636
|
+
xml_accessor :includeTransactions
|
4548
4637
|
|
4549
|
-
def initialize(merchantAuthentication = nil, refId = nil, subscriptionId = nil)
|
4638
|
+
def initialize(merchantAuthentication = nil, refId = nil, subscriptionId = nil, includeTransactions = nil)
|
4550
4639
|
@merchantAuthentication = merchantAuthentication
|
4551
4640
|
@refId = refId
|
4552
4641
|
@subscriptionId = subscriptionId
|
4642
|
+
@includeTransactions = includeTransactions
|
4553
4643
|
end
|
4554
4644
|
end
|
4555
4645
|
|
@@ -4787,13 +4877,27 @@ end
|
|
4787
4877
|
end
|
4788
4878
|
end
|
4789
4879
|
|
4880
|
+
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ArrayOfCardType
|
4881
|
+
class ArrayOfCardType < ::Array
|
4882
|
+
include ROXML
|
4883
|
+
xml_accessor :cardType
|
4884
|
+
|
4885
|
+
def initialize(cardType = [])
|
4886
|
+
@cardType = cardType
|
4887
|
+
end
|
4888
|
+
end
|
4889
|
+
|
4790
4890
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}ProcessorType
|
4791
4891
|
class ProcessorType
|
4792
4892
|
include ROXML
|
4793
4893
|
xml_accessor :name
|
4894
|
+
xml_accessor :id
|
4895
|
+
xml_accessor :cardTypes, :as => [ArrayOfCardType]
|
4794
4896
|
|
4795
|
-
def initialize(name = nil)
|
4897
|
+
def initialize(name = nil, id = nil, cardTypes = nil)
|
4796
4898
|
@name = name
|
4899
|
+
@id = id
|
4900
|
+
@cardTypes = cardTypes
|
4797
4901
|
end
|
4798
4902
|
end
|
4799
4903
|
|
@@ -4861,6 +4965,8 @@ end
|
|
4861
4965
|
@currency = currency
|
4862
4966
|
end
|
4863
4967
|
end
|
4968
|
+
|
4969
|
+
|
4864
4970
|
|
4865
4971
|
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}getMerchantDetailsResponse
|
4866
4972
|
class GetMerchantDetailsResponse
|
@@ -4876,8 +4982,9 @@ end
|
|
4876
4982
|
xml_accessor :productCodes, :as => ArrayOfProductCode
|
4877
4983
|
xml_accessor :paymentMethods, :as => ArrayOfPaymentMethod
|
4878
4984
|
xml_accessor :currencies, :as => ArrayOfCurrencyCode
|
4985
|
+
xml_accessor :publicClientKey
|
4879
4986
|
|
4880
|
-
def initialize(refId = nil, messages = nil, sessionToken = nil, isTestMode = nil, processors = nil, merchantName = nil, gatewayId = nil, marketTypes = nil, productCodes = nil, paymentMethods = nil, currencies = nil)
|
4987
|
+
def initialize(refId = nil, messages = nil, sessionToken = nil, isTestMode = nil, processors = nil, merchantName = nil, gatewayId = nil, marketTypes = nil, productCodes = nil, paymentMethods = nil, currencies = nil, publicClientKey = nil)
|
4881
4988
|
@refId = refId
|
4882
4989
|
@messages = messages
|
4883
4990
|
@sessionToken = sessionToken
|
@@ -4889,6 +4996,35 @@ end
|
|
4889
4996
|
@productCodes = productCodes
|
4890
4997
|
@paymentMethods = paymentMethods
|
4891
4998
|
@currencies = currencies
|
4999
|
+
@publicClientKey = publicClientKey
|
5000
|
+
end
|
5001
|
+
end
|
5002
|
+
|
5003
|
+
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}updateMerchantDetailsRequest
|
5004
|
+
class UpdateMerchantDetailsRequest
|
5005
|
+
include ROXML
|
5006
|
+
xml_accessor :merchantAuthentication
|
5007
|
+
xml_accessor :refId
|
5008
|
+
xml_accessor :isTestMode
|
5009
|
+
|
5010
|
+
def initialize(merchantAuthentication = nil, refId = nil, isTestMode = nil)
|
5011
|
+
@merchantAuthentication = merchantAuthentication
|
5012
|
+
@refId = refId
|
5013
|
+
@isTestMode = isTestMode
|
5014
|
+
end
|
5015
|
+
end
|
5016
|
+
|
5017
|
+
# {AnetApi/xml/v1/schema/AnetApiSchema.xsd}updateMerchantDetailsResponse
|
5018
|
+
class UpdateMerchantDetailsResponse
|
5019
|
+
include ROXML
|
5020
|
+
xml_accessor :merchantAuthentication, :as => MerchantAuthenticationType
|
5021
|
+
xml_accessor :refId
|
5022
|
+
xml_accessor :messages, :as => MessagesType
|
5023
|
+
|
5024
|
+
def initialize(merchantAuthentication = nil, refId = nil, messages = nil)
|
5025
|
+
@merchantAuthentication = merchantAuthentication
|
5026
|
+
@refId = refId
|
5027
|
+
@messages = messages
|
4892
5028
|
end
|
4893
5029
|
end
|
4894
5030
|
|
@@ -7,58 +7,60 @@ module AuthorizeNet::API
|
|
7
7
|
super
|
8
8
|
end
|
9
9
|
|
10
|
-
# This request enables you to create a transaction, and optional
|
11
|
-
#
|
12
|
-
#
|
10
|
+
# This request enables you to create a transaction, and optional
|
11
|
+
# customer profile.
|
12
|
+
# NOTE: Network tokenized transactions (e.g. Apple Pay), or PayPal should
|
13
|
+
# not be used to create payment profiles.
|
13
14
|
#
|
14
15
|
# See spec/api_spec.rb for usage examples
|
15
16
|
def create_transaction(request)
|
16
17
|
make_request(request,CreateTransactionResponse,Type::API_CREATE_TRANSACTION)
|
17
18
|
end
|
18
19
|
|
19
|
-
# This request enables you to create a recurring billing subscription
|
20
|
+
# This request enables you to create a recurring billing subscription.
|
20
21
|
#
|
21
22
|
# See spec/api_spec.rb for usage examples
|
22
23
|
def create_subscription(request)
|
23
24
|
make_request(request,ARBCreateSubscriptionResponse,Type::API_CREATE_SUBSCRIPTION)
|
24
25
|
end
|
25
26
|
|
26
|
-
# This request enables you to update a recurring billing subscription
|
27
|
+
# This request enables you to update a recurring billing subscription.
|
27
28
|
#
|
28
29
|
# See spec/api_spec.rb for usage examples
|
29
30
|
def update_subscription(request)
|
30
31
|
make_request(request,ARBUpdateSubscriptionResponse,Type::API_UPDATE_SUBSCRIPTION)
|
31
32
|
end
|
32
33
|
|
33
|
-
# This request enables you to cancel a recurring billing subscription
|
34
|
+
# This request enables you to cancel a recurring billing subscription.
|
34
35
|
#
|
35
36
|
# See spec/api_spec.rb for usage examples
|
36
37
|
def cancel_subscription(request)
|
37
38
|
make_request(request,ARBCancelSubscriptionResponse,Type::API_CANCEL_SUBSCRIPTION)
|
38
39
|
end
|
39
40
|
|
40
|
-
# This request enables you to get a recurring billing subscription status
|
41
|
+
# This request enables you to get a recurring billing subscription status.
|
41
42
|
#
|
42
43
|
# See spec/api_spec.rb for usage examples
|
43
44
|
def get_subscription_status(request)
|
44
45
|
make_request(request,ARBGetSubscriptionStatusResponse,Type::API_GET_SUBSCRIPTION_STATUS)
|
45
46
|
end
|
46
47
|
|
47
|
-
# This request enables you to get a list of all recurring billing
|
48
|
+
# This request enables you to get a list of all recurring billing
|
49
|
+
# subscriptions.
|
48
50
|
#
|
49
51
|
# See spec/api_spec.rb for usage examples
|
50
52
|
def get_subscription_list(request)
|
51
53
|
make_request(request,ARBGetSubscriptionListResponse,Type::API_GET_SUBSCRIPTION_LIST)
|
52
54
|
end
|
53
55
|
|
54
|
-
# This request enables you to create a customer profile
|
56
|
+
# This request enables you to create a customer profile.
|
55
57
|
#
|
56
58
|
# See spec/api_spec.rb for usage examples
|
57
59
|
def create_customer_profile(request)
|
58
60
|
make_request(request,CreateCustomerProfileResponse,Type::API_CREATE_CUSTOMER_PROFILE)
|
59
61
|
end
|
60
62
|
|
61
|
-
# This request enables you to retrieve a customer profile
|
63
|
+
# This request enables you to retrieve a customer profile.
|
62
64
|
#
|
63
65
|
# See spec/api_spec.rb for usage examples
|
64
66
|
def get_customer_profile(request)
|
@@ -66,77 +68,77 @@ module AuthorizeNet::API
|
|
66
68
|
end
|
67
69
|
|
68
70
|
|
69
|
-
# This request enables you to retrieve all customer profile
|
71
|
+
# This request enables you to retrieve all customer profile IDs.
|
70
72
|
#
|
71
73
|
# See spec/api_spec.rb for usage examples
|
72
74
|
def get_customer_profile_ids(request)
|
73
75
|
make_request(request,GetCustomerProfileIdsResponse,Type::API_GET_CUSTOMER_PROFILE_IDS)
|
74
76
|
end
|
75
77
|
|
76
|
-
# This request enables you to update a customer profile
|
78
|
+
# This request enables you to update a customer profile.
|
77
79
|
#
|
78
80
|
# See spec/api_spec.rb for usage examples
|
79
81
|
def update_customer_profile(request)
|
80
82
|
make_request(request,UpdateCustomerProfileResponse,Type::API_UPDATE_CUSTOMER_PROFILE)
|
81
83
|
end
|
82
84
|
|
83
|
-
# This request enables you to delete a customer profile
|
85
|
+
# This request enables you to delete a customer profile.
|
84
86
|
#
|
85
87
|
# See spec/api_spec.rb for usage examples
|
86
88
|
def delete_customer_profile(request)
|
87
89
|
make_request(request,DeleteCustomerProfileResponse,Type::API_DELETE_CUSTOMER_PROFILE)
|
88
90
|
end
|
89
91
|
|
90
|
-
# This request enables you to create a customer payment profile
|
92
|
+
# This request enables you to create a customer payment profile.
|
91
93
|
#
|
92
94
|
# See spec/api_spec.rb for usage examples
|
93
95
|
def create_customer_payment_profile(request)
|
94
96
|
make_request(request,CreateCustomerPaymentProfileResponse,Type::API_CREATE_CUSTOMER_PAYMENT_PROFILE)
|
95
97
|
end
|
96
98
|
|
97
|
-
# This request enables you to retrieve a customer payment profile
|
99
|
+
# This request enables you to retrieve a customer payment profile.
|
98
100
|
#
|
99
101
|
# See spec/api_spec.rb for usage examples
|
100
102
|
def get_customer_payment_profile(request)
|
101
103
|
make_request(request,GetCustomerPaymentProfileResponse,Type::API_GET_CUSTOMER_PAYMENT_PROFILE)
|
102
104
|
end
|
103
105
|
|
104
|
-
# This request enables you to update a customer payment profile
|
106
|
+
# This request enables you to update a customer payment profile.
|
105
107
|
#
|
106
108
|
# See spec/api_spec.rb for usage examples
|
107
109
|
def update_customer_payment_profile(request)
|
108
110
|
make_request(request,UpdateCustomerPaymentProfileResponse,Type::API_UPDATE_CUSTOMER_PAYMENT_PROFILE)
|
109
111
|
end
|
110
112
|
|
111
|
-
# This request enables you to delete a customer payment profile
|
113
|
+
# This request enables you to delete a customer payment profile.
|
112
114
|
#
|
113
115
|
# See spec/api_spec.rb for usage examples
|
114
116
|
def delete_customer_payment_profile(request)
|
115
117
|
make_request(request,DeleteCustomerPaymentProfileResponse,Type::API_DELETE_CUSTOMER_PAYMENT_PROFILE)
|
116
118
|
end
|
117
119
|
|
118
|
-
# This request enables you to create a customer shipping profile
|
120
|
+
# This request enables you to create a customer shipping profile.
|
119
121
|
#
|
120
122
|
# See spec/api_spec.rb for usage examples
|
121
123
|
def create_customer_shipping_profile(request)
|
122
124
|
make_request(request,CreateCustomerShippingAddressResponse,Type::API_CREATE_CUSTOMER_SHIPPING_PROFILE)
|
123
125
|
end
|
124
126
|
|
125
|
-
# This request enables you to retrieve a customer shipping profile
|
127
|
+
# This request enables you to retrieve a customer shipping profile.
|
126
128
|
#
|
127
129
|
# See spec/api_spec.rb for usage examples
|
128
130
|
def get_customer_shipping_profile(request)
|
129
131
|
make_request(request,GetCustomerShippingAddressResponse,Type::API_GET_CUSTOMER_SHIPPING_PROFILE)
|
130
132
|
end
|
131
133
|
|
132
|
-
# This request enables you to update a customer shipping profile
|
134
|
+
# This request enables you to update a customer shipping profile.
|
133
135
|
#
|
134
136
|
# See spec/api_spec.rb for usage examples
|
135
137
|
def update_customer_shipping_profile(request)
|
136
138
|
make_request(request,UpdateCustomerShippingAddressResponse,Type::API_UPDATE_CUSTOMER_SHIPPING_PROFILE)
|
137
139
|
end
|
138
140
|
|
139
|
-
# This request enables you to delete a customer shipping profile
|
141
|
+
# This request enables you to delete a customer shipping profile.
|
140
142
|
#
|
141
143
|
# See spec/api_spec.rb for usage examples
|
142
144
|
def delete_customer_shipping_profile(request)
|
@@ -144,10 +146,10 @@ module AuthorizeNet::API
|
|
144
146
|
end
|
145
147
|
|
146
148
|
|
147
|
-
# This request enables you to create a customer profile, payment
|
148
|
-
# and shipping profile from an existing successful transaction.
|
149
|
-
# NOTE:
|
150
|
-
# create payment profiles.
|
149
|
+
# This request enables you to create a customer profile, payment
|
150
|
+
# profile, and shipping profile from an existing successful transaction.
|
151
|
+
# NOTE: Network tokenized transactions (e.g. Apple Pay), or PayPal
|
152
|
+
# should not be used to create payment profiles.
|
151
153
|
#
|
152
154
|
# See spec/api_spec.rb for usage examples
|
153
155
|
def create_customer_profile_from_transaction(request)
|
@@ -161,77 +163,77 @@ module AuthorizeNet::API
|
|
161
163
|
make_request(request,DecryptPaymentDataResponse,Type::API_DECRYPT_PAYMENT_DATA)
|
162
164
|
end
|
163
165
|
|
164
|
-
# This request enables confirm authentication values
|
166
|
+
# This request enables confirm authentication values.
|
165
167
|
#
|
166
168
|
# See spec/api_spec.rb for usage examples
|
167
169
|
def authenticate_test_request(request)
|
168
170
|
make_request(request,AuthenticateTestResponse,Type::API_AUTHENTICATE_TEST_REQUEST)
|
169
171
|
end
|
170
172
|
|
171
|
-
# This request enables you to get batch statistics details
|
173
|
+
# This request enables you to get batch statistics details.
|
172
174
|
#
|
173
175
|
# See spec/api_spec.rb for usage examples
|
174
176
|
def get_batch_statistics(request)
|
175
177
|
make_request(request,GetBatchStatisticsResponse,Type::API_GET_BATCH_STATISTICS)
|
176
178
|
end
|
177
179
|
|
178
|
-
# This request enables you to get batch transaction details
|
180
|
+
# This request enables you to get batch transaction details.
|
179
181
|
#
|
180
182
|
# See spec/api_spec.rb for usage examples
|
181
183
|
def get_transaction_details(request)
|
182
184
|
make_request(request,GetTransactionDetailsResponse,Type::API_GET_TRANSACTION_DETAILS)
|
183
185
|
end
|
184
186
|
|
185
|
-
# This request enables you to get batch settled transaction details
|
187
|
+
# This request enables you to get batch settled transaction details.
|
186
188
|
#
|
187
189
|
# See spec/api_spec.rb for usage examples
|
188
190
|
def get_settled_batch_list(request)
|
189
191
|
make_request(request,GetSettledBatchListResponse,Type::API_GET_SETTLED_BATCH_LIST)
|
190
192
|
end
|
191
193
|
|
192
|
-
# This request enables you to get batch unsettled transaction details
|
194
|
+
# This request enables you to get batch unsettled transaction details.
|
193
195
|
#
|
194
196
|
# See spec/api_spec.rb for usage examples
|
195
197
|
def get_unsettled_transaction_list(request)
|
196
198
|
make_request(request,GetUnsettledTransactionListResponse,Type::API_GET_UNSETTLED_TRANSACTION_LIST)
|
197
199
|
end
|
198
200
|
|
199
|
-
# This request enables confirm authentication values
|
201
|
+
# This request enables confirm authentication values.
|
200
202
|
#
|
201
203
|
# See spec/api_spec.rb for usage examples
|
202
204
|
def get_hosted_profile_page(request)
|
203
205
|
make_request(request,GetHostedProfilePageResponse,Type::API_GET_HOSTED_PROFILE_PAGE)
|
204
206
|
end
|
205
207
|
|
206
|
-
# This request enables you to update split tender group
|
208
|
+
# This request enables you to update split tender group.
|
207
209
|
#
|
208
210
|
# See spec/api_spec.rb for usage examples
|
209
211
|
def update_split_tender_group(request)
|
210
212
|
make_request(request,UpdateSplitTenderGroupResponse,Type::API_UPDATE_SPLIT_TENDER_GROUP)
|
211
213
|
end
|
212
214
|
|
213
|
-
# This request enables you to get customer payment profile list
|
215
|
+
# This request enables you to get customer payment profile list.
|
214
216
|
#
|
215
217
|
# See spec/api_spec.rb for usage examples
|
216
218
|
def get_customer_payment_profile_list(request)
|
217
219
|
make_request(request,GetCustomerPaymentProfileListResponse,Type::API_GET_CUSTOMER_PAYMENT_PROFILE_LIST)
|
218
220
|
end
|
219
221
|
|
220
|
-
# This request enables you to get ARB Subscription
|
222
|
+
# This request enables you to get ARB Subscription.
|
221
223
|
#
|
222
224
|
# See spec/api_spec.rb for usage examples
|
223
225
|
def arb_get_subscription_request(request)
|
224
226
|
make_request(request,ARBGetSubscriptionResponse,Type::API_ARB_GET_SUBSCRIPTION_REQUEST)
|
225
227
|
end
|
226
228
|
|
227
|
-
# This request enables you to get transaction list
|
229
|
+
# This request enables you to get transaction list.
|
228
230
|
#
|
229
231
|
# See spec/api_spec.rb for usage examples
|
230
232
|
def get_transaction_list(request)
|
231
233
|
make_request(request,GetTransactionListResponse,Type::API_GET_TRANSACTION_LIST)
|
232
234
|
end
|
233
235
|
|
234
|
-
# This request enables you to validate customer payment profile
|
236
|
+
# This request enables you to validate customer payment profile.
|
235
237
|
#
|
236
238
|
# See spec/api_spec.rb for usage examples
|
237
239
|
def validate_customer_payment_profile(request)
|
@@ -253,6 +255,9 @@ module AuthorizeNet::API
|
|
253
255
|
def get_transaction_list_for_customer(request)
|
254
256
|
make_request(request,GetTransactionListResponse,Type::API_GET_TRANSACTION_LIST_FOR_CUSTOMER)
|
255
257
|
end
|
256
|
-
|
258
|
+
|
259
|
+
def update_merchant_details(request)
|
260
|
+
make_request(request,UpdateMerchantDetailsResponse,Type::API_UPDATE_MERCHANT_DETAILS)
|
261
|
+
end
|
257
262
|
end
|
258
263
|
end
|
@@ -1,15 +1,17 @@
|
|
1
1
|
# :title: Authorize.Net Ruby SDK
|
2
|
-
# The core AuthoizeNet module.
|
2
|
+
# The core AuthoizeNet module.
|
3
|
+
# The entire SDK is name-spaced inside of this module.
|
3
4
|
module AuthorizeNet
|
4
5
|
|
5
|
-
# Some type conversion routines that will be injected into our
|
6
|
-
# classes.
|
6
|
+
# Some type conversion routines that will be injected into our
|
7
|
+
# Transaction/Response classes.
|
7
8
|
module TypeConversions
|
8
|
-
|
9
|
+
|
9
10
|
API_FIELD_PREFIX = 'x_'
|
10
|
-
|
11
|
-
#
|
12
|
-
# is designed to handle the wide range of boolean
|
11
|
+
|
12
|
+
# Converts a value received from Authorize.Net into a boolean if
|
13
|
+
# possible. This is designed to handle the wide range of boolean
|
14
|
+
# formats that Authorize.Net uses.
|
13
15
|
def value_to_boolean(value)
|
14
16
|
case value
|
15
17
|
when "TRUE", "T", "YES", "Y", "1", "true"
|
@@ -21,9 +23,10 @@ module AuthorizeNet
|
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
# Converts a boolean into an Authorize.Net boolean value string.
|
25
|
-
# is designed to handle the wide range of boolean formats that
|
26
|
-
# uses. If bool isn't a Boolean, its converted to a
|
26
|
+
# Converts a boolean into an Authorize.Net boolean value string.
|
27
|
+
# This is designed to handle the wide range of boolean formats that
|
28
|
+
# Authorize.Net uses. If bool isn't a Boolean, its converted to a
|
29
|
+
# string and passed along.
|
27
30
|
def boolean_to_value(bool)
|
28
31
|
case bool
|
29
32
|
when TrueClass, FalseClass
|
@@ -33,13 +36,15 @@ module AuthorizeNet
|
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
36
|
-
#
|
39
|
+
# Converts a value received from Authorize.Net into a BigDecimal.
|
37
40
|
def value_to_decimal(value)
|
41
|
+
value = 0 if value == '' # Ruby 2.4+ does not accept ""
|
38
42
|
BigDecimal.new(value)
|
39
43
|
end
|
40
44
|
|
41
|
-
# Converts a BigDecimal (or Float) into an Authorize.Net float value
|
42
|
-
# a BigDecimal (or Float), its converted to a
|
45
|
+
# Converts a BigDecimal (or Float) into an Authorize.Net float value
|
46
|
+
# string. If float isn't a BigDecimal (or Float), its converted to a
|
47
|
+
# string and passed along.
|
43
48
|
def decimal_to_value(float)
|
44
49
|
case float
|
45
50
|
when Float
|
@@ -51,13 +56,14 @@ module AuthorizeNet
|
|
51
56
|
end
|
52
57
|
end
|
53
58
|
|
54
|
-
#
|
59
|
+
# Converts a value received from Authorize.Net into a Date.
|
55
60
|
def value_to_date(value)
|
56
61
|
Date.strptime(value, '%Y-%m-%d')
|
57
62
|
end
|
58
63
|
|
59
|
-
# Converts a Date (or DateTime, or Time) into an Authorize.Net date
|
60
|
-
# a Date (or DateTime, or Time), its
|
64
|
+
# Converts a Date (or DateTime, or Time) into an Authorize.Net date
|
65
|
+
# value string. If date isn't a Date (or DateTime, or Time), its
|
66
|
+
# converted to a string and passed along.
|
61
67
|
def date_to_value(date)
|
62
68
|
case date
|
63
69
|
when Date, DateTime, Time
|
@@ -67,13 +73,14 @@ module AuthorizeNet
|
|
67
73
|
end
|
68
74
|
end
|
69
75
|
|
70
|
-
#
|
76
|
+
# Converts a value received from Authorize.Net into a DateTime.
|
71
77
|
def value_to_datetime(value)
|
72
78
|
DateTime.strptime(value, '%Y-%m-%dT%H:%M:%S')
|
73
79
|
end
|
74
80
|
|
75
|
-
# Converts a Date (or DateTime, or Time) into an Authorize.Net datetime
|
76
|
-
# a Date (or DateTime, or Time),
|
81
|
+
# Converts a Date (or DateTime, or Time) into an Authorize.Net datetime
|
82
|
+
# value string. If date isn't a Date (or DateTime, or Time), it's
|
83
|
+
# converted to a string and passed along.
|
77
84
|
def datetime_to_value(datetime)
|
78
85
|
case datetime
|
79
86
|
when Date, DateTime
|
@@ -85,48 +92,48 @@ module AuthorizeNet
|
|
85
92
|
end
|
86
93
|
end
|
87
94
|
|
88
|
-
#
|
95
|
+
# Converts a value received from Authorize.Net into an Integer.
|
89
96
|
def value_to_integer(value)
|
90
97
|
value.to_s.to_i
|
91
98
|
end
|
92
99
|
|
93
|
-
#
|
100
|
+
# Converts an Integer into an Authorize.Net integer string.
|
94
101
|
def integer_to_value(int)
|
95
102
|
int.to_s
|
96
103
|
end
|
97
104
|
|
98
|
-
# Converts a key value pair into a HTTP POST parameter. The key is
|
99
|
-
# with key_prefix when being converted to a parameter name.
|
105
|
+
# Converts a key value pair into a HTTP POST parameter. The key is
|
106
|
+
# prefixed with key_prefix when being converted to a parameter name.
|
100
107
|
def to_param(key, value, key_prefix = API_FIELD_PREFIX)
|
101
108
|
key_str = "#{key_prefix}#{key}="
|
102
|
-
if value.kind_of?(Array)
|
109
|
+
if value.kind_of?(Array)
|
103
110
|
(value.collect do |v|
|
104
111
|
key_str + CGI::escape(v.to_s)
|
105
112
|
end).join('&')
|
106
113
|
else
|
107
114
|
key_str + CGI::escape(value.to_s)
|
108
115
|
end
|
109
|
-
end
|
116
|
+
end
|
110
117
|
|
111
|
-
|
112
|
-
#
|
113
|
-
# that can be consumed by the Authorize.Net API.
|
118
|
+
# Converts an internal field name (Symbol) into an external field
|
119
|
+
# name (Symbol) that can be consumed by the Authorize.Net API.
|
114
120
|
def to_external_field(key)
|
115
121
|
(API_FIELD_PREFIX + key.to_s).to_sym
|
116
122
|
end
|
117
123
|
|
118
|
-
# Converts an external field name (Symbol) into an internal field
|
119
|
-
# is the exact inverse of to_external_field.
|
120
|
-
#
|
124
|
+
# Converts an external field name (Symbol) into an internal field
|
125
|
+
# name (Symbol). This is the exact inverse of to_external_field.
|
126
|
+
# Running to_internal_field(to_external_field(:foo)) would return
|
127
|
+
# :foo back.
|
121
128
|
def to_internal_field(key)
|
122
129
|
k_str = key.to_s
|
123
130
|
k_str[API_FIELD_PREFIX.length..k_str.length].to_sym
|
124
131
|
end
|
125
132
|
end
|
126
|
-
|
133
|
+
|
127
134
|
# Provides some basic methods used by the various model classes.
|
128
135
|
module Model
|
129
|
-
|
136
|
+
|
130
137
|
# The constructor for models. Takes any of the supported attributes
|
131
138
|
# as key/value pairs.
|
132
139
|
def initialize(fields = {})
|
@@ -137,18 +144,18 @@ module AuthorizeNet
|
|
137
144
|
end
|
138
145
|
end
|
139
146
|
end
|
140
|
-
|
147
|
+
|
141
148
|
def to_a
|
142
149
|
[self]
|
143
150
|
end
|
144
|
-
|
151
|
+
|
145
152
|
#:enddoc:
|
146
153
|
protected
|
147
|
-
|
154
|
+
|
148
155
|
def handle_multivalue_hashing(obj)
|
149
156
|
obj.to_a.collect(&:to_hash)
|
150
157
|
end
|
151
|
-
|
158
|
+
|
152
159
|
end
|
153
160
|
|
154
|
-
end
|
161
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module AuthorizeNet
|
2
2
|
|
3
|
-
# The core, API agnostic response class. You shouldn't instantiate
|
4
|
-
# Instead you should use AuthorizeNet::AIM::Response,
|
3
|
+
# The core, API agnostic response class. You shouldn't instantiate
|
4
|
+
# this one. Instead you should use AuthorizeNet::AIM::Response,
|
5
|
+
# AuthorizeNet::ARB::Response or AuthorizeNet::SIM::Response.
|
5
6
|
class Response
|
6
7
|
|
7
8
|
include AuthorizeNet::TypeConversions
|
@@ -12,7 +13,8 @@ module AuthorizeNet
|
|
12
13
|
# Fields to convert to/from BigDecimal.
|
13
14
|
@@decimal_fields = []
|
14
15
|
|
15
|
-
# DO NOT USE. Instantiate AuthorizeNet::AIM::Response or
|
16
|
+
# DO NOT USE. Instantiate AuthorizeNet::AIM::Response or
|
17
|
+
# AuthorizeNet::SIM::Response instead.
|
16
18
|
def initialize()
|
17
19
|
raise "#{self.class.to_s} should not be instantiated directly."
|
18
20
|
end
|
@@ -33,8 +33,8 @@ module AuthorizeNet::SIM
|
|
33
33
|
# +options+:: A hash of options. See below for values.
|
34
34
|
#
|
35
35
|
# Options
|
36
|
-
# +sequence+:: The sequence number of the transaction as a string or
|
37
|
-
# +timestamp+:: The time the transaction was initiated as a string or
|
36
|
+
# +sequence+:: The sequence number of the transaction as a string or Integer. This is usually something like an invoice number. If none is provided, the SDK generates one at random.
|
37
|
+
# +timestamp+:: The time the transaction was initiated as a string or Integer. This needs to be within 15 minutes of when the gateway receives the transaction. If no value is provided, the SDK defaults it to Time.now().
|
38
38
|
# +test+:: A boolean indicating if the transaction should be run in test mode or not (defaults to false).
|
39
39
|
# +hosted_payment_form+:: A boolean indicating if the transaction should use a hosted payment form (defaults to false).
|
40
40
|
# +relay_response+:: A boolean indicating if the transaction should use the relay response feature to return a receipt to the customer (defaults to true). Direct Post Method requires using a relay response.
|
@@ -135,4 +135,4 @@ module AuthorizeNet::SIM
|
|
135
135
|
|
136
136
|
end
|
137
137
|
|
138
|
-
end
|
138
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module AuthorizeNet
|
2
2
|
|
3
3
|
# The core, API agnostic transaction class. You shouldn't instantiate this one.
|
4
|
-
# Instead you should use AuthorizeNet::AIM::Transaction,
|
4
|
+
# Instead you should use AuthorizeNet::AIM::Transaction,
|
5
|
+
# AuthorizeNet::SIM::Transaction or AuthorizeNet::ARB::Transaction.
|
5
6
|
class Transaction
|
6
7
|
|
7
8
|
include AuthorizeNet::TypeConversions
|
@@ -12,16 +13,20 @@ module AuthorizeNet
|
|
12
13
|
# Fields to convert to/from BigDecimal.
|
13
14
|
@@decimal_fields = []
|
14
15
|
|
15
|
-
# DO NOT USE. Instantiate AuthorizeNet::AIM::Transaction,
|
16
|
+
# DO NOT USE. Instantiate AuthorizeNet::AIM::Transaction,
|
17
|
+
# AuthorizeNet::SIM::Transaction or AuthorizeNet::ARB::Transaction instead.
|
16
18
|
def initialize()
|
17
19
|
@fields ||= {}
|
18
20
|
end
|
19
21
|
|
20
|
-
# Sets arbitrary API fields, overwriting existing values if they exist.
|
21
|
-
#
|
22
|
-
# the
|
23
|
-
#
|
24
|
-
#
|
22
|
+
# Sets arbitrary API fields, overwriting existing values if they exist.
|
23
|
+
# Takes a hash of key/value pairs, where the keys are the field names
|
24
|
+
# without the "x_" prefix. You can set a field to Nil to unset it. If the
|
25
|
+
# value is an array, each value in the array will be added. For example,
|
26
|
+
# set_fields({:line_item => ["item1<|>golf balls<|><|>2<|>18.95<|>Y",
|
27
|
+
# "item2<|>golf bag<|>Wilson golf carry bag, red<|>1<|>39.99<|>"]})
|
28
|
+
# would generate two x_line_item fields in the transaction, one for
|
29
|
+
# each value in the array.
|
25
30
|
def set_fields(fields = {})
|
26
31
|
@fields.merge!(fields)
|
27
32
|
@fields.reject! {|k, v| v.nil?}
|
@@ -38,7 +43,8 @@ module AuthorizeNet
|
|
38
43
|
@fields.merge!(address.to_hash)
|
39
44
|
end
|
40
45
|
|
41
|
-
# Takes an instance of AuthorizeNet::ShippingAddress and adds it to the
|
46
|
+
# Takes an instance of AuthorizeNet::ShippingAddress and adds it to the
|
47
|
+
# transaction.
|
42
48
|
def set_shipping_address(address)
|
43
49
|
@fields.merge!(address.to_hash)
|
44
50
|
end
|
metadata
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authorizenet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Authorize.Net
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.2.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.2.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.6'
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 1.6.4
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- - ~>
|
41
|
+
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '1.6'
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 1.6.4
|
47
47
|
- !ruby/object:Gem::Dependency
|
@@ -62,36 +62,50 @@ dependencies:
|
|
62
62
|
name: rake
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - ~>
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0.8'
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: 0.8.7
|
71
71
|
type: :development
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - ~>
|
75
|
+
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0.8'
|
78
|
-
- -
|
78
|
+
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 0.8.7
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rspec
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - ~>
|
85
|
+
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '2.1'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- - ~>
|
92
|
+
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '2.1'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: appraisal
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
95
109
|
description: Authorize.Net SDK includes standard payments, recurring billing, and
|
96
110
|
customer profiles
|
97
111
|
email: developer@authorize.net
|
@@ -171,7 +185,7 @@ files:
|
|
171
185
|
- lib/generators/generator_extensions.rb
|
172
186
|
homepage: https://github.com/AuthorizeNet/sdk-ruby
|
173
187
|
licenses:
|
174
|
-
- https://github.com/AuthorizeNet/sdk-ruby/blob/master/
|
188
|
+
- https://github.com/AuthorizeNet/sdk-ruby/blob/master/LICENSE.txt
|
175
189
|
metadata: {}
|
176
190
|
post_install_message:
|
177
191
|
rdoc_options: []
|
@@ -179,17 +193,17 @@ require_paths:
|
|
179
193
|
- lib
|
180
194
|
required_ruby_version: !ruby/object:Gem::Requirement
|
181
195
|
requirements:
|
182
|
-
- -
|
196
|
+
- - ">="
|
183
197
|
- !ruby/object:Gem::Version
|
184
|
-
version: 2.
|
198
|
+
version: 2.2.2
|
185
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
200
|
requirements:
|
187
|
-
- -
|
201
|
+
- - ">="
|
188
202
|
- !ruby/object:Gem::Version
|
189
203
|
version: 1.3.6
|
190
204
|
requirements: []
|
191
205
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
206
|
+
rubygems_version: 2.5.1
|
193
207
|
signing_key:
|
194
208
|
specification_version: 4
|
195
209
|
summary: Authorize.Net Payments SDK
|