amiando 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,12 +63,25 @@ module Amiando
63
63
  # @return [PaymentType] the payment type with that id
64
64
  def self.find(payment_type_id)
65
65
  object = new
66
-
67
66
  get object, "api/paymentType/#{payment_type_id}"
68
67
 
69
68
  object
70
69
  end
71
70
 
71
+ ##
72
+ # Update a payment type
73
+ #
74
+ # @param payment_type_id
75
+ # @param [Hash] attributes attributes to be updated
76
+ #
77
+ # @return [Boolean] result of the operation
78
+ def self.update(payment_type_id, attributes)
79
+ object = Boolean.new('success')
80
+ post object, "api/paymentType/#{payment_type_id}"
81
+
82
+ object
83
+ end
84
+
72
85
  protected
73
86
 
74
87
  def populate(response_body)
@@ -1,3 +1,3 @@
1
1
  module Amiando
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -51,4 +51,15 @@ describe Amiando::PaymentType do
51
51
  payment_types.result.must_include payment_type
52
52
  end
53
53
  end
54
+
55
+ describe 'update' do
56
+ it 'updates the given attributes' do
57
+ payment_id = Amiando::PaymentType.sync_create(event.id, :invoice).result
58
+
59
+ update = Amiando::PaymentType.update(payment_id, :active => false)
60
+ Amiando.run
61
+
62
+ update.result.must_equal true
63
+ end
64
+ end
54
65
  end
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Typhoeus::Response
2
+ app_connect_time: 0.596327
3
+ body: "{\"success\":true}"
4
+ code: 200
5
+ connect_time: 0.17629
6
+ curl_error_message: No error
7
+ curl_return_code: 0
8
+ effective_url: https://test.amiando.com/api/paymentType/867997?apikey=EHynu2WfcVkkO3VRce0ZWtWKplIpXjlhCuQuDn7s1MgKF9ztR0&format=json&version=1
9
+ first_header_line: HTTP/1.1 200 OK
10
+ headers: |
11
+ HTTP/1.1 200 OK
12
+ Date: Wed, 02 Nov 2011 10:52:07 GMT
13
+ Server: Apache/2.0.55 (Red Hat)
14
+ Set-Cookie: JSESSIONID=07CA1816FE8CBD5006EC55EB23BC353F.web01; Path=/; Secure
15
+ Set-Cookie: JSESSIONID=07CA1816FE8CBD5006EC55EB23BC353F.web01; Path=/
16
+ accept-charset: utf-8
17
+ P3P: policyref="/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD CON OUR IND UNI PUR COM CNT"
18
+ Access-Control-Allow-Origin: *
19
+ Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT
20
+ Set-Cookie: ANONYMOUS_HASHED_REMEMBER_ME_COOKIE_KEY=R3VnSk9hTDhwd3N6U2JuRjoxMzIxNDQwODg0NjIyOmY2ZjJmYmU4NTA2ZGY5Mjc1MWViZjU4ZWVkZTVhYTVi; Expires=Mon, 31-Oct-2016 10:54:44 GMT; Path=/
21
+ Accept-Ranges: bytes
22
+ Cache-Control: max-age=7200
23
+ Expires: Wed, 02 Nov 2011 12:52:07 GMT
24
+ Vary: User-Agent
25
+ Transfer-Encoding: chunked
26
+ Content-Type: application/json;charset=UTF-8
27
+
28
+
29
+ headers_hash: !map:Typhoeus::NormalizedHeaderHash
30
+ Vary: User-Agent
31
+ Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT
32
+ P3p: policyref="/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD CON OUR IND UNI PUR COM CNT"
33
+ Transfer-Encoding: chunked
34
+ Access-Control-Allow-Origin: "*"
35
+ Content-Type: application/json;charset=UTF-8
36
+ Date: Wed, 02 Nov 2011 10:52:07 GMT
37
+ Accept-Ranges: bytes
38
+ Server: Apache/2.0.55 (Red Hat)
39
+ Set-Cookie:
40
+ - JSESSIONID=07CA1816FE8CBD5006EC55EB23BC353F.web01; Path=/; Secure
41
+ - JSESSIONID=07CA1816FE8CBD5006EC55EB23BC353F.web01; Path=/
42
+ - ANONYMOUS_HASHED_REMEMBER_ME_COOKIE_KEY=R3VnSk9hTDhwd3N6U2JuRjoxMzIxNDQwODg0NjIyOmY2ZjJmYmU4NTA2ZGY5Mjc1MWViZjU4ZWVkZTVhYTVi; Expires=Mon, 31-Oct-2016 10:54:44 GMT; Path=/
43
+ Expires: Wed, 02 Nov 2011 12:52:07 GMT
44
+ Cache-Control: max-age=7200
45
+ Accept-Charset: utf-8
46
+ http_version:
47
+ mock: false
48
+ name_lookup_time: 0.087407
49
+ pretransfer_time: 0.59633
50
+ primary_ip: 213.61.176.214
51
+ request: |-
52
+ :method => :post,
53
+ :url => https://test.amiando.com/api/paymentType/867997?apikey=EHynu2WfcVkkO3VRce0ZWtWKplIpXjlhCuQuDn7s1MgKF9ztR0&format=json&version=1,
54
+ :headers => {"User-Agent"=>"Typhoeus - http://github.com/dbalatero/typhoeus/tree/master"}
55
+ requested_http_method:
56
+ requested_url:
57
+ start_time:
58
+ start_transfer_time: 0.751483
59
+ status_message: OK
60
+ time: 0.751521
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amiando
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jorge Dias
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-10-28 00:00:00 +02:00
19
+ date: 2011-11-02 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -182,6 +182,7 @@ files:
182
182
  - test/fixtures/PaymentType/3f67b8ff5994e0239fa2ed6e7dbfcec1.yml
183
183
  - test/fixtures/PaymentType/7c37125c353d970dbbbaaef54eaf3d90.yml
184
184
  - test/fixtures/PaymentType/99cb9326dac40ba3263f9564d0c38fef.yml
185
+ - test/fixtures/PaymentType/fa5bcdd454d042a1169fb4fb6c5bc4a0.yml
185
186
  - test/fixtures/PaymentType/fbfab75b95d5c3df19152e70fbd9689c.yml
186
187
  - test/fixtures/TicketCategory/10f73790dceb968d141b099cd8890fc7.yml
187
188
  - test/fixtures/TicketCategory/1267a63177d0cdbdc9ce0698c746801a.yml
@@ -311,6 +312,7 @@ test_files:
311
312
  - test/fixtures/PaymentType/3f67b8ff5994e0239fa2ed6e7dbfcec1.yml
312
313
  - test/fixtures/PaymentType/7c37125c353d970dbbbaaef54eaf3d90.yml
313
314
  - test/fixtures/PaymentType/99cb9326dac40ba3263f9564d0c38fef.yml
315
+ - test/fixtures/PaymentType/fa5bcdd454d042a1169fb4fb6c5bc4a0.yml
314
316
  - test/fixtures/PaymentType/fbfab75b95d5c3df19152e70fbd9689c.yml
315
317
  - test/fixtures/TicketCategory/10f73790dceb968d141b099cd8890fc7.yml
316
318
  - test/fixtures/TicketCategory/1267a63177d0cdbdc9ce0698c746801a.yml