active_merchant_payline 0.2.6 → 0.2.8

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 CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.8
@@ -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.6"
8
+ s.version = "0.2.8"
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"]
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/active_merchant_payline/integration/lib/helper.rb",
31
31
  "lib/active_merchant_payline/integration/lib/notification.rb",
32
32
  "lib/active_merchant_payline/integration/lib/return.rb",
33
+ "lib/active_merchant_payline/integration/lib/web_payment.rb",
33
34
  "lib/active_merchant_payline/integration/payline.rb",
34
35
  "test/helper.rb",
35
36
  "test/test_active_merchant_payline.rb"
@@ -4,6 +4,10 @@ module ActiveMerchant #:nodoc:
4
4
  module Payline
5
5
  class Return < ActiveMerchant::Billing::Integrations::Return
6
6
 
7
+ def initialize(query_string, options = {})
8
+
9
+ end
10
+
7
11
  end
8
12
  end
9
13
  end
@@ -0,0 +1,100 @@
1
+ require 'net/http'
2
+ require 'net/https'
3
+
4
+ module ActiveMerchant #:nodoc:
5
+ module Billing #:nodoc:
6
+ module Integrations #:nodoc:
7
+ module Payline
8
+ class WebPayment
9
+
10
+ def authorize
11
+ xml= Builder::XmlMarkup.new
12
+ xml.instruct!
13
+ xmlns= {
14
+ 'xmlns:soapenv' => 'http://schemas.xmlsoap.org/soap/envelope/',
15
+ 'xmlns:impl' => 'http://impl.ws.payline.experian.com',
16
+ 'xmlns:obj' => 'http://obj.ws.payline.experian.com'
17
+ }
18
+ xml.tag! "soapenv:Envelope", xmlns do
19
+ xml.tag! "soapenv:Header"
20
+ xml.tag! "soapenv:Body" do
21
+ do_web_payment_envelope(xml)
22
+ end
23
+ end
24
+
25
+ http = Net::HTTP.new(self.service_url, 443)
26
+ http.use_ssl = true
27
+ data = xml.target!
28
+ resp, data = http.post(path, data)
29
+ puts resp.inspect
30
+ puts data.inspect
31
+ end
32
+
33
+ private
34
+ def do_web_payment_envelope(xml)
35
+ xml.tag! 'impl:doWebPaymentRequest' do
36
+ xml.tag! 'impl:securityMode' do
37
+ xml.text! 'SSL'
38
+ end
39
+ xml.tag! 'impl:languageCode'
40
+ xml.tag! 'impl:customPaymentPageCode' do
41
+ end
42
+ add_urls(xml)
43
+ add_payment(xml)
44
+ add_order(xml)
45
+ add_contract(xml)
46
+ add_buyer(xml)
47
+ end
48
+ xml
49
+ end
50
+
51
+ private
52
+ def add_urls(xml)
53
+ xml.tag! 'impl:returnURL' do
54
+
55
+ end
56
+ xml.tag! 'impl:cancelURL' do
57
+
58
+ end
59
+ xml.tag! 'impl:notificationURL' do
60
+
61
+ end
62
+ xml.tag! 'impl:customPaymentTemplateURL' do
63
+
64
+ end
65
+ xml
66
+ end
67
+
68
+ def add_payment(xml)
69
+ xml.tag! 'impl:payment' do
70
+
71
+ end
72
+ end
73
+
74
+ private
75
+ def add_order(xml)
76
+ xml.tag! 'impl:order' do
77
+
78
+ end
79
+ end
80
+
81
+ private
82
+ def add_contract(xml)
83
+ xml.tag! 'impl:contract' do
84
+
85
+ end
86
+ end
87
+
88
+ private
89
+ def add_buyer(xml)
90
+ xml.tag! 'impl:buyer' do
91
+
92
+ end
93
+ end
94
+
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+
@@ -1,6 +1,3 @@
1
- require 'net/http'
2
- require 'net/https'
3
-
4
1
  module ActiveMerchant
5
2
  module Billing
6
3
  module Integrations
@@ -37,93 +34,6 @@ module ActiveMerchant
37
34
  Return.new(query_string)
38
35
  end
39
36
 
40
- def build_do_web_payment
41
- xml= Builder::XmlMarkup.new
42
- xml.instruct!
43
- xmlns= {
44
- 'xmlns:soapenv' => 'http://schemas.xmlsoap.org/soap/envelope/',
45
- 'xmlns:impl' => 'http://impl.ws.payline.experian.com',
46
- 'xmlns:obj' => 'http://obj.ws.payline.experian.com'
47
- }
48
- xml.tag! "soapenv:Envelope", xmlns do
49
- xml.tag! "soapenv:Header"
50
- xml.tag! "soapenv:Body" do
51
- do_web_payment_envelope(xml)
52
- end
53
- end
54
-
55
- http = Net::HTTP.new(self.service_url, 443)
56
- http.use_ssl = true
57
- data = xml.target!
58
- resp, data = http.post(path, data)
59
- puts resp.inspect
60
- puts data.inspect
61
- end
62
-
63
- private
64
- def do_web_payment_envelope(xml)
65
- xml.tag! 'impl:doWebPaymentRequest' do
66
- xml.tag! 'impl:securityMode' do
67
- xml.text! 'SSL'
68
- end
69
- xml.tag! 'impl:languageCode'
70
- xml.tag! 'impl:customPaymentPageCode' do
71
- end
72
- add_urls(xml)
73
- add_payment(xml)
74
- add_order(xml)
75
- add_contract(xml)
76
- add_buyer(xml)
77
- end
78
- xml
79
- end
80
-
81
- private
82
- def add_urls(xml)
83
- xml.tag! 'impl:returnURL' do
84
-
85
- end
86
- xml.tag! 'impl:cancelURL' do
87
-
88
- end
89
- xml.tag! 'impl:notificationURL' do
90
-
91
- end
92
- xml.tag! 'impl:customPaymentTemplateURL' do
93
-
94
- end
95
- xml
96
- end
97
-
98
- def add_payment(xml)
99
- xml.tag! 'impl:payment' do
100
-
101
- end
102
- end
103
-
104
- private
105
- def add_order(xml)
106
- xml.tag! 'impl:order' do
107
-
108
- end
109
- end
110
-
111
- private
112
- def add_contract(xml)
113
- xml.tag! 'impl:contract' do
114
-
115
- end
116
- end
117
-
118
- private
119
- def add_buyer(xml)
120
- xml.tag! 'impl:buyer' do
121
-
122
- end
123
- end
124
-
125
-
126
-
127
37
  end
128
38
  end
129
39
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 6
9
- version: 0.2.6
8
+ - 8
9
+ version: 0.2.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ludovic Galabru
@@ -81,6 +81,7 @@ files:
81
81
  - lib/active_merchant_payline/integration/lib/helper.rb
82
82
  - lib/active_merchant_payline/integration/lib/notification.rb
83
83
  - lib/active_merchant_payline/integration/lib/return.rb
84
+ - lib/active_merchant_payline/integration/lib/web_payment.rb
84
85
  - lib/active_merchant_payline/integration/payline.rb
85
86
  - test/helper.rb
86
87
  - test/test_active_merchant_payline.rb