xfers 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/examples/charges_example.rb +12 -4
- data/examples/intents_example.rb +3 -5
- data/lib/xfers/charge.rb +0 -1
- data/lib/xfers/intent.rb +1 -1
- data/lib/xfers/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: 05efb71141589d2e20541e2e624ccfc72fe15630
|
4
|
+
data.tar.gz: 9aff7a41ec9e557c9672c249120a96b0207278eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a9935cc19d65dc9dcd6e760db7a82ea13028e6f60a80e92bece09b2bce97b53b97ff3dccef1acc594dcf999cc4e721c4533efa2e021243b6a23e7a07f292a34
|
7
|
+
data.tar.gz: 5bf3e4d9b4d81821dcdffc933f328b9406b37eb74de36033c9e8fde30a8b60b5a5740b2375db0b9d9a93215c23ef91d06cdb6766ea71607d5b795a4d6d95d6a7
|
data/README.md
CHANGED
@@ -31,10 +31,8 @@ gem 'xfers'
|
|
31
31
|
```
|
32
32
|
|
33
33
|
## Usage
|
34
|
-
|
35
|
-
|
36
|
-
available in the [Dashboard][dashboard]. Assign its value to `Xfers.api_key`
|
37
|
-
and the library will send it along automatically with every request:
|
34
|
+
Set the Xfers API key, the endpoint you are using and you are good to go!
|
35
|
+
These settings can either be placed in `config/initializers/xfers.rb` or right before the API call as shown below.
|
38
36
|
|
39
37
|
``` ruby
|
40
38
|
require "xfers"
|
@@ -69,4 +67,4 @@ end
|
|
69
67
|
|
70
68
|
## Documentation
|
71
69
|
|
72
|
-
Please see http://docs.xfers.io/ for up-to-date documentation.
|
70
|
+
Please see http://docs.xfers.io/ for up-to-date documentation.
|
data/examples/charges_example.rb
CHANGED
@@ -21,10 +21,18 @@ end
|
|
21
21
|
begin
|
22
22
|
puts 'Creating charge...'
|
23
23
|
params = {
|
24
|
-
'
|
25
|
-
'
|
26
|
-
'
|
27
|
-
'
|
24
|
+
'redirect' => 'false',
|
25
|
+
'amount' => '9.99',
|
26
|
+
'currency' => 'SGD',
|
27
|
+
'notify_url' => 'https://mysite.com/payment_notification',
|
28
|
+
'return_url' => 'https://mysite.com/return',
|
29
|
+
'cancel_url' => 'https://mysite.com/cancel',
|
30
|
+
'order_id' => 'AZ9912',
|
31
|
+
'description' => 'unused red dress',
|
32
|
+
'shipping' => '2.50',
|
33
|
+
'tax' => '0.0',
|
34
|
+
'items' => [{'description' => 'Red dress Size M', 'price' => '9.99', 'quantity' => 1, 'name' => 'Red dress'}],
|
35
|
+
'meta_data' => {'firstname'=> 'Tianwei', 'lastname'=> 'Liu'}
|
28
36
|
}
|
29
37
|
resp = Xfers::Charge.create params
|
30
38
|
charge_id = resp[:id]
|
data/examples/intents_example.rb
CHANGED
@@ -22,11 +22,9 @@ rescue Xfers::XfersError => e
|
|
22
22
|
end
|
23
23
|
|
24
24
|
begin
|
25
|
-
puts '
|
26
|
-
|
27
|
-
|
28
|
-
puts intent
|
29
|
-
}
|
25
|
+
puts 'Current intent...'
|
26
|
+
intent = Xfers::Intent.retrieve
|
27
|
+
puts intent
|
30
28
|
rescue Xfers::XfersError => e
|
31
29
|
puts e.to_s
|
32
30
|
end
|
data/lib/xfers/charge.rb
CHANGED
data/lib/xfers/intent.rb
CHANGED
data/lib/xfers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xfers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xfers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|