Skip to content

Commit f405894

Browse files
committed
+ Made changes to SDK v0.0.14
1 parent bbd5b04 commit f405894

File tree

6 files changed

+809
-0
lines changed

6 files changed

+809
-0
lines changed

docs/ReversalApi.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# CyberSource::ReversalApi
2+
3+
All URIs are relative to *https://apitest.cybersource.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**auth_reversal**](ReversalApi.md#auth_reversal) | **POST** /pts/v2/payments/{id}/reversals | Process an Authorization Reversal
8+
9+
10+
# **auth_reversal**
11+
> PtsV2PaymentsReversalsPost201Response auth_reversal(id, auth_reversal_request)
12+
13+
Process an Authorization Reversal
14+
15+
Include the payment ID in the POST request to reverse the payment amount.
16+
17+
### Example
18+
```ruby
19+
# load the gem
20+
require 'cybersource_rest_client'
21+
22+
api_instance = CyberSource::ReversalApi.new
23+
24+
id = "id_example" # String | The payment ID returned from a previous payment request.
25+
26+
auth_reversal_request = CyberSource::AuthReversalRequest.new # AuthReversalRequest |
27+
28+
29+
begin
30+
#Process an Authorization Reversal
31+
result = api_instance.auth_reversal(id, auth_reversal_request)
32+
p result
33+
rescue CyberSource::ApiError => e
34+
puts "Exception when calling ReversalApi->auth_reversal: #{e}"
35+
end
36+
```
37+
38+
### Parameters
39+
40+
Name | Type | Description | Notes
41+
------------- | ------------- | ------------- | -------------
42+
**id** | **String**| The payment ID returned from a previous payment request. |
43+
**auth_reversal_request** | [**AuthReversalRequest**](AuthReversalRequest.md)| |
44+
45+
### Return type
46+
47+
[**PtsV2PaymentsReversalsPost201Response**](PtsV2PaymentsReversalsPost201Response.md)
48+
49+
### Authorization
50+
51+
No authorization required
52+
53+
### HTTP request headers
54+
55+
- **Content-Type**: application/json;charset=utf-8
56+
- **Accept**: application/json;charset=utf-8
57+
58+
59+

