cryptopay 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea9dfc945b82a35e2b9fc821f8149aed82ff6883
4
- data.tar.gz: cb4b01d2c783acf17b22e848bdc8d8f7308d6e7c
3
+ metadata.gz: 3725bd46d2d4be5a5aab73b9a990541e56634a39
4
+ data.tar.gz: a0fef885b83407e3631e3ca78aab3e507441eb99
5
5
  SHA512:
6
- metadata.gz: b51257dc276b500ef850696f0936a9ce8bd34703761b3528b5cca92b67d030ae5f8812657dbd227caffd850808343ab6a01b2984a2c72cdcbe6624a492d215fe
7
- data.tar.gz: 620ed0ff4127cff7eb4a3eab8564598e05478fc3c51090d9c6ce004c98d2e14bcba11de83106542aa29aa9bb7615d998009f4ba5bfd08897b0cde5ac2afc7ceb
6
+ metadata.gz: bcc1682789bff725c3db88dc8531b0f6eb77b3f5b7500d2f4e6c07d4020d34ab1bc563888c21dcb196b39f81ea20303d44780c0e192aebe4513d3a091c1813c9
7
+ data.tar.gz: 067527ce63e033c1cf9f4c5cc2a2b597a923fb32a62851b97fd00713b7d36feebaf340f3b45a29738b03f1db44833bb8aa2ba0f648683f9f2f7d9692a29d76b5
data/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ # Cryptopay
2
+ Easily accept Bitcoin payment with Cryptopay Payment API
3
+
4
+ Before you will be able to start using this gem, you will need to obtain an API key in Account - Merchant Tools - Settings.
5
+
6
+
1
7
  # Installation
2
8
 
3
9
  ```ruby
@@ -5,7 +11,7 @@ gem install cryptopay
5
11
  ```
6
12
 
7
13
 
8
- or your Gemfile:
14
+ or in your Gemfile:
9
15
 
10
16
  ```ruby
11
17
  gem 'cryptopay'`
@@ -27,7 +33,15 @@ invoice = Cryptopay.new_invoice id: 'test',
27
33
  currency: 'GBP',
28
34
  description: 'test description',
29
35
  success_redirect_url: 'https://cryptopay.me',
30
- callback_url: 'https://cryptopay.me'
36
+ callback_url: 'https://cryptopay.me',
37
+ callback_params: {
38
+ customer_id: "12389",
39
+ array_params: ['Black', '36' 'XL'],
40
+ nested_hash: {
41
+ validations_hash: "other",
42
+ array_params_again: ['test1', 'test2' 'test3']
43
+ }
44
+ }
31
45
  ```
32
46
  now invoice object is hash with next attributes
33
47
  ```ruby
@@ -37,7 +51,14 @@ status: 'pending',
37
51
  btc_price: 0.0055,
38
52
  btc_address: '16KcaBuNbHXhTweJspFkSku2nmvvyV8NoL',
39
53
  short_id: 'CF47603E',
40
- callback_params: nil,
54
+ callback_params: {
55
+ validations_hash: "SUPERSECRETHASH",
56
+ array_params: ['test1', 'test2' 'test3'],
57
+ nested_hash: {
58
+ validations_hash: "other",
59
+ array_params_again: ['test1', 'test2' 'test3']
60
+ }
61
+ },
41
62
  id: 'test',
42
63
  price: 2.32,
43
64
  currency: 'GBP',
@@ -45,14 +66,14 @@ created_at: 1387305401,
45
66
  valid_till: 1387306001
46
67
  ```
47
68
 
48
- You can save `uuid` and use this later for update invoice status:
69
+ You can save `uuid` and use this later to update invoice status:
49
70
  ```ruby
50
71
  Cryptopay.invoice invoice['uuid']
51
72
  ```
52
73
 
53
74
 
54
75
  # Errors handle
55
- classic ruby-way
76
+ Error handling is done in classic ruby way:
56
77
  ```ruby
57
78
  begin
58
79
  params = Cryptopay.new_invoice id: 'test',
@@ -6,7 +6,14 @@ require 'cryptopay/net'
6
6
  module Cryptopay
7
7
  class Error < Exception; attr_accessor :errors; end
8
8
  # API Key
9
- mattr_accessor :key
9
+ @@api_key = ''
10
+ def self.key=(new_key)
11
+ @@api_key = new_key
12
+ end
13
+
14
+ def self.key
15
+ @@api_key
16
+ end
10
17
 
11
18
  def self.new_invoice(params = {})
12
19
  sanity_check!
@@ -1,3 +1,3 @@
1
1
  module Cryptopay
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopay
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
  - vadim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2014-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler