openpayu 0.0.2 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +26 -21
- data/doc/EmptyResponseError.html +4 -4
- data/doc/HttpStatusException.html +4 -4
- data/doc/NotImplementedException.html +4 -4
- data/doc/OpenPayU.html +13 -13
- data/doc/OpenPayU/Configuration.html +19 -17
- data/doc/OpenPayU/Connection.html +35 -43
- data/doc/OpenPayU/Document.html +24 -228
- data/doc/OpenPayU/Documents.html +4 -4
- data/doc/OpenPayU/Documents/Request.html +5 -5
- data/doc/OpenPayU/Documents/Response.html +72 -120
- data/doc/OpenPayU/Models.html +5 -5
- data/doc/OpenPayU/Models/Address.html +5 -6
- data/doc/OpenPayU/Models/Buyer.html +5 -6
- data/doc/OpenPayU/Models/Buyer/Delivery.html +5 -6
- data/doc/OpenPayU/Models/Card.html +5 -6
- data/doc/OpenPayU/Models/Fee.html +5 -6
- data/doc/OpenPayU/Models/Model.html +122 -207
- data/doc/OpenPayU/Models/NotifyResponse.html +5 -6
- data/doc/OpenPayU/Models/Order.html +8 -9
- data/doc/OpenPayU/Models/PayMethod.html +5 -6
- data/doc/OpenPayU/Models/Product.html +5 -6
- data/doc/OpenPayU/Models/Refund.html +13 -102
- data/doc/OpenPayU/Models/ShippingMethod.html +13 -14
- data/doc/OpenPayU/Models/StatusUpdate.html +5 -6
- data/doc/OpenPayU/Models/Token.html +5 -6
- data/doc/OpenPayU/Order.html +53 -89
- data/doc/OpenPayU/Refund.html +6 -18
- data/doc/OpenPayU/Token.html +4 -4
- data/doc/WrongConfigurationError.html +4 -4
- data/doc/WrongNotifyRequest.html +4 -4
- data/doc/WrongOrderParameters.html +4 -4
- data/doc/WrongSignatureException.html +4 -4
- data/doc/_index.html +13 -31
- data/doc/class_list.html +1 -1
- data/doc/css/style.css +2 -1
- data/doc/file.README.html +38 -30
- data/doc/frames.html +1 -1
- data/doc/index.html +38 -30
- data/doc/js/app.js +7 -2
- data/doc/method_list.html +78 -120
- data/doc/top-level-namespace.html +4 -4
- data/lib/openpayu.rb +0 -1
- data/lib/openpayu/configuration.rb +1 -0
- data/lib/openpayu/connection.rb +28 -19
- data/lib/openpayu/document.rb +2 -38
- data/lib/openpayu/documents/response.rb +9 -20
- data/lib/openpayu/models/model.rb +4 -25
- data/lib/openpayu/models/order.rb +0 -1
- data/lib/openpayu/models/refund.rb +5 -27
- data/lib/openpayu/models/shipping_method.rb +2 -2
- data/lib/openpayu/order.rb +7 -25
- data/lib/openpayu/refund.rb +1 -7
- data/lib/openpayu/version.rb +1 -1
- data/openpayu_ruby.gemspec +0 -4
- data/spec/cassettes/cancel_order.yml +17 -26
- data/spec/cassettes/create_order.yml +19 -29
- data/spec/cassettes/retrieve_order.yml +18 -27
- data/spec/cassettes/update_order.yml +19 -28
- data/spec/integration/order_spec.rb +65 -78
- data/spec/openpayu.yml +2 -2
- data/spec/spec_helper.rb +5 -5
- data/spec/test_objects/order.rb +31 -56
- data/spec/unit/configuration_spec.rb +1 -1
- data/spec/unit/models/order_spec.rb +4 -34
- data/spec/unit/openpayu_spec.rb +2 -5
- metadata +55 -87
- data/lib/openpayu/xml_builder.rb +0 -23
- data/spec/cassettes/refund_order.yml +0 -100
data/lib/openpayu/xml_builder.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require 'builder/xmlmarkup'
|
3
|
-
|
4
|
-
module OpenPayU
|
5
|
-
class XmlBuilder < ::Builder::XmlMarkup
|
6
|
-
|
7
|
-
def initialize(req_type, options = {})
|
8
|
-
@req_type = req_type
|
9
|
-
super(options)
|
10
|
-
end
|
11
|
-
|
12
|
-
def tag!(sym, *args, &block)
|
13
|
-
if @level == 0 # Root element
|
14
|
-
args << {
|
15
|
-
'xsi:type' => @req_type,
|
16
|
-
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
|
17
|
-
}
|
18
|
-
end
|
19
|
-
super(sym, *args, &block)
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://platnosci-dev5.dc2/api/v2/order/28161ZT5TF131121GUEST000P01/refund.xml
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <OpenPayU xmlns=\"http://www.openpayu.com/20/openpayu.xsd\"><RefundCreateRequest
|
9
|
-
xsi:type=\"RefundCreateRequest\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n
|
10
|
-
\ <OrderId>28161ZT5TF131121GUEST000P01</OrderId>\n <Refund>\n <OrderId>28161ZT5TF131121GUEST000P01</OrderId>\n
|
11
|
-
\ <Description>Money refund</Description>\n </Refund>\n</RefundCreateRequest>\n</OpenPayU>"
|
12
|
-
headers:
|
13
|
-
accept:
|
14
|
-
- ! '*/*'
|
15
|
-
user-agent:
|
16
|
-
- Ruby
|
17
|
-
content-type:
|
18
|
-
- application/xml
|
19
|
-
openpayu-signature:
|
20
|
-
- sender=45654;signature=78a4d3140aec53f8dadd2f38e9b43563;algorithm=MD5
|
21
|
-
response:
|
22
|
-
status:
|
23
|
-
code: 200
|
24
|
-
message: OK
|
25
|
-
headers:
|
26
|
-
date:
|
27
|
-
- Thu, 26 Sep 2013 08:22:04 GMT
|
28
|
-
server:
|
29
|
-
- Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c mod_jk/1.2.31 PHP/5.3.5
|
30
|
-
mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
|
31
|
-
openpayu-signature:
|
32
|
-
- signature=5687e10debc25d2605e3d50a746e9d50;algorithm=MD5;sender=checkout;content=DOCUMENT;
|
33
|
-
x-openpayu-signature:
|
34
|
-
- signature=5687e10debc25d2605e3d50a746e9d50;algorithm=MD5;sender=checkout;content=DOCUMENT;
|
35
|
-
content-language:
|
36
|
-
- pl
|
37
|
-
content-length:
|
38
|
-
- '640'
|
39
|
-
set-cookie:
|
40
|
-
- payu_persistent=mobile_agent-false#; Expires=Sun, 21-Sep-2014 08:22:04 GMT;
|
41
|
-
Path=/
|
42
|
-
- CSESSIONID=FD0D29BFF48F01C027ADA3F234711265.01; Path=/pl/standard/co
|
43
|
-
connection:
|
44
|
-
- close
|
45
|
-
content-type:
|
46
|
-
- application/xml;charset=UTF-8
|
47
|
-
body:
|
48
|
-
encoding: US-ASCII
|
49
|
-
string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><OpenPayU xmlns="http://www.openpayu.com/20/openpayu.xsd"><RefundCreateResponse><Status><StatusCode>SUCCESS</StatusCode></Status><OrderId>28161ZT5TF131121GUEST000P01</OrderId><Refund><RefundId>87045</RefundId><ExtRefundId>20130926102204</ExtRefundId><Type>REFUND_PAYMENT_STANDARD</Type><Amount>10000</Amount><CurrencyCode>PLN</CurrencyCode><Description>Uznanie
|
50
|
-
87045 Money refund</Description><CreationDateTime>2013-09-26T10:22:04.805+02:00</CreationDateTime><Status>INIT</Status><StatusDateTime>2013-09-26T10:22:06.009+02:00</StatusDateTime></Refund></RefundCreateResponse></OpenPayU>
|
51
|
-
http_version: '1.1'
|
52
|
-
recorded_at: Thu, 26 Sep 2013 08:22:05 GMT
|
53
|
-
- request:
|
54
|
-
method: post
|
55
|
-
uri: http://platnosci-dev5.dc2/api/v2/order/28161ZT5TF131121GUEST000P01/refund.json
|
56
|
-
body:
|
57
|
-
encoding: US-ASCII
|
58
|
-
string: ! '{"OpenPayU":{"RefundCreateRequest":{"OrderId":"28161ZT5TF131121GUEST000P01","Refund":{"OrderId":"28161ZT5TF131121GUEST000P01","Description":"Money
|
59
|
-
refund"}}}}'
|
60
|
-
headers:
|
61
|
-
accept:
|
62
|
-
- ! '*/*'
|
63
|
-
user-agent:
|
64
|
-
- Ruby
|
65
|
-
content-type:
|
66
|
-
- application/json
|
67
|
-
openpayu-signature:
|
68
|
-
- sender=45654;signature=5148e34fd91bb884cae08da7a4df3642;algorithm=MD5
|
69
|
-
response:
|
70
|
-
status:
|
71
|
-
code: 200
|
72
|
-
message: OK
|
73
|
-
headers:
|
74
|
-
date:
|
75
|
-
- Thu, 26 Sep 2013 08:23:49 GMT
|
76
|
-
server:
|
77
|
-
- Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c mod_jk/1.2.31 PHP/5.3.5
|
78
|
-
mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
|
79
|
-
openpayu-signature:
|
80
|
-
- signature=7cbbb385c8e51b62d078c3bc44b346f6;algorithm=MD5;sender=checkout;content=DOCUMENT;
|
81
|
-
x-openpayu-signature:
|
82
|
-
- signature=7cbbb385c8e51b62d078c3bc44b346f6;algorithm=MD5;sender=checkout;content=DOCUMENT;
|
83
|
-
content-language:
|
84
|
-
- pl
|
85
|
-
content-length:
|
86
|
-
- '404'
|
87
|
-
set-cookie:
|
88
|
-
- payu_persistent=mobile_agent-false#; Expires=Sun, 21-Sep-2014 08:23:49 GMT;
|
89
|
-
Path=/
|
90
|
-
- CSESSIONID=D2B119012855F2250A7B1E75141A25DD.01; Path=/pl/standard/co
|
91
|
-
connection:
|
92
|
-
- close
|
93
|
-
content-type:
|
94
|
-
- application/json;charset=UTF-8
|
95
|
-
body:
|
96
|
-
encoding: US-ASCII
|
97
|
-
string: ! '{"OpenPayU":{"RefundCreateResponse":{"Status":{"StatusCode":"SUCCESS"},"OrderId":"28161ZT5TF131121GUEST000P01","Refund":{"Status":"INIT","Description":"Uznanie
|
98
|
-
87046 Money refund","Amount":"10000","RefundId":"87046","ExtRefundId":"20130926102349","CreationDateTime":"2013-09-26T10:23:49.256+02:00","Type":"REFUND_PAYMENT_STANDARD","StatusDateTime":"2013-09-26T10:23:49.491+02:00","CurrencyCode":"PLN"}}}}'
|
99
|
-
http_version: '1.1'
|
100
|
-
recorded_at: Thu, 26 Sep 2013 08:23:48 GMT
|