activemerchant 1.42.4 → 1.42.5
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 +8 -8
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG +5 -0
- data/README.md +2 -1
- data/lib/active_merchant/billing/gateway.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +117 -121
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +1 -1
- data/lib/active_merchant/billing/integrations/citrus.rb +1 -1
- data/lib/active_merchant/billing/integrations/doku.rb +24 -0
- data/lib/active_merchant/billing/integrations/doku/helper.rb +102 -0
- data/lib/active_merchant/billing/integrations/doku/notification.rb +69 -0
- data/lib/active_merchant/billing/integrations/doku/return.rb +10 -0
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +2 -8
- data/lib/active_merchant/billing/integrations/two_checkout.rb +11 -11
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +34 -18
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +103 -71
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +47 -6
- data/lib/active_merchant/version.rb +1 -1
- metadata +6 -3
- metadata.gz.sig +0 -0
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -156
@@ -3,14 +3,55 @@ module ActiveMerchant #:nodoc:
|
|
3
3
|
module Integrations #:nodoc:
|
4
4
|
module TwoCheckout
|
5
5
|
class Return < ActiveMerchant::Billing::Integrations::Return
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
# card_holder_name - Provides the customer’s name.
|
8
|
+
# city - Provides the customer’s city.
|
9
|
+
# country - Provides the customer’s country.
|
10
|
+
# credit_card_processed - This parameter will always be passed back as Y.
|
11
|
+
# demo - Defines if an order was live, or if the order was a demo order. If the order was a demo, the MD5 hash will fail.
|
12
|
+
# email - Provides the email address the customer provided when placing the order.
|
13
|
+
# fixed - This parameter will only be passed back if it was passed into the purchase routine.
|
14
|
+
# ip_country - Provides the customer’s IP location.
|
15
|
+
# key - An MD5 hash used to confirm the validity of a sale.
|
16
|
+
# lang - Customer language
|
17
|
+
# merchant_order_id - The order ID you had assigned to the order.
|
18
|
+
# order_number - The 2Checkout order number associated with the order.
|
19
|
+
# invoice_id - The 2Checkout invoice number.
|
20
|
+
# pay_method - Provides seller with the customer’s payment method. CC for Credit Card, PPI for PayPal.
|
21
|
+
# phone - Provides the phone number the customer provided when placing the order.
|
22
|
+
# ship_name - Provides the ship to name for the order.
|
23
|
+
# ship_street_address - Provides ship to address.
|
24
|
+
# ship_street_address2 - Provides more detailed shipping address if this information was provided by the customer.
|
25
|
+
# ship_city - Provides ship to city.
|
26
|
+
# ship_state - Provides ship to state.
|
27
|
+
# ship_zip - Ship Zip
|
28
|
+
|
29
|
+
# Pass Through Products Only
|
30
|
+
# li_#_name - Name of the corresponding lineitem.
|
31
|
+
# li_#_quantity - Quantity of the corresponding lineitem.
|
32
|
+
# li_#_price - Price of the corresponding lineitem.
|
33
|
+
# li_#_tangible - Specifies if the corresponding li_#_type is a tangible or intangible. ‘Y’ OR ‘N’
|
34
|
+
# li_#_product_id - ID of the corresponding lineitem.
|
35
|
+
# li_#_product_description - Description of the corresponding lineitem.
|
36
|
+
# li_#_recurrence - # WEEK | MONTH | YEAR – always singular.
|
37
|
+
# li_#_duration - Forever or # WEEK | MONTH | YEAR – always singular, defaults to Forever.
|
38
|
+
# li_#_startup_fee - Amount in account pricing currency.
|
39
|
+
# li_#_option_#_name - Name of option. 64 characters max – cannot include '<' or '>'.
|
40
|
+
# li_#_option_#_value - Name of option. 64 characters max – cannot include '<' or '>'.
|
41
|
+
# li_#_option_#_surcharge - Amount in account pricing currency.
|
42
|
+
|
43
|
+
#Third Party Cart Only
|
44
|
+
# cart_order_id - The order ID you had assigned to the order
|
45
|
+
|
46
|
+
def initialize(query_string, options = {})
|
47
|
+
super
|
48
|
+
@notification = Notification.new(query_string, options)
|
8
49
|
end
|
9
|
-
|
10
|
-
def
|
11
|
-
|
50
|
+
|
51
|
+
def success?
|
52
|
+
@notification.status != 'Failed'
|
12
53
|
end
|
13
|
-
|
54
|
+
end
|
14
55
|
end
|
15
56
|
end
|
16
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemerchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.42.
|
4
|
+
version: 1.42.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
U1BPVm5oYkZKM3ZTWFkxdWxQL1I2WFc5dm53CjZra1FpMmZIaFUyMHVnTXpw
|
39
39
|
ODgxRWl4citUakMwUnZVZXJMRzdnPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUt
|
40
40
|
LS0tLQo=
|
41
|
-
date: 2014-
|
41
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: activesupport
|
@@ -255,7 +255,6 @@ files:
|
|
255
255
|
- lib/active_merchant/billing/gateways/braintree_orange.rb
|
256
256
|
- lib/active_merchant/billing/gateways/card_save.rb
|
257
257
|
- lib/active_merchant/billing/gateways/card_stream.rb
|
258
|
-
- lib/active_merchant/billing/gateways/card_stream_modern.rb
|
259
258
|
- lib/active_merchant/billing/gateways/cc5.rb
|
260
259
|
- lib/active_merchant/billing/gateways/certo_direct.rb
|
261
260
|
- lib/active_merchant/billing/gateways/conekta.rb
|
@@ -412,6 +411,10 @@ files:
|
|
412
411
|
- lib/active_merchant/billing/integrations/directebanking/notification.rb
|
413
412
|
- lib/active_merchant/billing/integrations/directebanking/return.rb
|
414
413
|
- lib/active_merchant/billing/integrations/directebanking.rb
|
414
|
+
- lib/active_merchant/billing/integrations/doku/helper.rb
|
415
|
+
- lib/active_merchant/billing/integrations/doku/notification.rb
|
416
|
+
- lib/active_merchant/billing/integrations/doku/return.rb
|
417
|
+
- lib/active_merchant/billing/integrations/doku.rb
|
415
418
|
- lib/active_merchant/billing/integrations/dotpay/helper.rb
|
416
419
|
- lib/active_merchant/billing/integrations/dotpay/notification.rb
|
417
420
|
- lib/active_merchant/billing/integrations/dotpay/return.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,156 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
class CardStreamModernGateway < Gateway
|
4
|
-
self.test_url = self.live_url = 'https://gateway.cardstream.com/direct/'
|
5
|
-
self.money_format = :cents
|
6
|
-
self.default_currency = 'GBP'
|
7
|
-
self.supported_countries = ['GB']
|
8
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb, :maestro, :solo, :switch]
|
9
|
-
self.homepage_url = 'http://www.cardstream.com/'
|
10
|
-
self.display_name = 'CardStream'
|
11
|
-
|
12
|
-
def initialize(options = {})
|
13
|
-
requires!(options, :login)
|
14
|
-
if(options[:threeDSRequired])
|
15
|
-
@threeDSRequired = options[:threeDSRequired]
|
16
|
-
else
|
17
|
-
@threeDSRequired = 'N'
|
18
|
-
end
|
19
|
-
super
|
20
|
-
end
|
21
|
-
|
22
|
-
def authorize(money, creditcard, options = {})
|
23
|
-
post = {}
|
24
|
-
add_amount(post, money, options)
|
25
|
-
add_invoice(post, creditcard, money, options)
|
26
|
-
add_creditcard(post, creditcard)
|
27
|
-
add_address(post, creditcard, options)
|
28
|
-
add_customer_data(post, options)
|
29
|
-
commit('PREAUTH', post)
|
30
|
-
end
|
31
|
-
|
32
|
-
def purchase(money, creditcard, options = {})
|
33
|
-
post = {}
|
34
|
-
add_amount(post, money, options)
|
35
|
-
add_invoice(post, creditcard, money, options)
|
36
|
-
add_creditcard(post, creditcard)
|
37
|
-
add_address(post, creditcard, options)
|
38
|
-
add_customer_data(post, options)
|
39
|
-
commit('SALE', post)
|
40
|
-
end
|
41
|
-
|
42
|
-
def capture(money, authorization, options = {})
|
43
|
-
post = {}
|
44
|
-
add_pair(post, :xref, authorization)
|
45
|
-
add_amount(post, money, options)
|
46
|
-
commit('SALE', post)
|
47
|
-
end
|
48
|
-
|
49
|
-
def refund(money, authorization, options = {})
|
50
|
-
post = {}
|
51
|
-
add_pair(post, :xref, authorization)
|
52
|
-
add_amount(post, money, options)
|
53
|
-
commit('REFUND', post)
|
54
|
-
end
|
55
|
-
|
56
|
-
def void(authorization, options = {})
|
57
|
-
post = {}
|
58
|
-
add_pair(post, :xref, authorization)
|
59
|
-
commit('REFUND', post)
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
def add_amount(post, money, options)
|
65
|
-
add_pair(post, :amount, amount(money), :required => true)
|
66
|
-
add_pair(post, :currencyCode, options[:currency] || self.default_currency)
|
67
|
-
end
|
68
|
-
|
69
|
-
def add_customer_data(post, options)
|
70
|
-
address = options[:billing_address] || options[:address]
|
71
|
-
add_pair(post, :customerPostCode, address[:zip])
|
72
|
-
add_pair(post, :customerEmail, options[:email])
|
73
|
-
add_pair(post, :customerPhone, options[:phone])
|
74
|
-
end
|
75
|
-
|
76
|
-
def add_address(post, creditcard, options)
|
77
|
-
address = options[:billing_address] || options[:address]
|
78
|
-
|
79
|
-
return if address.nil?
|
80
|
-
|
81
|
-
add_pair(post, :customerAddress, address[:address1] + " " + (address[:address2].nil? ? "" : address[:address2]) )
|
82
|
-
add_pair(post, :customerPostCode, address[:zip])
|
83
|
-
end
|
84
|
-
|
85
|
-
def add_invoice(post, credit_card, money, options)
|
86
|
-
add_pair(post, :transactionUnique, options[:order_id], :required => true)
|
87
|
-
add_pair(post, :orderRef, options[:description] || options[:order_id], :required => true)
|
88
|
-
if [ 'american_express', 'diners_club' ].include?(card_brand(credit_card).to_s)
|
89
|
-
add_pair(post, :item1Quantity, 1)
|
90
|
-
add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15))
|
91
|
-
add_pair(post, :item1GrossValue, amount(money))
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def add_creditcard(post, credit_card)
|
96
|
-
add_pair(post, :customerName, credit_card.name, :required => true)
|
97
|
-
add_pair(post, :cardNumber, credit_card.number, :required => true)
|
98
|
-
|
99
|
-
add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), :required => true)
|
100
|
-
add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), :required => true)
|
101
|
-
|
102
|
-
if requires_start_date_or_issue_number?(credit_card)
|
103
|
-
add_pair(post, :cardStartMonth, format(credit_card.start_month, :two_digits))
|
104
|
-
add_pair(post, :cardStartYear, format(credit_card.start_year, :two_digits))
|
105
|
-
|
106
|
-
add_pair(post, :cardIssueNumber, credit_card.issue_number)
|
107
|
-
end
|
108
|
-
|
109
|
-
add_pair(post, :cardCVV, credit_card.verification_value)
|
110
|
-
end
|
111
|
-
|
112
|
-
def parse(body)
|
113
|
-
result = {}
|
114
|
-
pairs = body.split("&")
|
115
|
-
pairs.each do |pair|
|
116
|
-
a = pair.split("=")
|
117
|
-
#Make sure there is a value, else set it to empty string
|
118
|
-
result[a[0].to_sym] = a[1] ? CGI.unescape(a[1]) : ""
|
119
|
-
end
|
120
|
-
result
|
121
|
-
end
|
122
|
-
|
123
|
-
def commit(action, parameters)
|
124
|
-
response = parse( ssl_post(self.live_url, post_data(action, parameters)) )
|
125
|
-
|
126
|
-
Response.new(response[:responseCode] == "0",
|
127
|
-
response[:responseCode] == "0" ? "APPROVED" : response[:responseMessage],
|
128
|
-
response,
|
129
|
-
:test => test?,
|
130
|
-
:authorization => response[:xref],
|
131
|
-
:avs_result => {
|
132
|
-
:street_match => response[:addressCheck],
|
133
|
-
:postal_match => response[:postcodeCheck],
|
134
|
-
},
|
135
|
-
:cvv_result => response[:cv2Check]
|
136
|
-
)
|
137
|
-
end
|
138
|
-
|
139
|
-
def post_data(action, parameters = {})
|
140
|
-
parameters.update(
|
141
|
-
:merchantID => @options[:login],
|
142
|
-
:action => action,
|
143
|
-
:type => '1', #Ecommerce
|
144
|
-
:countryCode => self.supported_countries[0],
|
145
|
-
:threeDSRequired => @threeDSRequired #Disable 3d secure by default
|
146
|
-
)
|
147
|
-
parameters.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&")
|
148
|
-
end
|
149
|
-
|
150
|
-
def add_pair(post, key, value, options = {})
|
151
|
-
post[key] = value if !value.blank? || options[:required]
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|