docs/VoidApi.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# CyberSource::VoidApi
2+
3+
All URIs are relative to *https://apitest.cybersource.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**void_capture**](VoidApi.md#void_capture) | **POST** /pts/v2/captures/{id}/voids | Void a Capture
8+
[**void_credit**](VoidApi.md#void_credit) | **POST** /pts/v2/credits/{id}/voids | Void a Credit
9+
[**void_payment**](VoidApi.md#void_payment) | **POST** /pts/v2/payments/{id}/voids | Void a Payment
10+
[**void_refund**](VoidApi.md#void_refund) | **POST** /pts/v2/refunds/{id}/voids | Void a Refund
11+
12+
13+
# **void_capture**
14+
> PtsV2PaymentsVoidsPost201Response void_capture(void_capture_request, id)
15+
16+
Void a Capture
17+
18+
Include the capture ID in the POST request to cancel the capture.
19+
20+
### Example
21+
```ruby
22+
# load the gem
23+
require 'cybersource_rest_client'
24+
25+
api_instance = CyberSource::VoidApi.new
26+
27+
void_capture_request = CyberSource::VoidCaptureRequest.new # VoidCaptureRequest |
28+
29+
id = "id_example" # String | The capture ID returned from a previous capture request.
30+
31+
32+
begin
33+
#Void a Capture
34+
result = api_instance.void_capture(void_capture_request, id)
35+
p result
36+
rescue CyberSource::ApiError => e
37+
puts "Exception when calling VoidApi->void_capture: #{e}"
38+
end
39+
```
40+
41+
### Parameters
42+
43+
Name | Type | Description | Notes
44+
------------- | ------------- | ------------- | -------------
45+
**void_capture_request** | [**VoidCaptureRequest**](VoidCaptureRequest.md)| |
46+
**id** | **String**| The capture ID returned from a previous capture request. |
47+
48+
### Return type
49+
50+
[**PtsV2PaymentsVoidsPost201Response**](PtsV2PaymentsVoidsPost201Response.md)
51+
52+
### Authorization
53+
54+
No authorization required
55+
56+
### HTTP request headers
57+
58+
- **Content-Type**: application/json;charset=utf-8
59+
- **Accept**: application/json;charset=utf-8
60+
61+
62+
63+
# **void_credit**
64+
> PtsV2PaymentsVoidsPost201Response void_credit(void_credit_request, id)
65+
66+
Void a Credit
67+
68+
Include the credit ID in the POST request to cancel the credit.
69+
70+
### Example
71+
```ruby
72+
# load the gem
73+
require 'cybersource_rest_client'
74+
75+
api_instance = CyberSource::VoidApi.new
76+
77+
void_credit_request = CyberSource::VoidCreditRequest.new # VoidCreditRequest |
78+
79+
id = "id_example" # String | The credit ID returned from a previous credit request.
80+
81+
82+
begin
83+
#Void a Credit
84+
result = api_instance.void_credit(void_credit_request, id)
85+
p result
86+
rescue CyberSource::ApiError => e
87+
puts "Exception when calling VoidApi->void_credit: #{e}"
88+
end
89+
```
90+
91+
### Parameters
92+
93+
Name | Type | Description | Notes
94+
------------- | ------------- | ------------- | -------------
95+
**void_credit_request** | [**VoidCreditRequest**](VoidCreditRequest.md)| |
96+
**id** | **String**| The credit ID returned from a previous credit request. |
97+
98+
### Return type
99+
100+
[**PtsV2PaymentsVoidsPost201Response**](PtsV2PaymentsVoidsPost201Response.md)
101+
102+
### Authorization
103+
104+
No authorization required
105+
106+
### HTTP request headers
107+
108+
- **Content-Type**: application/json;charset=utf-8
109+
- **Accept**: application/json;charset=utf-8
110+
111+
112+
113+
# **void_payment**
114+
> PtsV2PaymentsVoidsPost201Response void_payment(void_payment_request, id)
115+
116+
Void a Payment
117+
118+
Include the payment ID in the POST request to cancel the payment.
119+
120+
### Example
121+
```ruby
122+
# load the gem
123+
require 'cybersource_rest_client'
124+
125+
api_instance = CyberSource::VoidApi.new
126+
127+
void_payment_request = CyberSource::VoidPaymentRequest.new # VoidPaymentRequest |
128+
129+
id = "id_example" # String | The payment ID returned from a previous payment request.
130+
131+
132+
begin
133+
#Void a Payment
134+
result = api_instance.void_payment(void_payment_request, id)
135+
p result
136+
rescue CyberSource::ApiError => e
137+
puts "Exception when calling VoidApi->void_payment: #{e}"
138+
end
139+
```
140+
141+
### Parameters
142+
143+
Name | Type | Description | Notes
144+
------------- | ------------- | ------------- | -------------
145+
**void_payment_request** | [**VoidPaymentRequest**](VoidPaymentRequest.md)| |
146+
**id** | **String**| The payment ID returned from a previous payment request. |
147+
148+
### Return type
149+
150+
[**PtsV2PaymentsVoidsPost201Response**](PtsV2PaymentsVoidsPost201Response.md)
151+
152+
### Authorization
153+
154+
No authorization required
155+
156+
### HTTP request headers
157+
158+
- **Content-Type**: application/json;charset=utf-8
159+
- **Accept**: application/json;charset=utf-8
160+
161+
162+
163+
# **void_refund**
164+
> PtsV2PaymentsVoidsPost201Response void_refund(void_refund_request, id)
165+
166+
Void a Refund
167+
168+
Include the refund ID in the POST request to cancel the refund.
169+
170+
### Example
171+
```ruby
172+
# load the gem
173+
require 'cybersource_rest_client'
174+
175+
api_instance = CyberSource::VoidApi.new
176+
177+
void_refund_request = CyberSource::VoidRefundRequest.new # VoidRefundRequest |
178+
179+
id = "id_example" # String | The refund ID returned from a previous refund request.
180+
181+
182+
begin
183+
#Void a Refund
184+
result = api_instance.void_refund(void_refund_request, id)
185+
p result
186+
rescue CyberSource::ApiError => e
187+
puts "Exception when calling VoidApi->void_refund: #{e}"
188+
end
189+
```
190+
191+
### Parameters
192+
193+
Name | Type | Description | Notes
194+
------------- | ------------- | ------------- | -------------
195+
**void_refund_request** | [**VoidRefundRequest**](VoidRefundRequest.md)| |
196+
**id** | **String**| The refund ID returned from a previous refund request. |
197+
198+
### Return type
199+
200+
[**PtsV2PaymentsVoidsPost201Response**](PtsV2PaymentsVoidsPost201Response.md)
201+
202+
### Authorization
203+
204+
No authorization required
205+
206+
### HTTP request headers
207+
208+
- **Content-Type**: application/json;charset=utf-8
209+
- **Accept**: application/json;charset=utf-8
210+
211+
212+
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
=begin
2+
#CyberSource Merged Spec
3+
4+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5+
6+
OpenAPI spec version: 0.0.1
7+
8+
Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
Swagger Codegen version: 2.2.3
10+
11+
=end
12+
13+
require 'uri'
14+
15+
module CyberSource
16+
class ReversalApi
17+
attr_accessor :api_client
18+
19+
def initialize(api_client = ApiClient.default, config)
20+
@api_client = api_client
21+
@api_client.set_configuration(config)
22+
end
23+
# Process an Authorization Reversal
24+
# Include the payment ID in the POST request to reverse the payment amount.
25+
# @param id The payment ID returned from a previous payment request.
26+
# @param auth_reversal_request
27+
# @param [Hash] opts the optional parameters
28+
# @return [PtsV2PaymentsReversalsPost201Response]
29+
def auth_reversal(id, auth_reversal_request, opts = {})
30+
data, status_code, headers = auth_reversal_with_http_info(id, auth_reversal_request, opts)
31+
return data, status_code, headers
32+
end
33+
34+
# Process an Authorization Reversal
35+
# Include the payment ID in the POST request to reverse the payment amount.
36+
# @param id The payment ID returned from a previous payment request.
37+
# @param auth_reversal_request
38+
# @param [Hash] opts the optional parameters
39+
# @return [Array<(PtsV2PaymentsReversalsPost201Response, Fixnum, Hash)>] PtsV2PaymentsReversalsPost201Response data, response status code and response headers
40+
def auth_reversal_with_http_info(id, auth_reversal_request, opts = {})
41+
42+
if @api_client.config.debugging
43+
begin
44+
raise
45+
@api_client.config.logger.debug 'Calling API: ReversalApi.auth_reversal ...'
46+
rescue
47+
puts 'Cannot write to log'
48+
end
49+
end
50+
# verify the required parameter 'id' is set
51+
if @api_client.config.client_side_validation && id.nil?
52+
fail ArgumentError, "Missing the required parameter 'id' when calling ReversalApi.auth_reversal"
53+
end
54+
# verify the required parameter 'auth_reversal_request' is set
55+
if @api_client.config.client_side_validation && auth_reversal_request.nil?
56+
fail ArgumentError, "Missing the required parameter 'auth_reversal_request' when calling ReversalApi.auth_reversal"
57+
end
58+
# resource path
59+
local_var_path = 'pts/v2/payments/{id}/reversals'.sub('{' + 'id' + '}', id.to_s)
60+
61+
# query parameters
62+
query_params = {}
63+
64+
# header parameters
65+
header_params = {}
66+
# HTTP header 'Accept' (if needed)
67+
header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
68+
# HTTP header 'Content-Type'
69+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
70+
71+
# form parameters
72+
form_params = {}
73+
74+
# http body (model)
75+
post_body = @api_client.object_to_http_body(auth_reversal_request)
76+
auth_names = []
77+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
78+
:header_params => header_params,
79+
:query_params => query_params,
80+
:form_params => form_params,
81+
:body => post_body,
82+
:auth_names => auth_names,
83+
:return_type => 'PtsV2PaymentsReversalsPost201Response')
84+
if @api_client.config.debugging
85+
begin
86+
raise
87+
@api_client.config.logger.debug "API called: ReversalApi#auth_reversal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88+
rescue
89+
puts 'Cannot write to log'
90+
end
91+
end
92+
return data, status_code, headers
93+
end
94+
end
95+
end

0 commit comments

Comments
 (0)