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 +4 -4
- data/README.md +33 -18
- data/lib/easy_ping/model.rb +2 -0
- data/lib/easy_ping/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59b865bf93d8065f8ff0bfc5fb32f81bba44b671
|
4
|
+
data.tar.gz: 77481e60765322794b0a056d197adddfb04fc2be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
**
|
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.
|
data/lib/easy_ping/model.rb
CHANGED
data/lib/easy_ping/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|