paywhirl 0.0.2 → 0.0.3
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 +4 -4
- data/Gemfile +1 -1
- data/{LICENSE.txt → LICENSE.md} +1 -1
- data/README.md +41 -11
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/lib/paywhirl.rb +46 -3
- data/lib/paywhirl/version.rb +1 -1
- data/paywhirl.gemspec +5 -2
- metadata +8 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80caccf3ff8fe41563ee0c5c7c87d75dadf069286d2ce5a6e62a8805446168f6
|
|
4
|
+
data.tar.gz: b91299d1c63da76f141e9833012b9b985250b6c7290a938dca5d3eb8e72c6ba9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59c442a50797e8fe5c14a7454b225ef070c9ab6930f0777912df1a25a1c878b4b965963cfb97a0017adc7402afd69d99851f553ccd1e913a1b47c5e137d6825c
|
|
7
|
+
data.tar.gz: ee286fbedf92320847e3abf3b8ecf6cffe3e0000a701e403eddf544ef3f548733750fe5fd591ee59e4b04d424a60d90f3cd5421b3023defc399fb5c38a5de865
|
data/Gemfile
CHANGED
data/{LICENSE.txt → LICENSE.md}
RENAMED
data/README.md
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
## A convenient PayWhirl API wrapper in Ruby
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Ruby [PayWhirl] library is provided to allow developers to access PayWhirl
|
|
4
|
+
services without needing to write their own API wrappers.
|
|
5
|
+
|
|
6
|
+
The [Documentation] linked here and below contains all of the available methods
|
|
7
|
+
for interacting with your PayWhirl account. If you would like to see additional
|
|
8
|
+
functionality added, feel free to submit an issue or a pull request.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
[PayWhirl]: https://app.paywhirl.com/
|
|
13
|
+
[Ruby]: http://www.ruby-lang.org/en/
|
|
14
|
+
[Documentation]: https://api.paywhirl.com/
|
|
15
|
+
### Usage Guide
|
|
16
|
+
|
|
17
|
+
- [Documentation]
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
|
|
21
|
+
- [Requirements](#requirements)
|
|
22
|
+
- [Installation](#installation)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
- [About](#about)
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- [Ruby] >= 1.9
|
|
29
|
+
- [Faraday](https://rubygems.org/gems/faraday)
|
|
4
30
|
|
|
5
31
|
## Installation
|
|
6
32
|
|
|
33
|
+
#### Suggeted installation method:
|
|
34
|
+
Use [RubyGems](https://rubygems.org/) and [Bundler](http://bundler.io/)
|
|
35
|
+
|
|
7
36
|
Add this line to your application's Gemfile:
|
|
8
37
|
|
|
9
38
|
```ruby
|
|
@@ -14,7 +43,7 @@ And then execute:
|
|
|
14
43
|
|
|
15
44
|
$ bundle
|
|
16
45
|
|
|
17
|
-
|
|
46
|
+
#### If you're not using Bundler:
|
|
18
47
|
|
|
19
48
|
$ gem install paywhirl
|
|
20
49
|
|
|
@@ -31,18 +60,19 @@ api_secret = "pwpsk_xxxxxxxxxxx"
|
|
|
31
60
|
paywhirl = PayWhirl.new(api_key, api_secret)
|
|
32
61
|
```
|
|
33
62
|
|
|
34
|
-
[Full docs](https://api.paywhirl.com)
|
|
35
63
|
|
|
36
|
-
## Development
|
|
37
64
|
|
|
38
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
39
65
|
|
|
40
|
-
|
|
66
|
+
## License
|
|
41
67
|
|
|
42
|
-
|
|
68
|
+
PayWhirl is copyright © 2016-2018 [PayWhirl Inc.][PayWhirl] This library is free
|
|
69
|
+
software, and may be redistributed under the terms specified in the [license].
|
|
43
70
|
|
|
44
|
-
|
|
71
|
+
[license]: LICENSE.md
|
|
45
72
|
|
|
46
|
-
##
|
|
73
|
+
## About
|
|
74
|
+
|
|
75
|
+
[PayWhirl Inc.][PayWhirl] and the names and logos for PayWhirl are
|
|
76
|
+
trademarks of PayWhirl inc.
|
|
47
77
|
|
|
48
|
-
|
|
78
|
+
For additional information, please see our [Terms of Use](https://app.paywhirl.com/terms) and [Privacy Policy](https://app.paywhirl.com/privacy)
|
data/bin/console
CHANGED
|
File without changes
|
data/bin/setup
CHANGED
|
File without changes
|
data/lib/paywhirl.rb
CHANGED
|
@@ -37,6 +37,21 @@ class PayWhirl
|
|
|
37
37
|
return self.get(cust)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
def get_addresses(customer_id = nil)
|
|
41
|
+
cust = "/customer/addresses/#{customer_id}"
|
|
42
|
+
return self.get(cust)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def get_address(address_id = nil)
|
|
46
|
+
cust = "/customer/address/#{address_id}"
|
|
47
|
+
return self.get(cust)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def get_profile(customer_id = nil)
|
|
51
|
+
cust = "/customer/profile/#{customer_id}"
|
|
52
|
+
return self.get(cust)
|
|
53
|
+
end
|
|
54
|
+
|
|
40
55
|
def create_customer(data = nil)
|
|
41
56
|
return self.post('/create/customer', data)
|
|
42
57
|
end
|
|
@@ -98,8 +113,11 @@ class PayWhirl
|
|
|
98
113
|
return self.post('/subscribe/customer', data)
|
|
99
114
|
end
|
|
100
115
|
|
|
101
|
-
def update_subscription(subscription_id = nil, plan_id = nil)
|
|
116
|
+
def update_subscription(subscription_id = nil, plan_id = nil, quantity = nil)
|
|
102
117
|
data = {'subscription_id'=>subscription_id, 'plan_id'=>plan_id}
|
|
118
|
+
if (quantity) then
|
|
119
|
+
data.merge!(quantity: quantity)
|
|
120
|
+
end
|
|
103
121
|
return self.post('/update/subscription', data)
|
|
104
122
|
end
|
|
105
123
|
|
|
@@ -113,11 +131,32 @@ class PayWhirl
|
|
|
113
131
|
return self.get(format)
|
|
114
132
|
end
|
|
115
133
|
|
|
116
|
-
def get_invoices(customer_id = nil)
|
|
117
|
-
format = "/invoices/#{customer_id}"
|
|
134
|
+
def get_invoices(customer_id = nil, all_invoices = 0)
|
|
135
|
+
format = "/invoices/#{customer_id}/#{all_invoices}"
|
|
118
136
|
return self.get(format)
|
|
119
137
|
end
|
|
120
138
|
|
|
139
|
+
def process_invoice(invoice_id = nil)
|
|
140
|
+
format = "/invoice/#{invoice_id}/process"
|
|
141
|
+
return self.post(format)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def update_invoice_card(invoice_id = nil, card_id = nil)
|
|
145
|
+
data = {'card_id'=>card_id}
|
|
146
|
+
format = "/invoice/#{invoice_id}/card"
|
|
147
|
+
return self.post(format, data)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def update_invoice_items(invoice_id = nil, line_items = nil)
|
|
151
|
+
format = "/invoice/#{invoice_id}/items"
|
|
152
|
+
return self.post(format, line_items)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def create_invoice(data = nil)
|
|
156
|
+
format = "/invoices"
|
|
157
|
+
return self.post(format, data)
|
|
158
|
+
end
|
|
159
|
+
|
|
121
160
|
def get_gateways()
|
|
122
161
|
return self.get('/gateways')
|
|
123
162
|
end
|
|
@@ -178,6 +217,10 @@ class PayWhirl
|
|
|
178
217
|
return self.get(format)
|
|
179
218
|
end
|
|
180
219
|
|
|
220
|
+
def send_email(data = nil)
|
|
221
|
+
return self.post('/send-email', data)
|
|
222
|
+
end
|
|
223
|
+
|
|
181
224
|
def get_account()
|
|
182
225
|
return self.get('/account')
|
|
183
226
|
end
|
data/lib/paywhirl/version.rb
CHANGED
data/paywhirl.gemspec
CHANGED
|
@@ -9,11 +9,14 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.version = Paywhirl::VERSION
|
|
10
10
|
spec.authors = ["PayWhirl"]
|
|
11
11
|
spec.email = ["megrims@gmail.com"]
|
|
12
|
-
|
|
12
|
+
spec.required_ruby_version = ">= 1.9"
|
|
13
13
|
spec.summary = %q{API library for simplifying interaction with PayWhirl services.}
|
|
14
14
|
spec.homepage = "https://github.com/paywhirl/ruby-pwclient"
|
|
15
15
|
spec.license = "MIT"
|
|
16
|
-
|
|
16
|
+
spec.description = <<-EOF
|
|
17
|
+
This library provides an interface to manage your PayWhirl account from
|
|
18
|
+
within your own Ruby code.
|
|
19
|
+
EOF
|
|
17
20
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
18
21
|
f.match(%r{^(test|spec|features)/})
|
|
19
22
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paywhirl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- PayWhirl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -66,7 +66,9 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 0.13.1
|
|
69
|
-
description:
|
|
69
|
+
description: |2
|
|
70
|
+
This library provides an interface to manage your PayWhirl account from
|
|
71
|
+
within your own Ruby code.
|
|
70
72
|
email:
|
|
71
73
|
- megrims@gmail.com
|
|
72
74
|
executables: []
|
|
@@ -75,7 +77,7 @@ extra_rdoc_files: []
|
|
|
75
77
|
files:
|
|
76
78
|
- ".gitignore"
|
|
77
79
|
- Gemfile
|
|
78
|
-
- LICENSE.
|
|
80
|
+
- LICENSE.md
|
|
79
81
|
- README.md
|
|
80
82
|
- Rakefile
|
|
81
83
|
- bin/console
|
|
@@ -95,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
95
97
|
requirements:
|
|
96
98
|
- - ">="
|
|
97
99
|
- !ruby/object:Gem::Version
|
|
98
|
-
version: '
|
|
100
|
+
version: '1.9'
|
|
99
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
102
|
requirements:
|
|
101
103
|
- - ">="
|
|
@@ -103,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
103
105
|
version: '0'
|
|
104
106
|
requirements: []
|
|
105
107
|
rubyforge_project:
|
|
106
|
-
rubygems_version: 2.7.
|
|
108
|
+
rubygems_version: 2.7.6
|
|
107
109
|
signing_key:
|
|
108
110
|
specification_version: 4
|
|
109
111
|
summary: API library for simplifying interaction with PayWhirl services.
|