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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 220333a3e62aa9e39a68d2ff5ed83b3da7d175dd8759e24a32ae2917ff5e4dc7
4
- data.tar.gz: 9ee62555e66e2330021374c4723b105089e30ac1f1a80f07cc76254f3bf0e973
3
+ metadata.gz: 80caccf3ff8fe41563ee0c5c7c87d75dadf069286d2ce5a6e62a8805446168f6
4
+ data.tar.gz: b91299d1c63da76f141e9833012b9b985250b6c7290a938dca5d3eb8e72c6ba9
5
5
  SHA512:
6
- metadata.gz: dcf6aca932e4227cf87955a1115ba61d14eb07183dedd36e9851b300e86aed4d02423e46996d03d3981dcc531a32c0d0c4aaef7d31efc87824b3746db3144d31
7
- data.tar.gz: 2b283a5cadf031bfe08a2c862592024b6690e0fb39cac9c48214e23dc94d9ad6f414373bbdba89aa4b44770004d3bcd0c7c771d063472f2d9699e2e06c18b35d
6
+ metadata.gz: 59c442a50797e8fe5c14a7454b225ef070c9ab6930f0777912df1a25a1c878b4b965963cfb97a0017adc7402afd69d99851f553ccd1e913a1b47c5e137d6825c
7
+ data.tar.gz: ee286fbedf92320847e3abf3b8ecf6cffe3e0000a701e403eddf544ef3f548733750fe5fd591ee59e4b04d424a60d90f3cd5421b3023defc399fb5c38a5de865
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) {|Ruby PayWhirl Client| "https://github.com/paywhirl/ruby-pwclient" }
4
4
 
5
5
  # Specify your gem's dependencies in paywhirl.gemspec
6
6
  gemspec
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 leafknight
3
+ Copyright (c) 2017 PayWhirl
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,9 +1,38 @@
1
- # Paywhirl
1
+ ## A convenient PayWhirl API wrapper in Ruby
2
2
 
3
- Paywhirl's Ruby API library is provided for developers to easily interface with Paywhirl's servers.
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
- Or install it yourself as:
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
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
66
+ ## License
41
67
 
42
- ## Contributing
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
- Bug reports and pull requests are welcome on GitHub at https://github.com/paywhirl/ruby-pwclient
71
+ [license]: LICENSE.md
45
72
 
46
- ## License
73
+ ## About
74
+
75
+ [PayWhirl Inc.][PayWhirl] and the names and logos for PayWhirl are
76
+ trademarks of PayWhirl inc.
47
77
 
48
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
78
+ For additional information, please see our [Terms of Use](https://app.paywhirl.com/terms) and [Privacy Policy](https://app.paywhirl.com/privacy)
File without changes
data/bin/setup CHANGED
File without changes
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Paywhirl
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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.2
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: 2017-12-23 00:00:00.000000000 Z
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.txt
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: '0'
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.3
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.