mastercard_transfer 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/mastercard/api/transfer/fundstransfer.rb +134 -0
- data/lib/mastercard/api/transfer/resourceconfig.rb +104 -0
- data/lib/mastercard_transfer.rb +5 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a4ac752037e70d675f448e98d3096b08119d3729
|
4
|
+
data.tar.gz: 723123a18b5e7474eeccde0ef7ffd83289e94561
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2c28497b643e0d9d30ae5ccf144fdd9dbdda8e80ec4c52b0d657b2680e42d8208df6d905858045d9752776af757445e343e0cd9f4ee59d3b49605824fd27b50c
|
7
|
+
data.tar.gz: d2726975caffd69ec4fca9276056c2dcfdf6d63d9954f96df2d6fdcaaa8f30602f0cbd277b9047d691072d76ab1d8d51ec71fa5e7dd49a39712305a0bfd3845e
|
@@ -0,0 +1,134 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2016 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
|
29
|
+
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
31
|
+
|
32
|
+
module MasterCard
|
33
|
+
module API
|
34
|
+
module Transfer
|
35
|
+
class FundsTransfer < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
38
|
+
|
39
|
+
@__store = {
|
40
|
+
'0554c4d4-f782-4961-b700-873da5d10048' => OperationConfig.new("/send/v1/partners/{partnerId}/funds-transfers", "create", [], []),
|
41
|
+
'6c371649-d4b0-4ee2-ab4f-c4dee752f592' => OperationConfig.new("/send/v1/partners/{partnerId}/funds-transfers/{transferId}", "read", [], []),
|
42
|
+
'11e9f467-71fa-4eb8-ae4f-bccd986e4efe' => OperationConfig.new("/send/v1/partners/{partnerId}/funds-transfers", "query", [], ["ref"]),
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
48
|
+
def self.getOperationConfig(operationUUID)
|
49
|
+
if @__store.key?(operationUUID)
|
50
|
+
return @__store[operationUUID]
|
51
|
+
end
|
52
|
+
raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
|
57
|
+
end
|
58
|
+
|
59
|
+
public
|
60
|
+
|
61
|
+
|
62
|
+
def self.create(mapObj)
|
63
|
+
#
|
64
|
+
#Creates object of type FundsTransfer
|
65
|
+
#
|
66
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
67
|
+
#@return [FundsTransfer] of the response of created instance.
|
68
|
+
#@raise [APIException] an exception from the response status
|
69
|
+
return self.execute("0554c4d4-f782-4961-b700-873da5d10048", FundsTransfer.new(mapObj))
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
def self.readByID(id, criteria = nil)
|
83
|
+
#
|
84
|
+
#Returns objects of type FundsTransfer by id and optional criteria
|
85
|
+
#@param [String] id
|
86
|
+
#@param [Dict] criteria
|
87
|
+
#@return [FundsTransfer] object representing the response
|
88
|
+
#@raise [APIException] an exception from the response status
|
89
|
+
|
90
|
+
mapObj = FundsTransfer.new
|
91
|
+
if !(id.nil? || id.to_s.empty?)
|
92
|
+
mapObj.set("id", id)
|
93
|
+
end
|
94
|
+
if !criteria.nil?
|
95
|
+
if criteria.instance_of? RequestMap
|
96
|
+
mapObj.setAll(criteria.getObject())
|
97
|
+
else
|
98
|
+
mapObj.setAll(criteria)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
return self.execute("6c371649-d4b0-4ee2-ab4f-c4dee752f592",FundsTransfer.new(mapObj))
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
def self.readByReference(criteria)
|
113
|
+
#
|
114
|
+
#Query objects of type FundsTransfer by id and optional criteria
|
115
|
+
#@param [Dict] criteria
|
116
|
+
#@return [FundsTransfer] object representing the response.
|
117
|
+
#@raise [APIException] an exception from the response status
|
118
|
+
#
|
119
|
+
|
120
|
+
return self.execute("11e9f467-71fa-4eb8-ae4f-bccd986e4efe",FundsTransfer.new(criteria))
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
@@ -0,0 +1,104 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2016 MasterCard International Incorporated
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without modification, are
|
6
|
+
# permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# Redistributions of source code must retain the above copyright notice, this list of
|
9
|
+
# conditions and the following disclaimer.
|
10
|
+
# Redistributions in binary form must reproduce the above copyright notice, this list of
|
11
|
+
# conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
# provided with the distribution.
|
13
|
+
# Neither the name of the MasterCard International Incorporated nor the names of its
|
14
|
+
# contributors may be used to endorse or promote products derived from this software
|
15
|
+
# without specific prior written permission.
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
17
|
+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
18
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
19
|
+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
20
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
21
|
+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
23
|
+
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
24
|
+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
# SUCH DAMAGE.
|
26
|
+
#
|
27
|
+
|
28
|
+
require "mastercard/core/constants"
|
29
|
+
require "mastercard/core/config"
|
30
|
+
|
31
|
+
module MasterCard
|
32
|
+
module API
|
33
|
+
module Transfer
|
34
|
+
class ResourceConfig
|
35
|
+
include MasterCard::Core
|
36
|
+
|
37
|
+
@@instance = nil
|
38
|
+
|
39
|
+
def initialize
|
40
|
+
@override = nil
|
41
|
+
@host = nil
|
42
|
+
@context = nil
|
43
|
+
|
44
|
+
Config.registerResourceConfig(self)
|
45
|
+
currentEnvironment = Config.getEnvironment()
|
46
|
+
self.setEnvironment(currentEnvironment)
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
def self.instance
|
52
|
+
return @@instance
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
def getName
|
57
|
+
return "transfer"
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
def getHost
|
62
|
+
unless @override.nil? || @override == 0
|
63
|
+
return @override
|
64
|
+
else
|
65
|
+
return @host
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def getContext
|
70
|
+
return @context
|
71
|
+
end
|
72
|
+
|
73
|
+
def getVersion
|
74
|
+
return "transfer:1.0.0"
|
75
|
+
end
|
76
|
+
|
77
|
+
def getJsonNative
|
78
|
+
return false
|
79
|
+
end
|
80
|
+
|
81
|
+
def getContentTypeOverride
|
82
|
+
return nil
|
83
|
+
end
|
84
|
+
|
85
|
+
def setEnvironment(environmet)
|
86
|
+
if Environment::MAPPING.key?(environmet)
|
87
|
+
tuple = Environment::MAPPING[environmet]
|
88
|
+
@host = tuple[0]
|
89
|
+
@context = tuple[1]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def setCustomEnvironment(host,context)
|
94
|
+
@host = host
|
95
|
+
@context = context
|
96
|
+
end
|
97
|
+
|
98
|
+
@@instance = ResourceConfig.new
|
99
|
+
|
100
|
+
private_class_method :new
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mastercard_transfer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- MasterCard Worldwide
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-07-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mastercard_api_core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.4.0
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.4.8
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.4.0
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.4.8
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: ci_reporter_minitest
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
description: MasterCard Transfer Description
|
48
|
+
email:
|
49
|
+
- APISupport@mastercard.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- lib/mastercard/api/transfer/fundstransfer.rb
|
55
|
+
- lib/mastercard/api/transfer/resourceconfig.rb
|
56
|
+
- lib/mastercard_transfer.rb
|
57
|
+
homepage: https://developer.mastercard.com
|
58
|
+
licenses:
|
59
|
+
- BSD-2-Clause
|
60
|
+
metadata: {}
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 2.5.1
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: MasterCard Transfer SDK
|
81
|
+
test_files: []
|