active_merchant_payline 0.2.13 → 0.2.14
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.
- data/VERSION +1 -1
- data/active_merchant_payline.gemspec +2 -2
- data/lib/active_merchant_payline/integration/lib/web_payment.rb +17 -15
- data/lib/active_merchant_payline/integration/lib/web_payment_response.rb +14 -0
- data/lib/active_merchant_payline/integration/payline.rb +20 -7
- metadata +3 -3
- data/lib/active_merchant_payline/integration/lib/helper.rb +0 -11
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.14
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active_merchant_payline}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.14"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ludovic Galabru"]
|
@@ -27,10 +27,10 @@ Gem::Specification.new do |s|
|
|
27
27
|
"init.rb",
|
28
28
|
"lib/active_merchant_payline.rb",
|
29
29
|
"lib/active_merchant_payline/gateway/payline.rb",
|
30
|
-
"lib/active_merchant_payline/integration/lib/helper.rb",
|
31
30
|
"lib/active_merchant_payline/integration/lib/notification.rb",
|
32
31
|
"lib/active_merchant_payline/integration/lib/return.rb",
|
33
32
|
"lib/active_merchant_payline/integration/lib/web_payment.rb",
|
33
|
+
"lib/active_merchant_payline/integration/lib/web_payment_response.rb",
|
34
34
|
"lib/active_merchant_payline/integration/payline.rb",
|
35
35
|
"test/helper.rb",
|
36
36
|
"test/test_active_merchant_payline.rb"
|
@@ -6,8 +6,9 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
module Integrations #:nodoc:
|
7
7
|
module Payline
|
8
8
|
class WebPayment
|
9
|
+
#merchant_id, merchant_key, contract, return_url, amount
|
9
10
|
|
10
|
-
def authorize
|
11
|
+
def self.authorize(options = {})
|
11
12
|
xml= Builder::XmlMarkup.new
|
12
13
|
xml.instruct!
|
13
14
|
xmlns= {
|
@@ -21,25 +22,25 @@ module ActiveMerchant #:nodoc:
|
|
21
22
|
do_web_payment_envelope(xml)
|
22
23
|
end
|
23
24
|
end
|
24
|
-
|
25
|
+
|
25
26
|
Net::HTTP.start('homologation.payline.com', 443) do |http|
|
26
27
|
http.use_ssl= true
|
27
28
|
path= 'V4/services/DirectPaymentAPI'
|
28
29
|
data= xml.target!
|
29
30
|
response = http.post(path, data)
|
30
|
-
puts response
|
31
31
|
end
|
32
|
-
|
32
|
+
response
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
36
|
-
def do_web_payment_envelope(xml)
|
36
|
+
def do_web_payment_envelope(xml, options = {})
|
37
37
|
xml.tag! 'impl:doWebPaymentRequest' do
|
38
38
|
xml.tag! 'impl:securityMode' do
|
39
39
|
xml.text! 'SSL'
|
40
40
|
end
|
41
41
|
xml.tag! 'impl:languageCode'
|
42
42
|
xml.tag! 'impl:customPaymentPageCode' do
|
43
|
+
|
43
44
|
end
|
44
45
|
add_urls(xml)
|
45
46
|
add_payment(xml)
|
@@ -51,46 +52,47 @@ module ActiveMerchant #:nodoc:
|
|
51
52
|
end
|
52
53
|
|
53
54
|
private
|
54
|
-
def add_urls(xml)
|
55
|
+
def add_urls(xml, options = {})
|
55
56
|
xml.tag! 'impl:returnURL' do
|
56
|
-
|
57
|
+
|
57
58
|
end
|
58
59
|
xml.tag! 'impl:cancelURL' do
|
59
|
-
|
60
|
+
|
60
61
|
end
|
61
62
|
xml.tag! 'impl:notificationURL' do
|
62
|
-
|
63
|
+
|
63
64
|
end
|
64
65
|
xml.tag! 'impl:customPaymentTemplateURL' do
|
65
|
-
|
66
|
+
|
66
67
|
end
|
67
68
|
xml
|
68
69
|
end
|
69
70
|
|
70
|
-
|
71
|
+
private
|
72
|
+
def add_payment(xml, options = {})
|
71
73
|
xml.tag! 'impl:payment' do
|
72
74
|
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
76
78
|
private
|
77
|
-
def add_order(xml)
|
79
|
+
def add_order(xml, options = {})
|
78
80
|
xml.tag! 'impl:order' do
|
79
81
|
|
80
82
|
end
|
81
83
|
end
|
82
84
|
|
83
85
|
private
|
84
|
-
def add_contract(xml)
|
86
|
+
def add_contract(xml, options = {})
|
85
87
|
xml.tag! 'impl:contract' do
|
86
88
|
|
87
89
|
end
|
88
90
|
end
|
89
91
|
|
90
92
|
private
|
91
|
-
def add_buyer(xml)
|
93
|
+
def add_buyer(xml, options = {})
|
92
94
|
xml.tag! 'impl:buyer' do
|
93
|
-
|
95
|
+
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
@@ -2,18 +2,21 @@ module ActiveMerchant
|
|
2
2
|
module Billing
|
3
3
|
module Integrations
|
4
4
|
module Payline
|
5
|
-
autoload :
|
6
|
-
autoload :
|
7
|
-
autoload :
|
8
|
-
autoload :
|
9
|
-
|
5
|
+
autoload :Return, File.dirname(__FILE__) + '/lib/return.rb'
|
6
|
+
autoload :Notification, File.dirname(__FILE__) + '/lib/notification.rb'
|
7
|
+
autoload :WebPayment, File.dirname(__FILE__) + '/lib/web_payment.rb'
|
8
|
+
autoload :WebPaymentResponse, File.dirname(__FILE__) + '/lib/web_payment_response.rb'
|
9
|
+
|
10
10
|
# Overwrite this if you want to change the Payline homologation url
|
11
11
|
mattr_accessor :homologation_url
|
12
|
-
self.homologation_url
|
12
|
+
self.homologation_url= 'homologation.payline.com'
|
13
13
|
|
14
14
|
# Overwrite this if you want to change the Payline production url
|
15
15
|
mattr_accessor :production_url
|
16
|
-
self.production_url
|
16
|
+
self.production_url= 'services.payline.com'
|
17
|
+
|
18
|
+
mattr_accessor :path
|
19
|
+
self.path= '/V4/services/DirectPaymentAPI'
|
17
20
|
|
18
21
|
def self.service_url
|
19
22
|
mode = ActiveMerchant::Billing::Base.integration_mode
|
@@ -31,6 +34,16 @@ module ActiveMerchant
|
|
31
34
|
Notification.new(post)
|
32
35
|
end
|
33
36
|
|
37
|
+
def self.authorize(options = {})
|
38
|
+
WebPaymentResponse.new(
|
39
|
+
WebPayment.authorize(options)
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.payment_details
|
44
|
+
|
45
|
+
end
|
46
|
+
|
34
47
|
def self.return(query_string, options = {})
|
35
48
|
Return.new(query_string)
|
36
49
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 14
|
9
|
+
version: 0.2.14
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ludovic Galabru
|
@@ -78,10 +78,10 @@ files:
|
|
78
78
|
- init.rb
|
79
79
|
- lib/active_merchant_payline.rb
|
80
80
|
- lib/active_merchant_payline/gateway/payline.rb
|
81
|
-
- lib/active_merchant_payline/integration/lib/helper.rb
|
82
81
|
- lib/active_merchant_payline/integration/lib/notification.rb
|
83
82
|
- lib/active_merchant_payline/integration/lib/return.rb
|
84
83
|
- lib/active_merchant_payline/integration/lib/web_payment.rb
|
84
|
+
- lib/active_merchant_payline/integration/lib/web_payment_response.rb
|
85
85
|
- lib/active_merchant_payline/integration/payline.rb
|
86
86
|
- test/helper.rb
|
87
87
|
- test/test_active_merchant_payline.rb
|