straight-api 0.0.1 → 0.0.2

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: 9971b5eec958a69dfda8afd798f2f0078bda14cd
4
- data.tar.gz: 557e882978d3a74f91565ba64954f52c83d396c6
3
+ metadata.gz: 709cce413b5edf3d2ae1a54d8de9f72eb754acfa
4
+ data.tar.gz: 72cf89d6129ad8e252f69182936886f92b208297
5
5
  SHA512:
6
- metadata.gz: 214f0fb557485f0bc0b384e4da3d2ea0ca3e370a302395e7d142492a368c5e83306fc6af04d91a33593abc7a8d0fa6e357e3aa43ea98a4fd9b521e8481bfc28b
7
- data.tar.gz: 92778fd7ff3ff18f16a3bfec4d9152134778b11680984ff0c931a6c82d384c71dc12d93200f784ea7fec44d21371a051a439beb58430ff9fc160971610819ed7
6
+ metadata.gz: f24eb5307a0a96a0920baa889ad3e099aebcff75863d248b8d863d5d259b1a61c9c73b00239154d8fe636be16f4f55448beef94ecdd5042c3aac082d7685ed16
7
+ data.tar.gz: fd7b712c58d2c4240575fb10cead4579e426f578ac7fb7e413e724f5e3ea1f41ff2e9efcc6242a53b992a31fb7f4d452422c5aabe578eebf5857daa1e8cee78c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Straight::Api
1
+ # Straight-API
2
2
 
3
- TODO: Write a gem description
3
+ Straight API is a API wrapper for [Straight Server](https://github.com/snitko/straight-server) for ruby and ruby on rails.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,14 +18,70 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install straight-api
20
20
 
21
+
22
+ and then require it in your ruby application:
23
+
24
+ ```ruby
25
+ require 'straight-api'
26
+ ```
27
+
21
28
  ## Usage
22
29
 
23
- TODO: Write usage instructions here
30
+ ### Initialize
31
+
32
+ Create a new instance of Straight:
33
+
34
+ ```ruby
35
+ straight = Straight.new("http://localhost:9696", 1)
36
+ ```
37
+
38
+ The first parameter the host of your Straight Server instance, and the second parameter is the gateway ID. You can include any extra parameters which will be included in every request.
39
+
40
+ ### Create an Order
41
+
42
+ You can create a new order:
43
+
44
+ ```ruby
45
+ order = straight.new(1, :currency => "USD")
46
+ ```
47
+
48
+ The first parameter is the amount. You can include any extra parameters (currency, etc.) which will be included in the request.
49
+
50
+ You can access the ID, status, tid, amount and address of your new order:
51
+
52
+ ```ruby
53
+ id = order.id
54
+ status = order.status
55
+ tid = order.tid
56
+ amount = order.amount
57
+ address = order.address
58
+ ```
59
+
60
+ ### Get an Order
61
+
62
+ You can get the information of an order:
63
+
64
+ ```ruby
65
+ order = straight.get(1)
66
+ ```
67
+
68
+ The first parameter is the order's ID. You can include any extra parameters which will be included in the request.
69
+
70
+ You can access the ID, status, tid, amount and address of the order:
71
+
72
+ ```ruby
73
+ id = order.id
74
+ status = order.status
75
+ tid = order.tid
76
+ amount = order.amount
77
+ address = order.address
78
+ ```
24
79
 
25
80
  ## Contributing
26
81
 
27
82
  1. Fork it ( https://github.com/[my-github-username]/straight-api/fork )
28
83
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
84
+ 3. Add your features and write tests for them
85
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
86
+ 5. Push to the branch (`git push origin my-new-feature`)
87
+ 6. Create a new Pull Request
data/lib/straight-api.rb CHANGED
@@ -8,7 +8,7 @@ class Straight
8
8
 
9
9
  def initialize (uri, gateway, options={})
10
10
  self.class.base_uri "#{uri}/gateways/#{gateway}"
11
- @options = options
11
+ @options = {query: options}
12
12
  end
13
13
 
14
14
  def create (amount, options={})
@@ -1,3 +1,3 @@
1
1
  class Straight
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: straight-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manthan Mallikarjun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-10 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler