synapse_client 0.2.1 → 0.2.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: 81c43fbd4dcf5abc9d1c1d3476ba43c156af5eab
4
- data.tar.gz: 0b6ed066ae241f0e9b43d51c7d705ed64ad946fb
3
+ metadata.gz: 131aec4ce3d48a03376e146f41f4092ca2fc1a35
4
+ data.tar.gz: d0f75baee590de793d9f237dd8359cf8fb7520ed
5
5
  SHA512:
6
- metadata.gz: a47136d71b133f806ca4c17fedc152bb01fae2d8d26731d682dfeef4f2c326558359d6479bea68672261bd3228c79135383e8d8e2810c0d8a5a962deeccf8406
7
- data.tar.gz: 5ed034d4f599f0d06f4fb13140ff23262f1eb07dd7dc9c84617724171317844bf2b1bf19f13ccd72e08eee737f785185b952dcfe7945718faa95355d65f54c92
6
+ metadata.gz: f8bfecdafeca230a074ec90e8fd0e304becebdc12508ed4ec42062712ab14e3b6f35ee4f967f664c4c1f422d25f71e1186944c9a035188bf2c737d59950789e1
7
+ data.tar.gz: d234b470917a3da844ef552b3459a818ae986e03dddc598e268c1158e254ebe6406cc4e01ccc1b1e6f04b23fe948bfd9aafb55fb13646e2d6e944900a2ce9818
data/README.md CHANGED
@@ -110,9 +110,6 @@ _See the specs for the most up to date usage demo._
110
110
 
111
111
  ## TODO (in order of priority)
112
112
 
113
- * Better synapse error handling
114
- * Test for errors
115
- * HTTP Error handling
116
113
  * MassPay
117
114
  * Refresh access tokens
118
115
  * Security Questions
@@ -123,7 +120,7 @@ _See the specs for the most up to date usage demo._
123
120
 
124
121
  # Links
125
122
 
126
- * [dev.synapsepay.com](http://dev.synapsepay.com)
123
+ * [synapsepay.readme.io/v2.0/docs](http://synapsepay.readme.io/v2.0/docs)
127
124
  * [rubygems.org/gems/synapse_client](https://rubygems.org/gems/synapse_client)
128
125
 
129
126
 
@@ -39,6 +39,34 @@ module SynapseClient
39
39
  "poll"
40
40
  end
41
41
 
42
+ def self.status_object_for_key(key)
43
+ case key
44
+ when -1
45
+ {status: "Queued", description: "Order has been queued by SynapsePay and we are currently investigating it."}
46
+ when 0
47
+ {status: "Queued", description: "Order has been queued and is waiting for merchant approval to process."}
48
+ when 1
49
+ {status: "Created", description: "Order created but still needs to be fetched from the bank account."}
50
+ when 2
51
+ {status: "In Progress", description: "The funds are being fetched from the sender’s bank account, in receiver’s Synapse account in 1-2 Business Days."}
52
+ when 3
53
+ {status: "Settled", description: "Transaction completed and the funds have been added to the receiver’s Synapse account."}
54
+ when 4
55
+ {status: "Refunded/Cancelled", description: "The order has been voided."}
56
+ when 5
57
+ {status: "Returned", description: "Received an ACH return from the sender’s bank account. Which means someone is in trouble."}
58
+ else
59
+ {status: "Unknown", description: "Unknown status key. The API may have changed."}
60
+ end
61
+ end
62
+
63
+ def status_label
64
+ Order.status_object_for_key(status)[:status]
65
+ end
66
+ def status_description
67
+ Order.status_object_for_key(status)[:description]
68
+ end
69
+
42
70
  def retrieve_params
43
71
  {:order_id => @id}
44
72
  end
@@ -1,3 +1,3 @@
1
1
  module SynapseClient
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -41,9 +41,9 @@ describe SynapseClient::Order do
41
41
 
42
42
  expect(order).to be_a SynapseClient::Order
43
43
 
44
- #expect(order.amount).to eq(@amount_to_charge)
45
- #expect(order.id).to be_a Fixnum
46
44
  expect(order.status).to be_a Fixnum
45
+ expect(order.status_label).to be_a String
46
+ expect(order.status_description).to be_a String
47
47
  end
48
48
  end
49
49
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapse_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Matthias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-02 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client