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 +4 -4
- data/README.md +62 -6
- data/lib/straight-api.rb +1 -1
- data/lib/straight-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 709cce413b5edf3d2ae1a54d8de9f72eb754acfa
|
4
|
+
data.tar.gz: 72cf89d6129ad8e252f69182936886f92b208297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24eb5307a0a96a0920baa889ad3e099aebcff75863d248b8d863d5d259b1a61c9c73b00239154d8fe636be16f4f55448beef94ecdd5042c3aac082d7685ed16
|
7
|
+
data.tar.gz: fd7b712c58d2c4240575fb10cead4579e426f578ac7fb7e413e724f5e3ea1f41ff2e9efcc6242a53b992a31fb7f4d452422c5aabe578eebf5857daa1e8cee78c
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Straight
|
1
|
+
# Straight-API
|
2
2
|
|
3
|
-
|
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
|
-
|
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.
|
30
|
-
4.
|
31
|
-
5.
|
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
data/lib/straight-api/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|