paid 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19719c911ec26dca4ded160c1bd21384fd783939
4
- data.tar.gz: 29fe6d251b7c798dcc9d962a9b3cd1f7b9366d0d
3
+ metadata.gz: 7bda48a84419fc70d7200704ab421c9b4980e49a
4
+ data.tar.gz: 4ac182f0c95b23739c0ee2346b3b3b73874b999f
5
5
  SHA512:
6
- metadata.gz: 2cb3e08c5d99736ae837e89231465b8a90f24a2558ef0ebb897bf1cc8d6483a1ad99fcc9a8e6228fd30092c5266d6fe52e817308d2af456354515fe677df89a3
7
- data.tar.gz: b05a5e6fe08b76c77eae783f9d687bc44fd2c0806c38fcaf5add389ef59ec5d3ff0d989bbf03f84011d9ac6b3cefc6de8c0ccd01713edbff624e4127725fb317
6
+ metadata.gz: ae4a45c77debf4fe5cccff176525159bcf74d72e0e2700028321c63d21b906df022ad33dfe306c7d1cf91bba5329de65b7062b023afb10e2797b579725c84e40
7
+ data.tar.gz: 3fe73b9564435a8824ad55f99954c85e5e303c4ae8a915440ad37c27cc197e319381ec0ece68e916ce5b912d0556b4a421368f4bd0d52b3c842fa64ff909c378
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -35,7 +35,7 @@ module Paid
35
35
  attributes
36
36
  end
37
37
 
38
- def set_attributes
38
+ def non_nil_attributes
39
39
  attributes.select{|k, v| !v.nil? }
40
40
  end
41
41
 
@@ -136,11 +136,11 @@ module Paid
136
136
 
137
137
  def inspect
138
138
  id_string = (self.respond_to?(:id) && !self.id.nil?) ? " id=#{self.id}" : ""
139
- "#<#{self.class}:0x#{self.object_id.to_s(16)}#{id_string}> JSON: " + JSON.pretty_generate(set_attributes)
139
+ "#<#{self.class}:0x#{self.object_id.to_s(16)}#{id_string}> JSON: " + JSON.pretty_generate(attributes)
140
140
  end
141
141
 
142
142
  def to_json(*a)
143
- JSON.generate(set_attributes)
143
+ JSON.generate(attributes)
144
144
  end
145
145
 
146
146
 
@@ -204,6 +204,8 @@ module Paid
204
204
  resp = Paid.request(method, composed_path, arguments[:params], arguments[:opts])
205
205
 
206
206
 
207
+ puts "Making a call to #{composed_path}"
208
+
207
209
  if constructor.is_a?(Class)
208
210
  constructor.construct(resp)
209
211
  elsif constructor.is_a?(Proc)
data/lib/paid/customer.rb CHANGED
@@ -5,7 +5,6 @@ module Paid
5
5
  attribute :email
6
6
  attribute :description
7
7
  attribute :external_id
8
- attribute :aliases, APIList
9
8
  attribute :phone
10
9
  attribute :address_line1
11
10
  attribute :address_line2
@@ -24,8 +23,7 @@ module Paid
24
23
  api_class_method :all, :get, :constructor => APIList.constructor(Customer)
25
24
  api_class_method :retrieve, :get, ":path/:id", :arguments => [:id]
26
25
  api_class_method :create, :post
27
- api_class_method :by_alias, :get, "/v0/aliases/:alias", :arguments => [:alias]
28
- api_class_method :by_external_id, :get, ":path/by_external_id/:external_id", :arguments => [:external_id]
26
+ api_class_method :by_external_id, :get, ":path/by_external_id", :arguments => [:external_id]
29
27
 
30
28
  api_instance_method :save, :put, :default_params => :changed_attributes
31
29
  api_instance_method :generate_invoice, :post, ":path/generate_invoice", :constructor => Invoice
@@ -1,14 +1,13 @@
1
1
  module Paid
2
2
  class Transaction < APIResource
3
3
  # attributes :id and :object inherited from APIResource
4
- attribute :amount # req for create
5
- attribute :description # req for create
6
- attribute :customer # optional for create
7
- attribute :alias # optional for create
8
- attribute :paid # invalid for create
9
- attribute :paid_on # optional for create
10
- attribute :properties # optional for create
11
- attribute :invoice # invalid for create
4
+ attribute :amount
5
+ attribute :description
6
+ attribute :customer
7
+ attribute :paid
8
+ attribute :paid_on
9
+ attribute :properties
10
+ attribute :invoice
12
11
 
13
12
  api_class_method :create, :post
14
13
  api_class_method :retrieve, :get, ":path/:id", :arguments => [:id]
@@ -14,13 +14,6 @@ module Paid
14
14
  assert(customer.is_a?(Paid::Customer))
15
15
  end
16
16
 
17
- should 'be retrieveable by alias' do
18
- al = "alias_for_cust"
19
- @mock.expects(:get).once.with("#{Paid.api_base}/v0/aliases/#{al}", anything, anything).returns(test_response(test_customer))
20
- customer = Paid::Customer.by_alias(al)
21
- assert(customer.is_a?(Paid::Customer))
22
- end
23
-
24
17
  should 'be retrieveable by external_id' do
25
18
  external_id = "external_id_for_cust"
26
19
  @mock.expects(:get).once.with("#{@customer_url}/by_external_id/#{external_id}", anything, anything).returns(test_response(test_customer))
@@ -188,11 +181,6 @@ module Paid
188
181
  assert_equal(test_customer[:external_id], @customer.external_id)
189
182
  end
190
183
 
191
- should 'have & convert the aliases attribute' do
192
- assert(@customer.aliases.is_a?(Paid::APIList))
193
- assert_equal(test_customer[:aliases][:data], @customer.aliases.data)
194
- end
195
-
196
184
  end
197
185
 
198
186
  should 'be registered' do
@@ -96,10 +96,6 @@ module Paid
96
96
  assert_equal(test_transaction[:customer], @transaction.customer)
97
97
  end
98
98
 
99
- should 'have the alias attribute' do
100
- assert_equal(test_transaction[:alias], @transaction.alias)
101
- end
102
-
103
99
  should 'have the paid attribute' do
104
100
  assert_equal(test_transaction[:paid], @transaction.paid)
105
101
  end
data/test/test_data.rb CHANGED
@@ -66,10 +66,6 @@ module Paid
66
66
  :billing_cycle => "manual",
67
67
  :stripe_customer_id => nil,
68
68
  :external_id => "customer_external_id",
69
- :aliases => {
70
- :object => "list",
71
- :data => ["12345"]
72
- }
73
69
  }
74
70
  end
75
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Calhoun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-09 00:00:00.000000000 Z
12
+ date: 2015-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.4.5
198
+ rubygems_version: 2.2.2
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: Ruby bindings for Paid API