paylike 0.1.4 → 0.1.7
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
- metadata +7 -14
- data/lib/paylike.rb +0 -15
- data/lib/paylike/api.rb +0 -37
- data/lib/paylike/configuration.rb +0 -25
- data/lib/paylike/endpoints.rb +0 -21
- data/lib/paylike/request.rb +0 -9
- data/lib/paylike/version.rb +0 -3
- data/paylike.gemspec +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35bc52b18884a422e791d33436779920be7e0ea7
|
4
|
+
data.tar.gz: 2e9076ea935f68f9eb21fbae00f3c3da4c48e547
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82e1b0fbd0a662abfc45c99e0efa37535289c42daec981387f95f8085903759b135254a4aedf694c5298431e06e9cfc60bf5e89123f805d1ec5c38e4d643d5ce
|
7
|
+
data.tar.gz: 7f84a449d234991a6e775ceb09fdf1c12dce3a479c6dd251a238067c05bbdd492b553f9aac3a37970beecb605c7973dc7d0eaff2e8c1b90b8b198fb25b54e589
|
metadata
CHANGED
@@ -1,42 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paylike
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kostas Lamprou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unirest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '1.0'
|
27
27
|
description: An implementation of Paylike API
|
28
28
|
email: lamprou@live.com
|
29
29
|
executables: []
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
|
-
files:
|
33
|
-
- lib/paylike.rb
|
34
|
-
- lib/paylike/api.rb
|
35
|
-
- lib/paylike/configuration.rb
|
36
|
-
- lib/paylike/endpoints.rb
|
37
|
-
- lib/paylike/request.rb
|
38
|
-
- lib/paylike/version.rb
|
39
|
-
- paylike.gemspec
|
32
|
+
files: []
|
40
33
|
homepage: http://rubygems.org/gems/paylike
|
41
34
|
licenses:
|
42
35
|
- MIT
|
data/lib/paylike.rb
DELETED
data/lib/paylike/api.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
module Paylike
|
2
|
-
class Api
|
3
|
-
|
4
|
-
#
|
5
|
-
# Fetch current app
|
6
|
-
#
|
7
|
-
|
8
|
-
def self.me
|
9
|
-
req = Request._http(Endpoints.me)
|
10
|
-
req.body if req.code == 200
|
11
|
-
end
|
12
|
-
|
13
|
-
#
|
14
|
-
# Fetch a transaction
|
15
|
-
#
|
16
|
-
|
17
|
-
def self.transaction(transaction_id)
|
18
|
-
req = Request._http(Endpoints.transaction(transaction_id))
|
19
|
-
req.body if req.code == 200
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# Generate Payment Link
|
24
|
-
#
|
25
|
-
|
26
|
-
def self.generate_payment_link(amount, currency=nil, reference=nil, text=nil, url=nil)
|
27
|
-
public_key = Configuration.public_key
|
28
|
-
currency ||= "EUR"
|
29
|
-
"#{Endpoints.pos}?key=#{public_key}&amount=#{amount}¤cy=#{currency}#{reference ? "&reference=#{reference}" : ""}#{text ? "&text=#{text}" : ""}#{url ? "&redirect=#{url}" : ""}&locale=en_US"
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.generate_payment_link_encoded(amount, currency=nil, reference=nil, text=nil, url=nil)
|
33
|
-
URI.encode(generate_payment_link(amount, currency, reference, text, url))
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Paylike
|
2
|
-
class Configuration
|
3
|
-
|
4
|
-
READABLE_ATTRIBUTES = [
|
5
|
-
:public_key,
|
6
|
-
:private_key
|
7
|
-
]
|
8
|
-
|
9
|
-
WRITABLE_ATTRIBUTES = [
|
10
|
-
:public_key,
|
11
|
-
:private_key
|
12
|
-
]
|
13
|
-
|
14
|
-
class << self
|
15
|
-
attr_writer *WRITABLE_ATTRIBUTES
|
16
|
-
attr_reader *READABLE_ATTRIBUTES
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
def self.test_key
|
21
|
-
raise "Configuration error: Private key is missing." unless private_key
|
22
|
-
puts private_key
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/paylike/endpoints.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
class Endpoints
|
2
|
-
|
3
|
-
def self.base_url
|
4
|
-
"https://api.paylike.io/"
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.pos
|
8
|
-
"https://pos.paylike.io/"
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.me
|
12
|
-
"#{base_url}" + "me"
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.transaction(transaction_id)
|
16
|
-
"#{base_url}" + "transactions/" + transaction_id
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
data/lib/paylike/request.rb
DELETED
data/lib/paylike/version.rb
DELETED
data/paylike.gemspec
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
$:.push File.expand_path("../lib", __FILE__)
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = "paylike"
|
5
|
-
s.version = "0.1.4"
|
6
|
-
s.date = "2016-12-13"
|
7
|
-
s.summary = "Paylike gem"
|
8
|
-
s.description = "An implementation of Paylike API"
|
9
|
-
s.authors = ["Kostas Lamprou"]
|
10
|
-
s.email = "lamprou@live.com"
|
11
|
-
#s.files = ["lib/Paylike.rb"]
|
12
|
-
s.files = Dir.glob ["lib/**/*.{rb,crt}", "spec/**/*", "*.gemspec"]
|
13
|
-
s.license = "MIT"
|
14
|
-
s.homepage = "http://rubygems.org/gems/paylike"
|
15
|
-
s.add_dependency "unirest"
|
16
|
-
end
|