easy_ping 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cd4ae3fc608c08d9dcf7c6c485f93927f2225d6
4
- data.tar.gz: 0fb57d8dfcf98107bd7493862e0b4327acb6ec31
3
+ metadata.gz: 59b865bf93d8065f8ff0bfc5fb32f81bba44b671
4
+ data.tar.gz: 77481e60765322794b0a056d197adddfb04fc2be
5
5
  SHA512:
6
- metadata.gz: 66012954677b41c3a2bd85bbcf4c35835ec05f1767f1fa1713d0201bac9ef50fd80238be5d4f85199659a72582f3d7884b2e676e4dc9212b70e8cf5f497e1f24
7
- data.tar.gz: 5741090b288a91c5c145e8d0d1eabc7b7d176037ee7b465f00c01bf98cbed0658e33a82cd4d9239a00da955b30cd83252299a11f518463b2ad4976cb02188214
6
+ metadata.gz: 7ba8195b31cb442b5644a8e8d2a2e009e83af632ac4bce250dcbb3b25501df64756711443abc5b3796bf851465697d5a5957b8e2fedecbc8683b019d963702ee
7
+ data.tar.gz: 189b08a99e5d0b82a0a08fcec6eef89b9fecae12474afcd6a7c7af933e0f78e16c241d5ec09d126eb5ab7e261d79c3d6e0819b95abb53e6570f1adaf3c039355
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  EasyPing is an out of the box Ping++ Ruby SDK. Once installed, you're ready to set up a minimal configuration and get started using EasyPing.
4
4
 
5
- **Warn UNDER DEVELOPMENT** Not ready for production purpose yet.
5
+ **Note**
6
+ It's released on [RubyGems](https://rubygems.org/gems/easy_ping).
7
+ If something doesn't work, feel free to report a bug or start an issue.
6
8
 
7
9
  ## Installation
8
10
 
@@ -67,6 +69,16 @@ charge = EasyPing.charge({
67
69
  metadata: { color: 'red'},
68
70
  })
69
71
 
72
+ # Returned Charge Object
73
+ charge.raw # raw response body, typically json string
74
+ charge.values # parsed response body, hash
75
+ charge.heasers # response headers
76
+ charge.status # response status, http code
77
+ charge.live? # livemode or not
78
+
79
+ charge.amount # attributes defined on Ping++ API
80
+ charge.livemode
81
+ charge.refunded
70
82
 
71
83
  ## Retrieve Single Charge ##
72
84
 
@@ -117,6 +129,11 @@ charges.get_prev_page! # same above
117
129
  new_charges = charges.get_next_page # note: ending_before option will be omitted
118
130
  charges.get_prev_page!(limit: 5) # note: starting_after option will be omitted
119
131
 
132
+ # Returned Charge List Object
133
+ charges.has_more?
134
+ charges.url
135
+ charges.each {|ch| puts ch.id }
136
+
120
137
 
121
138
  ## Create Refund ##
122
139
 
@@ -146,6 +163,16 @@ charge.refund(options) -> refund object
146
163
  charge = EasyPing::Charge.find 'ch_0ijQi5LKqT5sEiOePOKWb1mF'
147
164
  refund = charge.refund 10, 'refund description'
148
165
 
166
+ # Returned Refund Object
167
+ refund.raw # raw response body, typically json string
168
+ refund.values # parsed response body, hash
169
+ refund.heasers # response headers
170
+ refund.status # response status, http code
171
+ refund.live? # livemode or not
172
+
173
+ refund.amount # attributes defined on Ping++ API
174
+ refund.description
175
+
149
176
 
150
177
  ## Retrieve Single Refund ##
151
178
 
@@ -194,6 +221,11 @@ charge.get_refund_list
194
221
  # Examples
195
222
  charge = EasyPing::Charge.find 'ch_0ijQi5LKqT5sEiOePOKWb1mF'
196
223
  refund_list = charge.all_refund limit: 5
224
+
225
+ # Returned Refund List Object
226
+ refund_list.has_more?
227
+ refund_list.url
228
+ refund_list.each {|re| puts re.id }
197
229
  ```
198
230
 
199
231
  Retrieve charge or refund object from async notification is easy.
@@ -235,21 +267,6 @@ ping = EasyPing.new({
235
267
  # do whatever you want without change of default configuration
236
268
  ping.charge 'order_number_3' 100, 'apple', 'one delicous big apple'
237
269
 
238
- ## Helpers ##
239
-
240
- # instance helpers
241
- charge.raw # raw response body, typically json string
242
- charge.values # response body, hash
243
- charge.heasers # response headers
244
- charge.status # response status, http code
245
- charge.live? # livemode or not
246
-
247
- # all attributes
248
- charge.amount
249
- charge.livemode
250
- charge.refunded
251
-
252
- # note: refund objects apply same rules above
253
270
 
254
271
  ## Config ##
255
272
  config = EasyPing.config
@@ -295,5 +312,3 @@ end
295
312
  ## Others
296
313
 
297
314
  For Ping++ API information, please visit https://pingplusplus.com/document/api
298
-
299
- If something doesn't work, feel free to report a bug or start an issue.
@@ -34,6 +34,8 @@ module EasyPing
34
34
  setup(get_prev_page.response)
35
35
  end
36
36
 
37
+ alias_method :has_more?, :has_more
38
+
37
39
  private
38
40
  def extract_params
39
41
  if params = url.match(/(?:\?).+$/)
@@ -1,3 +1,3 @@
1
1
  module EasyPing
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cxg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday