activemerchant 1.16.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +15 -1
- data/CONTRIBUTORS +8 -0
- data/lib/active_merchant/billing/credit_card.rb +100 -18
- data/lib/active_merchant/billing/gateways/authorize_net.rb +31 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +46 -36
- data/lib/active_merchant/billing/gateways/card_save.rb +23 -0
- data/lib/active_merchant/billing/gateways/epay.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +270 -0
- data/lib/active_merchant/billing/gateways/orbital.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +6 -3
- data/lib/active_merchant/billing/gateways/paypal_express.rb +22 -15
- data/lib/active_merchant/billing/gateways/quickpay.rb +96 -22
- data/lib/active_merchant/billing/integrations/payflow_link.rb +21 -0
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +58 -0
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +78 -0
- data/lib/active_merchant/version.rb +1 -1
- metadata +23 -18
- metadata.gz.sig +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module PayflowLink
|
5
|
+
autoload :Helper, 'active_merchant/billing/integrations/payflow_link/helper.rb'
|
6
|
+
autoload :Notification, 'active_merchant/billing/integrations/payflow_link/notification.rb'
|
7
|
+
|
8
|
+
mattr_accessor :service_url
|
9
|
+
self.service_url = 'https://payflowlink.paypal.com'
|
10
|
+
|
11
|
+
def self.notification(post, options = {})
|
12
|
+
Notification.new(post)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.return(query_string, options = {})
|
16
|
+
ActiveMerchant::Billing::Integrations::Return.new(query_string)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module PayflowLink
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
|
7
|
+
def initialize(order, account, options = {})
|
8
|
+
super
|
9
|
+
add_field('login', account)
|
10
|
+
add_field('type', 'S')
|
11
|
+
add_field('echodata', 'True')
|
12
|
+
add_field('user2', ActiveMerchant::Billing::Base.integration_mode == :test || options[:test])
|
13
|
+
add_field('invoice', order)
|
14
|
+
end
|
15
|
+
|
16
|
+
mapping :amount, 'amount'
|
17
|
+
mapping :account, 'login'
|
18
|
+
mapping :credential2, 'partner'
|
19
|
+
mapping :order, 'user1'
|
20
|
+
mapping :description, 'description'
|
21
|
+
|
22
|
+
|
23
|
+
mapping :billing_address, :city => 'city',
|
24
|
+
:address => 'address',
|
25
|
+
:state => 'state',
|
26
|
+
:zip => 'zip',
|
27
|
+
:country => 'country',
|
28
|
+
:phone => 'phone',
|
29
|
+
:name => 'name'
|
30
|
+
|
31
|
+
mapping :customer, :name => 'name'
|
32
|
+
|
33
|
+
def customer(params = {})
|
34
|
+
add_field(mappings[:customer][:name], [params.delete(:first_name), params.delete(:last_name)].compact.join(' '))
|
35
|
+
end
|
36
|
+
|
37
|
+
def billing_address(params = {})
|
38
|
+
# Get the country code in the correct format
|
39
|
+
# Use what we were given if we can't find anything
|
40
|
+
country_code = lookup_country_code(params.delete(:country))
|
41
|
+
add_field(mappings[:billing_address][:country], country_code)
|
42
|
+
|
43
|
+
add_field(mappings[:billing_address][:address], [params.delete(:address1), params.delete(:address2)].compact.join(' '))
|
44
|
+
|
45
|
+
province_code = params.delete(:state)
|
46
|
+
add_field(mappings[:billing_address][:state], province_code.blank? ? 'N/A' : province_code.upcase)
|
47
|
+
|
48
|
+
# Everything else
|
49
|
+
params.each do |k, v|
|
50
|
+
field = mappings[:billing_address][k]
|
51
|
+
add_field(field, v) unless field.nil?
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
|
3
|
+
module ActiveMerchant #:nodoc:
|
4
|
+
module Billing #:nodoc:
|
5
|
+
module Integrations #:nodoc:
|
6
|
+
module PayflowLink
|
7
|
+
class Notification < ActiveMerchant::Billing::Integrations::Notification
|
8
|
+
|
9
|
+
# Was the transaction complete?
|
10
|
+
def complete?
|
11
|
+
status == "Completed"
|
12
|
+
end
|
13
|
+
|
14
|
+
# When was this payment received by the client.
|
15
|
+
# sometimes it can happen that we get the notification much later.
|
16
|
+
# One possible scenario is that our web application was down. In this case paypal tries several
|
17
|
+
# times an hour to inform us about the notification
|
18
|
+
def received_at
|
19
|
+
DateTime.parse(params['TRANSTIME']) if params['TRANSTIME']
|
20
|
+
rescue ArgumentError
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
|
24
|
+
def status
|
25
|
+
params['RESPMSG']
|
26
|
+
end
|
27
|
+
|
28
|
+
# Id of this transaction (paypal number)
|
29
|
+
def transaction_id
|
30
|
+
params['PNREF']
|
31
|
+
end
|
32
|
+
|
33
|
+
# What type of transaction are we dealing with?
|
34
|
+
def type
|
35
|
+
params['TYPE']
|
36
|
+
end
|
37
|
+
|
38
|
+
# the money amount we received in X.2 decimal.
|
39
|
+
def gross
|
40
|
+
params['AMT']
|
41
|
+
end
|
42
|
+
|
43
|
+
# What currency have we been dealing with
|
44
|
+
def currency
|
45
|
+
nil
|
46
|
+
end
|
47
|
+
|
48
|
+
def status
|
49
|
+
params['RESULT'] == '0' ? 'Completed' : 'Failed'
|
50
|
+
end
|
51
|
+
|
52
|
+
# This is the item number which we submitted to paypal
|
53
|
+
def item_id
|
54
|
+
params['USER1']
|
55
|
+
end
|
56
|
+
|
57
|
+
# This is the invoice which you passed to paypal
|
58
|
+
def invoice
|
59
|
+
params['INVNUM']
|
60
|
+
end
|
61
|
+
|
62
|
+
# Was this a test transaction?
|
63
|
+
def test?
|
64
|
+
params['USER2'] == 'true'
|
65
|
+
end
|
66
|
+
|
67
|
+
def account
|
68
|
+
params["ACCT"]
|
69
|
+
end
|
70
|
+
|
71
|
+
def acknowledge
|
72
|
+
true
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemerchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 83
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 17
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.17.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Luetke
|
@@ -36,13 +36,12 @@ cert_chain:
|
|
36
36
|
hPaSTyVU0yCSnw==
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2011-
|
39
|
+
date: 2011-08-23 00:00:00 -04:00
|
40
40
|
default_executable:
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
prerelease: false
|
44
43
|
type: :runtime
|
45
|
-
|
44
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
46
45
|
none: false
|
47
46
|
requirements:
|
48
47
|
- - ">="
|
@@ -53,12 +52,12 @@ dependencies:
|
|
53
52
|
- 3
|
54
53
|
- 11
|
55
54
|
version: 2.3.11
|
56
|
-
requirement: *id001
|
57
55
|
name: activesupport
|
58
|
-
|
56
|
+
version_requirements: *id001
|
59
57
|
prerelease: false
|
58
|
+
- !ruby/object:Gem::Dependency
|
60
59
|
type: :runtime
|
61
|
-
|
60
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
62
61
|
none: false
|
63
62
|
requirements:
|
64
63
|
- - ">="
|
@@ -69,12 +68,12 @@ dependencies:
|
|
69
68
|
- 0
|
70
69
|
- 0
|
71
70
|
version: 2.0.0
|
72
|
-
requirement: *id002
|
73
71
|
name: builder
|
74
|
-
|
72
|
+
version_requirements: *id002
|
75
73
|
prerelease: false
|
74
|
+
- !ruby/object:Gem::Dependency
|
76
75
|
type: :runtime
|
77
|
-
|
76
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
78
77
|
none: false
|
79
78
|
requirements:
|
80
79
|
- - ">="
|
@@ -85,12 +84,12 @@ dependencies:
|
|
85
84
|
- 0
|
86
85
|
- 0
|
87
86
|
version: 2.0.0
|
88
|
-
requirement: *id003
|
89
87
|
name: braintree
|
90
|
-
|
88
|
+
version_requirements: *id003
|
91
89
|
prerelease: false
|
90
|
+
- !ruby/object:Gem::Dependency
|
92
91
|
type: :runtime
|
93
|
-
|
92
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
94
93
|
none: false
|
95
94
|
requirements:
|
96
95
|
- - ">="
|
@@ -101,8 +100,9 @@ dependencies:
|
|
101
100
|
- 5
|
102
101
|
- 1
|
103
102
|
version: 1.5.1
|
104
|
-
requirement: *id004
|
105
103
|
name: json
|
104
|
+
version_requirements: *id004
|
105
|
+
prerelease: false
|
106
106
|
description: Active Merchant is a simple payment abstraction library used in and sponsored by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.
|
107
107
|
email: tobi@leetsoft.com
|
108
108
|
executables: []
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/active_merchant/billing/gateways/braintree.rb
|
138
138
|
- lib/active_merchant/billing/gateways/braintree_blue.rb
|
139
139
|
- lib/active_merchant/billing/gateways/braintree_orange.rb
|
140
|
+
- lib/active_merchant/billing/gateways/card_save.rb
|
140
141
|
- lib/active_merchant/billing/gateways/card_stream.rb
|
141
142
|
- lib/active_merchant/billing/gateways/cyber_source.rb
|
142
143
|
- lib/active_merchant/billing/gateways/data_cash.rb
|
@@ -168,6 +169,7 @@ files:
|
|
168
169
|
- lib/active_merchant/billing/gateways/netbilling.rb
|
169
170
|
- lib/active_merchant/billing/gateways/nmi.rb
|
170
171
|
- lib/active_merchant/billing/gateways/ogone.rb
|
172
|
+
- lib/active_merchant/billing/gateways/optimal_payment.rb
|
171
173
|
- lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb
|
172
174
|
- lib/active_merchant/billing/gateways/orbital.rb
|
173
175
|
- lib/active_merchant/billing/gateways/pay_junction.rb
|
@@ -256,6 +258,9 @@ files:
|
|
256
258
|
- lib/active_merchant/billing/integrations/nochex/return.rb
|
257
259
|
- lib/active_merchant/billing/integrations/nochex.rb
|
258
260
|
- lib/active_merchant/billing/integrations/notification.rb
|
261
|
+
- lib/active_merchant/billing/integrations/payflow_link/helper.rb
|
262
|
+
- lib/active_merchant/billing/integrations/payflow_link/notification.rb
|
263
|
+
- lib/active_merchant/billing/integrations/payflow_link.rb
|
259
264
|
- lib/active_merchant/billing/integrations/paypal/helper.rb
|
260
265
|
- lib/active_merchant/billing/integrations/paypal/notification.rb
|
261
266
|
- lib/active_merchant/billing/integrations/paypal/return.rb
|
@@ -329,7 +334,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
334
|
requirements: []
|
330
335
|
|
331
336
|
rubyforge_project: activemerchant
|
332
|
-
rubygems_version: 1.
|
337
|
+
rubygems_version: 1.6.2
|
333
338
|
signing_key:
|
334
339
|
specification_version: 3
|
335
340
|
summary: Framework and tools for dealing with credit card transactions.
|
metadata.gz.sig
CHANGED
Binary file
|