moyasar 0.6.6 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1dac4f41b1a5b0035f577020211209837405025c
4
- data.tar.gz: 89cfa103640483e72295ca99ea2b2e5719cd7bd3
3
+ metadata.gz: 7ffe74f694a25108bb0eaacc19d229598c6b636d
4
+ data.tar.gz: fecca1aae35c73ca34de59d1b2788ca7877a7f23
5
5
  SHA512:
6
- metadata.gz: 1172b1ddd4a063fce231e12621a2f87c68f7ba7b6f05657625a79495aafe5a7d9f87274bb3974e8a390ae773a0544822255874c3491cef798e612c614a7e4906
7
- data.tar.gz: 28111a55edc5c3fa4bfe6938d199e80c98de5468a2292d1c523a81a0307e1668e386fc9e889a50098d76d047811490240a16896a3670cd1b019675ce02aa85b6
6
+ metadata.gz: 81950ba0ce62f08cdd6a71c8067fd37dbc709a9ca24d9c49d8f23f96e40370801e78d3926d2a07d2b6d8a3ca3700592be343e0e0e729cbd7470284507e30d68c
7
+ data.tar.gz: e2c411dad80cf236c3dbc73830221c56940d54bbf65e3d91941e76d09de63db27861f8df89618a1e9ff2e7c5b2fd44485eacee26037da92a737f56b60069444a
data/.travis.yml CHANGED
@@ -5,3 +5,5 @@ rvm:
5
5
  - 2.2
6
6
  - 2.3.3
7
7
  - 2.4.0
8
+ - 2.5.3
9
+ - 2.6.0
@@ -0,0 +1,28 @@
1
+ module Moyasar
2
+ module Actions
3
+ module Cancel
4
+
5
+ def self.included(klass)
6
+ klass.extend ClassMethods
7
+ klass.send :include, InstanceMethods
8
+ end
9
+
10
+ module ClassMethods
11
+ def cancel(id)
12
+ perform_cancel(id)
13
+ end
14
+
15
+ def perform_cancel(id)
16
+ response = request(:put, cancel_url(id))
17
+ new(response.body)
18
+ end
19
+ end
20
+
21
+ module InstanceMethods
22
+ def cancel()
23
+ self.class.perform_cancel(id) unless id.nil?
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -6,6 +6,7 @@ module Moyasar
6
6
  include Moyasar::Actions::List
7
7
  include Moyasar::Actions::Fetch
8
8
  include Moyasar::Actions::Update
9
+ include Moyasar::Actions::Cancel
9
10
 
10
11
  class << self
11
12
 
@@ -42,6 +43,10 @@ module Moyasar
42
43
  "#{resource_url}/#{id}/refund"
43
44
  end
44
45
 
46
+ def cancel_url(id)
47
+ "#{resource_url}/#{id}/cancel"
48
+ end
49
+
45
50
  end
46
51
 
47
52
  private
@@ -1,3 +1,3 @@
1
1
  module Moyasar
2
- VERSION = '0.6.6'
2
+ VERSION = '0.6.7'
3
3
  end
data/lib/moyasar.rb CHANGED
@@ -13,6 +13,7 @@ require 'moyasar/actions/list'
13
13
  require 'moyasar/actions/fetch'
14
14
  require 'moyasar/actions/update'
15
15
  require 'moyasar/actions/refund'
16
+ require 'moyasar/actions/cancel'
16
17
 
17
18
  require 'moyasar/source'
18
19
  require 'moyasar/resource'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moyasar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdulaziz AlShetwi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2019-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,6 +71,7 @@ files:
71
71
  - bin/console
72
72
  - bin/setup
73
73
  - lib/moyasar.rb
74
+ - lib/moyasar/actions/cancel.rb
74
75
  - lib/moyasar/actions/construct.rb
75
76
  - lib/moyasar/actions/create.rb
76
77
  - lib/moyasar/actions/fetch.rb
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  version: '0'
115
116
  requirements: []
116
117
  rubyforge_project:
117
- rubygems_version: 2.6.11
118
+ rubygems_version: 2.6.13
118
119
  signing_key:
119
120
  specification_version: 4
120
121
  summary: Ruby wrapper library for Moyasar Payment Service