Skip to content

Commit 7251dff

Browse files
authored
Merge pull request #92 from CyberSource/feb-release
feb-release
2 parents a087afe + 7d3a8de commit 7251dff

File tree

290 files changed

+22405
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+22405
-363
lines changed

CyberSource/__init__.py

+77-3
Large diffs are not rendered by default.

CyberSource/apis/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from .payments_api import PaymentsApi
3333
from .payouts_api import PayoutsApi
3434
from .purchase_and_refund_details_api import PurchaseAndRefundDetailsApi
35+
from .push_funds_api import PushFundsApi
3536
from .refund_api import RefundApi
3637
from .report_definitions_api import ReportDefinitionsApi
3738
from .report_downloads_api import ReportDownloadsApi

CyberSource/apis/payments_api.py

+121
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,124 @@ def increment_auth_with_http_info(self, id, increment_auth_request, **kwargs):
277277
_preload_content=params.get('_preload_content', True),
278278
_request_timeout=params.get('_request_timeout'),
279279
collection_formats=collection_formats)
280+
281+
def refresh_payment_status(self, id, refresh_payment_status_request, **kwargs):
282+
"""
283+
Check a Payment Status
284+
Checks and updates the payment status
285+
This method makes a synchronous HTTP request by default. To make an
286+
asynchronous HTTP request, please define a `callback` function
287+
to be invoked when receiving the response.
288+
>>> def callback_function(response):
289+
>>> pprint(response)
290+
>>>
291+
>>> thread = api.refresh_payment_status(id, refresh_payment_status_request, callback=callback_function)
292+
293+
:param callback function: The callback function
294+
for asynchronous request. (optional)
295+
:param str id: The payment id whose status needs to be checked and updated. (required)
296+
:param RefreshPaymentStatusRequest refresh_payment_status_request: (required)
297+
:return: PtsV2PaymentsPost201Response1
298+
If the method is called asynchronously,
299+
returns the request thread.
300+
"""
301+
302+
if self.api_client.mconfig.log_config.enable_log:
303+
self.logger.info("CALL TO METHOD `refresh_payment_status` STARTED")
304+
305+
kwargs['_return_http_data_only'] = True
306+
if kwargs.get('callback'):
307+
return self.refresh_payment_status_with_http_info(id, refresh_payment_status_request, **kwargs)
308+
else:
309+
(data) = self.refresh_payment_status_with_http_info(id, refresh_payment_status_request, **kwargs)
310+
return data
311+
312+
def refresh_payment_status_with_http_info(self, id, refresh_payment_status_request, **kwargs):
313+
"""
314+
Check a Payment Status
315+
Checks and updates the payment status
316+
This method makes a synchronous HTTP request by default. To make an
317+
asynchronous HTTP request, please define a `callback` function
318+
to be invoked when receiving the response.
319+
>>> def callback_function(response):
320+
>>> pprint(response)
321+
>>>
322+
>>> thread = api.refresh_payment_status_with_http_info(id, refresh_payment_status_request, callback=callback_function)
323+
324+
:param callback function: The callback function
325+
for asynchronous request. (optional)
326+
:param str id: The payment id whose status needs to be checked and updated. (required)
327+
:param RefreshPaymentStatusRequest refresh_payment_status_request: (required)
328+
:return: PtsV2PaymentsPost201Response1
329+
If the method is called asynchronously,
330+
returns the request thread.
331+
"""
332+
333+
all_params = ['id', 'refresh_payment_status_request']
334+
all_params.append('callback')
335+
all_params.append('_return_http_data_only')
336+
all_params.append('_preload_content')
337+
all_params.append('_request_timeout')
338+
339+
params = locals()
340+
for key, val in iteritems(params['kwargs']):
341+
if key not in all_params:
342+
raise TypeError(
343+
"Got an unexpected keyword argument '%s'"
344+
" to method refresh_payment_status" % key
345+
)
346+
params[key] = val
347+
del params['kwargs']
348+
# verify the required parameter 'id' is set
349+
if ('id' not in params) or (params['id'] is None):
350+
if self.api_client.mconfig.log_config.enable_log:
351+
self.logger.error("InvalidArgumentException : Missing the required parameter `id` when calling `refresh_payment_status`")
352+
raise ValueError("Missing the required parameter `id` when calling `refresh_payment_status`")
353+
# verify the required parameter 'refresh_payment_status_request' is set
354+
if ('refresh_payment_status_request' not in params) or (params['refresh_payment_status_request'] is None):
355+
if self.api_client.mconfig.log_config.enable_log:
356+
self.logger.error("InvalidArgumentException : Missing the required parameter `refresh_payment_status_request` when calling `refresh_payment_status`")
357+
raise ValueError("Missing the required parameter `refresh_payment_status_request` when calling `refresh_payment_status`")
358+
359+
360+
collection_formats = {}
361+
362+
path_params = {}
363+
if 'id' in params:
364+
path_params['id'] = params['id']
365+
366+
query_params = []
367+
368+
header_params = {}
369+
370+
form_params = []
371+
local_var_files = {}
372+
373+
body_params = None
374+
if 'refresh_payment_status_request' in params:
375+
body_params = params['refresh_payment_status_request']
376+
# HTTP header `Accept`
377+
header_params['Accept'] = self.api_client.\
378+
select_header_accept(['application/hal+json;charset=utf-8'])
379+
380+
# HTTP header `Content-Type`
381+
header_params['Content-Type'] = self.api_client.\
382+
select_header_content_type(['application/json;charset=utf-8'])
383+
384+
# Authentication setting
385+
auth_settings = []
386+
387+
return self.api_client.call_api(f'/pts/v2/refresh-payment-status/{id}', 'POST',
388+
path_params,
389+
query_params,
390+
header_params,
391+
body=body_params,
392+
post_params=form_params,
393+
files=local_var_files,
394+
response_type='PtsV2PaymentsPost201Response1',
395+
auth_settings=auth_settings,
396+
callback=params.get('callback'),
397+
_return_http_data_only=params.get('_return_http_data_only'),
398+
_preload_content=params.get('_preload_content', True),
399+
_request_timeout=params.get('_request_timeout'),
400+
collection_formats=collection_formats)

