atpay_ruby 0.0.5 → 0.0.8

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: 3d43d93d769df62049e904ef5cdf170c069a8c4e
4
- data.tar.gz: 6cf5319537ca51a399d9fa256e6feed093e66371
3
+ metadata.gz: c9072cee3f1a3f78de27b1faa811aa8c07621bf9
4
+ data.tar.gz: cb2018930a230116a5284643d4a2ed9350231308
5
5
  SHA512:
6
- metadata.gz: 3c170efc266798354d8be5d8473c2f01a5720e1f310edf4ac4392a1855dcf6c71925f1c24d9ff90522275c8881b5e79cacc54f53b2ac47ee5e39df502a2ee581
7
- data.tar.gz: e0f838be8ffdff53f81d1687937d22b87bcf7d44066367daab0c81927acdf947fde5f830c455cbff41187a0eb61b32c8032028785b8d60afee927de9d5a53049
6
+ metadata.gz: bab41f179b74def09fc147461d82b2c71a9d45bc3c9332f9d9d07e40aac2faff4005940245228a3ec722112b0e4d4dc22c6bb3df4e3b7fd98baf4f445f7f2ed5
7
+ data.tar.gz: e91d53db50f51d62bd24a1bf40d82a659301903f96a977d117a31e62a0edf19ea37544a619e8c542528d036080a063077524c3d7161913f65082f8e01ae5614c
data/README.md CHANGED
@@ -41,7 +41,7 @@ A sample Rails **Web Hook Endpoint**:
41
41
  # app/controllers/transactions_controller.rb
42
42
  class TransactionsController < ApplicationController
43
43
  def create
44
- hook = AtPay::Hook(ATPAY_SESSION, params)
44
+ hook = AtPay::Hook.new(ATPAY_SESSION, params['details'], params['signature'])
45
45
  render text: hook.details.inspect
46
46
  rescue AtPay::InvalidSignatureError
47
47
  head 403
@@ -172,6 +172,9 @@ registration.url
172
172
 
173
173
  registration.short
174
174
  => "atpay://{token_identifier}"
175
+
176
+ registration.qrcode_url
177
+ => "https://dashboard.atpay.com/offers/{token_identifier}.png"
175
178
  ```
176
179
 
177
180
  NOTE: For high traffic this solution may be inadequate. Contact @Pay for
@@ -195,7 +198,7 @@ You can set an **item details** that will display on the **Hosted Payment Captur
195
198
 
196
199
  ```ruby
197
200
  token = AtPay::Token::Invoice.new(session, 20.00, 'test@example.com')
198
- token.set_item_details = "Lorem Ipsum ..."
201
+ token.item_details = "Lorem Ipsum ..."
199
202
  email(token.to_s, receipient_address)
200
203
  ```
201
204
 
@@ -219,7 +222,7 @@ If you are using @Pay's webhook for inventory control, you can specify an initia
219
222
 
220
223
  ```ruby
221
224
  token = AtPay::Token::Invoice.new(session, 20.00, 'test@example.com')
222
- token.set_item_quantity = 3
225
+ token.item_quantity = 3
223
226
  email(token.to_s, receipient_address)
224
227
  ```
225
228
 
data/atpay_ruby.gemspec CHANGED
@@ -2,11 +2,11 @@ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'atpay_ruby'
5
- s.version = '0.0.5'
5
+ s.version = '0.0.8'
6
6
  s.summary = 'Ruby bindings for the @Pay API'
7
7
  s.description = ""
8
- s.authors = ['James Kassemi']
9
- s.email = ['james@atpay.com']
8
+ s.authors = ['James Kassemi', 'Isaiah Baca']
9
+ s.email = ['james@atpay.com', 'isaiah@atpay.com']
10
10
  s.homepage = 'https://atpay.com'
11
11
  s.license = 'MIT'
12
12
 
data/lib/atpay/hook.rb CHANGED
@@ -3,10 +3,10 @@ require 'multi_json'
3
3
 
4
4
  module AtPay
5
5
  class Hook
6
- def initialize(session, params)
6
+ def initialize(session, details, signature)
7
7
  @session = session
8
- @details = params['details']
9
- @signature = params['signature']
8
+ @details = details
9
+ @signature = signature
10
10
 
11
11
  verify_signature!
12
12
  verify_success!
@@ -39,7 +39,7 @@ module AtPay
39
39
  end
40
40
 
41
41
  def url=(url)
42
- self.user_data.url = url
42
+ self.user_data.signup_url = url
43
43
  @url = url
44
44
  end
45
45
 
@@ -72,11 +72,11 @@ module AtPay
72
72
  self.user_data.custom_user_data = str
73
73
  end
74
74
 
75
- def set_item_details=(item_details)
75
+ def item_details=(item_details)
76
76
  self.user_data.item_details = item_details
77
77
  end
78
78
 
79
- def set_item_quantity=(qty)
79
+ def item_quantity=(qty)
80
80
  self.user_data.quantity = qty
81
81
  end
82
82
 
@@ -12,6 +12,10 @@ module AtPay
12
12
  registration['url']
13
13
  end
14
14
 
15
+ def qrcode_url
16
+ "#{session.endpoint}/offers/#{registration['id']}.png"
17
+ end
18
+
15
19
  def id
16
20
  registration['id']
17
21
  end
@@ -22,7 +22,8 @@ describe AtPay::Token::Registration do
22
22
 
23
23
  registration = AtPay::Token::Registration.new(session, 'ex-token-123')
24
24
 
25
- expect(registration.short).to eq('atpay://123')
26
- expect(registration.url).to eq('http://example.com/123')
25
+ expect(registration.short).to eq('atpay://123')
26
+ expect(registration.url).to eq('http://example.com/123')
27
+ expect(registration.qrcode_url).to eq('https://dashboard.atpay.com/offers/123.png')
27
28
  end
28
29
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atpay_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Kassemi
8
+ - Isaiah Baca
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-07-30 00:00:00.000000000 Z
12
+ date: 2014-08-06 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rbnacl-libsodium
@@ -125,6 +126,7 @@ dependencies:
125
126
  description: ''
126
127
  email:
127
128
  - james@atpay.com
129
+ - isaiah@atpay.com
128
130
  executables:
129
131
  - atpay
130
132
  extensions: []