atpay_ruby 0.0.5 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/atpay_ruby.gemspec +3 -3
- data/lib/atpay/hook.rb +3 -3
- data/lib/atpay/token/core.rb +3 -3
- data/lib/atpay/token/registration.rb +4 -0
- data/spec/token/registration.rb +3 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9072cee3f1a3f78de27b1faa811aa8c07621bf9
|
4
|
+
data.tar.gz: cb2018930a230116a5284643d4a2ed9350231308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
+
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,
|
6
|
+
def initialize(session, details, signature)
|
7
7
|
@session = session
|
8
|
-
@details =
|
9
|
-
@signature =
|
8
|
+
@details = details
|
9
|
+
@signature = signature
|
10
10
|
|
11
11
|
verify_signature!
|
12
12
|
verify_success!
|
data/lib/atpay/token/core.rb
CHANGED
@@ -39,7 +39,7 @@ module AtPay
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def url=(url)
|
42
|
-
self.user_data.
|
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
|
75
|
+
def item_details=(item_details)
|
76
76
|
self.user_data.item_details = item_details
|
77
77
|
end
|
78
78
|
|
79
|
-
def
|
79
|
+
def item_quantity=(qty)
|
80
80
|
self.user_data.quantity = qty
|
81
81
|
end
|
82
82
|
|
data/spec/token/registration.rb
CHANGED
@@ -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
|
26
|
-
expect(registration.url).to
|
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.
|
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-
|
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: []
|