CyberSource/apis/push_funds_api.py

+212
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# coding: utf-8
2+
3+
"""
4+
CyberSource Merged Spec
5+
6+
All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
7+
8+
OpenAPI spec version: 0.0.1
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
from __future__ import absolute_import
15+
16+
import sys
17+
import os
18+
import re
19+
20+
# python 2 and python 3 compatibility library
21+
from six import iteritems
22+
23+
from ..configuration import Configuration
24+
from ..api_client import ApiClient
25+
import CyberSource.logging.log_factory as LogFactory
26+
27+
28+
class PushFundsApi(object):
29+
"""
30+
NOTE: This class is auto generated by the swagger code generator program.
31+
Do not edit the class manually.
32+
Ref: https://github.com/swagger-api/swagger-codegen
33+
"""
34+
35+
def __init__(self, merchant_config, api_client=None):
36+
config = Configuration()
37+
if api_client:
38+
self.api_client = api_client
39+
else:
40+
if not config.api_client:
41+
config.api_client = ApiClient()
42+
self.api_client = config.api_client
43+
self.api_client.set_configuration(merchant_config)
44+
self.logger = LogFactory.setup_logger(self.__class__.__name__, self.api_client.mconfig.log_config)
45+
46+
47+
48+
def create_push_funds_transfer(self, push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, **kwargs):
49+
"""
50+
Process a Push Funds Transfer
51+
Receive funds using an Original Credit Transaction (OCT).
52+
This method makes a synchronous HTTP request by default. To make an
53+
asynchronous HTTP request, please define a `callback` function
54+
to be invoked when receiving the response.
55+
>>> def callback_function(response):
56+
>>> pprint(response)
57+
>>>
58+
>>> thread = api.create_push_funds_transfer(push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, callback=callback_function)
59+
60+
:param callback function: The callback function
61+
for asynchronous request. (optional)
62+
:param PushFundsRequest push_funds_request: (required)
63+
:param str content_type: (required)
64+
:param str x_requestid: (required)
65+
:param str v_c_merchant_id: (required)
66+
:param str v_c_permissions: (required)
67+
:param str v_c_correlation_id: (required)
68+
:param str v_c_organization_id: (required)
69+
:return: PushFunds201Response
70+
If the method is called asynchronously,
71+
returns the request thread.
72+
"""
73+
74+
if self.api_client.mconfig.log_config.enable_log:
75+
self.logger.info("CALL TO METHOD `create_push_funds_transfer` STARTED")
76+
77+
kwargs['_return_http_data_only'] = True
78+
if kwargs.get('callback'):
79+
return self.create_push_funds_transfer_with_http_info(push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, **kwargs)
80+
else:
81+
(data) = self.create_push_funds_transfer_with_http_info(push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, **kwargs)
82+
return data
83+
84+
def create_push_funds_transfer_with_http_info(self, push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, **kwargs):
85+
"""
86+
Process a Push Funds Transfer
87+
Receive funds using an Original Credit Transaction (OCT).
88+
This method makes a synchronous HTTP request by default. To make an
89+
asynchronous HTTP request, please define a `callback` function
90+
to be invoked when receiving the response.
91+
>>> def callback_function(response):
92+
>>> pprint(response)
93+
>>>
94+
>>> thread = api.create_push_funds_transfer_with_http_info(push_funds_request, content_type, x_requestid, v_c_merchant_id, v_c_permissions, v_c_correlation_id, v_c_organization_id, callback=callback_function)
95+
96+
:param callback function: The callback function
97+
for asynchronous request. (optional)
98+
:param PushFundsRequest push_funds_request: (required)
99+
:param str content_type: (required)
100+
:param str x_requestid: (required)
101+
:param str v_c_merchant_id: (required)
102+
:param str v_c_permissions: (required)
103+
:param str v_c_correlation_id: (required)
104+
:param str v_c_organization_id: (required)
105+
:return: PushFunds201Response
106+
If the method is called asynchronously,
107+
returns the request thread.
108+
"""
109+
110+
all_params = ['push_funds_request', 'content_type', 'x_requestid', 'v_c_merchant_id', 'v_c_permissions', 'v_c_correlation_id', 'v_c_organization_id']
111+
all_params.append('callback')
112+
all_params.append('_return_http_data_only')
113+
all_params.append('_preload_content')
114+
all_params.append('_request_timeout')
115+
116+
params = locals()
117+
for key, val in iteritems(params['kwargs']):
118+
if key not in all_params:
119+
raise TypeError(
120+
"Got an unexpected keyword argument '%s'"
121+
" to method create_push_funds_transfer" % key
122+
)
123+
params[key] = val
124+
del params['kwargs']
125+
# verify the required parameter 'push_funds_request' is set
126+
if ('push_funds_request' not in params) or (params['push_funds_request'] is None):
127+
if self.api_client.mconfig.log_config.enable_log:
128+
self.logger.error("InvalidArgumentException : Missing the required parameter `push_funds_request` when calling `create_push_funds_transfer`")
129+
raise ValueError("Missing the required parameter `push_funds_request` when calling `create_push_funds_transfer`")
130+
# verify the required parameter 'content_type' is set
131+
if ('content_type' not in params) or (params['content_type'] is None):
132+
if self.api_client.mconfig.log_config.enable_log:
133+
self.logger.error("InvalidArgumentException : Missing the required parameter `content_type` when calling `create_push_funds_transfer`")
134+
raise ValueError("Missing the required parameter `content_type` when calling `create_push_funds_transfer`")
135+
# verify the required parameter 'x_requestid' is set
136+
if ('x_requestid' not in params) or (params['x_requestid'] is None):
137+
if self.api_client.mconfig.log_config.enable_log:
138+
self.logger.error("InvalidArgumentException : Missing the required parameter `x_requestid` when calling `create_push_funds_transfer`")
139+
raise ValueError("Missing the required parameter `x_requestid` when calling `create_push_funds_transfer`")
140+
# verify the required parameter 'v_c_merchant_id' is set
141+
if ('v_c_merchant_id' not in params) or (params['v_c_merchant_id'] is None):
142+
if self.api_client.mconfig.log_config.enable_log:
143+
self.logger.error("InvalidArgumentException : Missing the required parameter `v_c_merchant_id` when calling `create_push_funds_transfer`")
144+
raise ValueError("Missing the required parameter `v_c_merchant_id` when calling `create_push_funds_transfer`")
145+
# verify the required parameter 'v_c_permissions' is set
146+
if ('v_c_permissions' not in params) or (params['v_c_permissions'] is None):
147+
if self.api_client.mconfig.log_config.enable_log:
148+
self.logger.error("InvalidArgumentException : Missing the required parameter `v_c_permissions` when calling `create_push_funds_transfer`")
149+
raise ValueError("Missing the required parameter `v_c_permissions` when calling `create_push_funds_transfer`")
150+
# verify the required parameter 'v_c_correlation_id' is set
151+
if ('v_c_correlation_id' not in params) or (params['v_c_correlation_id'] is None):
152+
if self.api_client.mconfig.log_config.enable_log:
153+
self.logger.error("InvalidArgumentException : Missing the required parameter `v_c_correlation_id` when calling `create_push_funds_transfer`")
154+
raise ValueError("Missing the required parameter `v_c_correlation_id` when calling `create_push_funds_transfer`")
155+
# verify the required parameter 'v_c_organization_id' is set
156+
if ('v_c_organization_id' not in params) or (params['v_c_organization_id'] is None):
157+
if self.api_client.mconfig.log_config.enable_log:
158+
self.logger.error("InvalidArgumentException : Missing the required parameter `v_c_organization_id` when calling `create_push_funds_transfer`")
159+
raise ValueError("Missing the required parameter `v_c_organization_id` when calling `create_push_funds_transfer`")
160+
161+
162+
collection_formats = {}
163+
164+
path_params = {}
165+
166+
query_params = []
167+
168+
header_params = {}
169+
if 'content_type' in params:
170+
header_params['Content-Type'] = params['content_type']
171+
if 'x_requestid' in params:
172+
header_params['x-requestid'] = params['x_requestid']
173+
if 'v_c_merchant_id' in params:
174+
header_params['v-c-merchant-id'] = params['v_c_merchant_id']
175+
if 'v_c_permissions' in params:
176+
header_params['v-c-permissions'] = params['v_c_permissions']
177+
if 'v_c_correlation_id' in params:
178+
header_params['v-c-correlation-id'] = params['v_c_correlation_id']
179+
if 'v_c_organization_id' in params:
180+
header_params['v-c-organization-id'] = params['v_c_organization_id']
181+
182+
form_params = []
183+
local_var_files = {}
184+
185+
body_params = None
186+
if 'push_funds_request' in params:
187+
body_params = params['push_funds_request']
188+
# HTTP header `Accept`
189+
header_params['Accept'] = self.api_client.\
190+
select_header_accept(['application/hal+json;charset=utf-8'])
191+
192+
# HTTP header `Content-Type`
193+
header_params['Content-Type'] = self.api_client.\
194+
select_header_content_type(['application/json;charset=utf-8'])
195+
196+
# Authentication setting
197+
auth_settings = []
198+
199+
return self.api_client.call_api(f'/pts/v1/push-funds-transfer', 'POST',
200+
path_params,
201+
query_params,
202+
header_params,
203+
body=body_params,
204+
post_params=form_params,
205+
files=local_var_files,
206+
response_type='PushFunds201Response',
207+
auth_settings=auth_settings,
208+
callback=params.get('callback'),
209+
_return_http_data_only=params.get('_return_http_data_only'),
210+
_preload_content=params.get('_preload_content', True),
211+
_request_timeout=params.get('_request_timeout'),
212+
collection_formats=collection_formats)

0 commit comments

Comments
 (0)