payfort_start 0.0.4 → 0.0.5

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: 33b0bfdca559a9ca3276432bdf7cde6a479fa080
4
- data.tar.gz: fdb8087d4461755e61a7ab0313ef6075dea73ba1
3
+ metadata.gz: 1b92053618da5072645af76b1be1afe2412b4951
4
+ data.tar.gz: 0ee0a25e6456c690b84c351258ebf8096dc809ee
5
5
  SHA512:
6
- metadata.gz: 0bcdb5efc99c2aedd93028aabc690247658340c957f45cc4d19e45a9c2e8dd9eeb7082de92c1f1fefd6d8eee7f8176676b352c509b0aa49d93ca1cf92ac9803a
7
- data.tar.gz: b00f6da8ca8a47450c562f6ca717335d82ce1e59351a3b274b5e7c90e2e3c609e980b39ebebbabd8dab89afa42e260c478ca4d9b43ee8aee2ff3e57bdfbdeaf4
6
+ metadata.gz: 9b392412637c9b5035bc18ed1e91c2541910ed61d42c1fff8a28dd6e98f73feebfda2f79c0fa8f59d92e23f36fbfd8d4ec4ed640c80d82910c5c0d578cba3fdf
7
+ data.tar.gz: 1e590e385c0ff63f68477d7a303ff1009fd1fdc16210fce8e165801766ccc4e610aef49e9f24b23b8e637f81366a993f833b28f7c9a53d21101d85cd61f29d4d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- payfort_start (0.0.3)
4
+ payfort_start (0.0.4)
5
5
  httparty (~> 0.13)
6
6
  json (~> 1.8)
7
7
 
@@ -15,7 +15,7 @@ GEM
15
15
  columnize (0.9.0)
16
16
  debugger-linecache (1.2.0)
17
17
  diff-lcs (1.2.5)
18
- httparty (0.13.5)
18
+ httparty (0.13.7)
19
19
  json (~> 1.8)
20
20
  multi_xml (>= 0.5.2)
21
21
  json (1.8.3)
data/README.md CHANGED
@@ -51,7 +51,7 @@ Start::Charge.create(
51
51
  )
52
52
  ```
53
53
 
54
- This transaction should be successful since we used the `4242 4242 4242 4242` test credit card. For a complete list of test cards, and their expected output you can check out this link [here](https://docs.start.payfort.com/testing/).
54
+ This transaction should be successful since we used the `4242 4242 4242 4242` test credit card. For a complete list of test cards, and their expected output you can check out this link [here](https://docs.start.payfort.com/guides/testing/).
55
55
 
56
56
  How can you tell that it was successful? Well, if no exception is raised then you're in the clear.
57
57
 
@@ -0,0 +1,5 @@
1
+ module Start
2
+ class Token < BaseResource
3
+ self.path = '/tokens'
4
+ end
5
+ end
data/lib/start/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Start
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
data/lib/start.rb CHANGED
@@ -3,6 +3,7 @@ require "start/base_resource"
3
3
  require "start/version"
4
4
  require "start/customer"
5
5
  require "start/charge"
6
+ require "start/token"
6
7
  require "start/errors/start_error"
7
8
  require "start/errors/authentication_error"
8
9
  require "start/errors/banking_error"
@@ -23,6 +23,30 @@ describe Start::Charge do
23
23
  expect(response['captured_amount']).to eq(400)
24
24
  end
25
25
 
26
+ context 'when metadata parameter is passed' do
27
+ it 'creates charge with metadata' do
28
+ response = Start::Charge.create(
29
+ :amount => 400,
30
+ :currency => "usd",
31
+ :email => "ahmed@example.com",
32
+ :card => {
33
+ :name => "Abdullah Ahmed",
34
+ :number => "4242424242424242",
35
+ :exp_month => 11,
36
+ :exp_year => 2016,
37
+ :cvc => 123
38
+ },
39
+ :description => "Charge for test@example.com",
40
+ :metadata => {
41
+ :reference_id => "12334567890",
42
+ :tag => "new"
43
+ }
44
+ )
45
+
46
+ expect(response['metadata']).to eq({"reference_id"=>"12334567890", "tag"=>"new"})
47
+ end
48
+ end
49
+
26
50
  it "must list created charges" do
27
51
  response = Start::Charge.all()
28
52
 
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe Start::Token do
4
+ before do
5
+ Start.api_key = "test_open_k_d93727030f5ae0e5ff73"
6
+ end
7
+
8
+ it "must create a new token" do
9
+ response = Start::Token.create(
10
+ :number => "4242424242424242",
11
+ :exp_month => 11,
12
+ :exp_year => 2016,
13
+ :cvc => 123
14
+ )
15
+
16
+ expect(response['id']).to start_with('tok_')
17
+ end
18
+
19
+ context 'when holder name is passed' do
20
+ it "must create a card with holder name" do
21
+ response = Start::Token.create(
22
+ :number => "4242424242424242",
23
+ :exp_month => 11,
24
+ :exp_year => 2016,
25
+ :cvc => 123,
26
+ :name => "Abdullah Mohammed"
27
+ )
28
+
29
+ expect(response['card']['name']).to eq('Abdullah Mohammed')
30
+ end
31
+ end
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payfort_start
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Gabriel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-08 00:00:00.000000000 Z
12
+ date: 2016-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -64,6 +64,7 @@ files:
64
64
  - lib/start/errors/processing_error.rb
65
65
  - lib/start/errors/request_error.rb
66
66
  - lib/start/errors/start_error.rb
67
+ - lib/start/token.rb
67
68
  - lib/start/version.rb
68
69
  - payfort_start.gemspec
69
70
  - spec/lib/start/charge_spec.rb
@@ -71,6 +72,7 @@ files:
71
72
  - spec/lib/start/error/authentication_error_spec.rb
72
73
  - spec/lib/start/error/banking_error_spec.rb
73
74
  - spec/lib/start/error/request_error_spec.rb
75
+ - spec/lib/start/token_spec.rb
74
76
  - spec/spec_helper.rb
75
77
  homepage: https://start.payfort.com/docs/
76
78
  licenses:
@@ -92,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
94
  version: '0'
93
95
  requirements: []
94
96
  rubyforge_project:
95
- rubygems_version: 2.4.6
97
+ rubygems_version: 2.4.5.1
96
98
  signing_key:
97
99
  specification_version: 4
98
100
  summary: Ruby bindings for the Payfort Start API
@@ -102,4 +104,5 @@ test_files:
102
104
  - spec/lib/start/error/authentication_error_spec.rb
103
105
  - spec/lib/start/error/banking_error_spec.rb
104
106
  - spec/lib/start/error/request_error_spec.rb
107
+ - spec/lib/start/token_spec.rb
105
108
  - spec/spec_helper.rb