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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35b472a1dbed8803adec5ac5366ddfd4356965e9
4
- data.tar.gz: db0e07a6c28b63d6d6349b353224fac335b492e5
3
+ metadata.gz: 05efb71141589d2e20541e2e624ccfc72fe15630
4
+ data.tar.gz: 9aff7a41ec9e557c9672c249120a96b0207278eb
5
5
  SHA512:
6
- metadata.gz: 2cc5b660e7e126efccdb9c7642ae8254f8167cebf299f10368231fa287382dd61b6c89464d14440e106d487c40c95981f6e2a1649ac0cb6ff7d383d9c5fa9a17
7
- data.tar.gz: 41c503d906ad7eb16447a96f1433b70bb13d56a1ed6a3c33e4bc0bdb9e455e955dacc9e9fe927e2b18d3bff5f74a01092a9a15e58b27179dd2175eb2cc671b46
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
- The library needs to be configured with your account's secret key which is
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.
@@ -21,10 +21,18 @@ end
21
21
  begin
22
22
  puts 'Creating charge...'
23
23
  params = {
24
- 'amount'=> '1.99',
25
- 'currency'=> 'SGD',
26
- 'order_id'=> 'A01231z2',
27
- 'description'=> 'Carousell user - Konsolidate'
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]
@@ -22,11 +22,9 @@ rescue Xfers::XfersError => e
22
22
  end
23
23
 
24
24
  begin
25
- puts 'Listing all intents...'
26
- intents = Xfers::Intent.list_all
27
- intents.each { |intent|
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
@@ -13,7 +13,6 @@ module Xfers
13
13
 
14
14
  def self.create(params, connect_key=nil)
15
15
  raise InvalidRequestError.new 'Params cannot be empty', 400 if params.nil? or params == ''
16
- params['redirect'] = 'false'
17
16
  Xfers::APIOperations.post params, RESOUCE_URL, connect_key
18
17
  end
19
18
 
data/lib/xfers/intent.rb CHANGED
@@ -2,7 +2,7 @@ module Xfers
2
2
  module Intent
3
3
  RESOUCE_URL = '/intents'
4
4
 
5
- def self.list_all(connect_key=nil)
5
+ def self.retrieve(connect_key=nil)
6
6
  Xfers::APIOperations.get(nil, RESOUCE_URL, connect_key)
7
7
  end
8
8
 
data/lib/xfers/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xfers
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.0'
3
3
  end
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.1
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-20 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client