Skip to content

Commit a3ca455

Browse files
authored
Merge pull request #57 from snavinch/master
June 2021 SDK Release
2 parents 62bb238 + 42ca2d8 commit a3ca455

File tree

133 files changed

+3518
-379
lines changed

Some content is hidden

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

133 files changed

+3518
-379
lines changed

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,49 @@ The CyberSource Ruby client provides convenient access to the [CyberSource REST
88
[rubygems]: https://rubygems.org/gems/cybersource_rest_client
99

1010
## Requirements
11+
1112
* Ruby 2.5.0 or higher
1213
* [CyberSource Account](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)
1314
* [CyberSource API Keys](https://prod.developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration/createCertSharedKey.html)
1415

1516
## Dependencies
17+
1618
* activesupport 6.0.3.2
1719
* interface 1.0.4
1820
* json 2.1.0
1921
* jwt 2.1.0
2022
* typhoeus 1.3.1
2123

2224
## Installation
25+
2326
### Bundler
24-
Be sure to always use HTTPS rubygems source in your gemfile and include the cybersource_rest_client.
2527

26-
```
27-
source 'https://rubygems.org' do
28-
gem 'cybersource_rest_client'
29-
end
28+
Be sure to always use HTTPS rubygems source in your gemfile and include the cybersource_rest_client.
3029

30+
```ruby
31+
source 'https://rubygems.org' do
32+
gem 'cybersource_rest_client'
33+
end
3134
```
3235

3336
## Registration & Configuration
37+
3438
Use of this SDK and the CyberSource APIs requires having an account on our system. You can find details of getting a test account and creating your keys [here](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)
3539

3640
Once you have your keys, simply load them into the appropriate variables in your code, as per the below sample code dealing with the authentication part of the API request.
3741

3842
Remember this SDK is for use in server-side Ruby applications that access the CyberSource REST API and credentials should always be securely stored and accessed appropriately.
3943

4044
## SDK Usage Examples and Sample Code
45+
4146
To get started using this SDK, it's highly recommended to download our sample code repository:
42-
* [Cybersource Ruby Sample Code Repository (on GitHub)](https://github.com/CyberSource/cybersource-rest-samples-ruby)
47+
48+
* [CyberSource Ruby Sample Code Repository (on GitHub)](https://github.com/CyberSource/cybersource-rest-samples-ruby)
4349

4450
In that respository, we have comprehensive sample code for all common uses of our API:
4551

4652
Additionally, you can find details and examples of how our API is structured in our API Reference Guide:
53+
4754
* [Developer Center API Reference](https://developer.cybersource.com/api/reference/api-reference.html)
4855

4956
The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.
@@ -59,18 +66,18 @@ MIDs continue to be able to create keys for themselves, even if a Meta Key is ge
5966
Further information on MetaKey can be found in [New Business Center User Guide](https://developer.cybersource.com/library/documentation/dev_guides/Business_Center/New_Business_Center_User_Guide.pdf).
6067

6168
### Switching between the sandbox environment and the production environment
62-
Cybersource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the `runEnvironment` property in the SDK Configuration. See our sample at https://github.com/CyberSource/cybersource-rest-samples-ruby/blob/master/data/Configuration.rb
69+
70+
CyberSource maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, set the `runEnvironment` property in the SDK Configuration. See our sample at <https://github.com/CyberSource/cybersource-rest-samples-ruby/blob/master/data/Configuration.rb>
6371

6472
```Ruby
6573
# For TESTING use
66-
runEnvironment='cybersource.environment.sandbox'
74+
runEnvironment='apitest.cybersource.com'
6775
# For PRODUCTION use
68-
# runEnvironment='cybersource.environment.production'
76+
# runEnvironment='api.cybersource.com'
6977
```
7078

7179
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
7280

73-
74-
7581
## License
82+
7683
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file.

cybersource_rest_client.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ require "cybersource_rest_client/version"
1717

1818
Gem::Specification.new do |s|
1919
s.name = "cybersource_rest_client"
20-
s.version = "0.0.31"
20+
s.version = "0.0.32"
2121
s.platform = Gem::Platform::RUBY
2222
s.authors = ["CyberSource"]
2323
s.email = ["[email protected]"]
2424
s.homepage = "https://developer.cybersource.com"
2525
s.summary = "CyberSource Ruby SDK Gem"
2626
s.description = "Simple REST API for the CyberSource Global Payments Platform"
2727
s.license = "CyberSource"
28-
s.files = Dir.glob("{lib}/**/*")
28+
s.files = Dir.glob("{lib}/{cybersource_rest_client}/**/*") + Dir.glob("{lib}/{AuthenticationSDK}/authentication/**/*") + Dir.glob("{lib}/{AuthenticationSDK}/core/**/*") + Dir.glob("{lib}/{AuthenticationSDK}/util/**/*") + Dir.glob("{lib}/cybersource_rest_client.rb")
2929
s.required_ruby_version = ">= 1.9"
3030

3131
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'

docs/AccessTokenResponse.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CyberSource::AccessTokenResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**access_token** | **String** | Created JWT token. | [optional]
7+
**token_type** | **String** | Bearer. | [optional]
8+
**refresh_token** | **String** | Newly created JWT token for initial request or if refresh token expired, else the same refresh token as in the request. | [optional]
9+
**expires_in** | **Integer** | Number of seconds left till the access token gets expired. | [optional]
10+
**scope** | **String** | List of permissions for APIs. | [optional]
11+
**refresh_token_expires_in** | **Integer** | Number of seconds left till the refresh token gets expired. | [optional]
12+
**client_status** | **String** | Successful response can be returned only if client status is active. | [optional]
13+
14+

docs/AddNegativeListRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**order_information** | [**Riskv1liststypeentriesOrderInformation**](Riskv1liststypeentriesOrderInformation.md) | | [optional]
77
**payment_information** | [**Riskv1liststypeentriesPaymentInformation**](Riskv1liststypeentriesPaymentInformation.md) | | [optional]
8-
**client_reference_information** | [**Riskv1decisionsClientReferenceInformation**](Riskv1decisionsClientReferenceInformation.md) | | [optional]
8+
**client_reference_information** | [**Riskv1liststypeentriesClientReferenceInformation**](Riskv1liststypeentriesClientReferenceInformation.md) | | [optional]
99
**device_information** | [**Riskv1liststypeentriesDeviceInformation**](Riskv1liststypeentriesDeviceInformation.md) | | [optional]
1010
**risk_information** | [**Riskv1liststypeentriesRiskInformation**](Riskv1liststypeentriesRiskInformation.md) | | [optional]
1111
**buyer_information** | [**Riskv1liststypeentriesBuyerInformation**](Riskv1liststypeentriesBuyerInformation.md) | | [optional]

docs/BadRequestError.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CyberSource::BadRequestError
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**error** | **String** | | [optional]
7+
**error_description** | **String** | | [optional]
8+
9+

docs/CreateAccessTokenRequest.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# CyberSource::CreateAccessTokenRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**client_id** | **String** | The client ID that you received when you registered your application in the CyberSource Business Center. This identifies your client application. |
7+
**client_secret** | **String** | The client secret that you received when you registered your application in the CyberSource Business Center. |
8+
**grant_type** | **String** | The grant type value determines which type of flow is used to obtain the access token. The first time your application requests a token, use the value &#x60;authorization_code&#x60;. When you use this value, you must also include the &#x60;code&#x60; field in the request. For subsequent request, use &#x60;refresh_token&#x60;. When you use this value, you must also include the &#x60;refresh_token&#x60; field in the request. Valid values: - authorization_code - refresh_token | [optional]
9+
**code** | **String** | This value is sent by CyberSource in the redirect URL. For security reasons, the code expires in 10 minutes. If it expires, you must repeat the redirect to request another. Conditional. This value is equired if grant_type is &#x60;authorization_code&#x60;. | [optional]
10+
**refresh_token** | **String** | Conditional. Required if grant_type is &#x60;refresh_token&#x60;. | [optional]
11+
12+

docs/FraudMarkingActionRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**risk_information** | [**Riskv1decisionsidmarkingRiskInformation**](Riskv1decisionsidmarkingRiskInformation.md) | | [optional]
7-
**client_reference_information** | [**Riskv1decisionsClientReferenceInformation**](Riskv1decisionsClientReferenceInformation.md) | | [optional]
7+
**client_reference_information** | [**Riskv1liststypeentriesClientReferenceInformation**](Riskv1liststypeentriesClientReferenceInformation.md) | | [optional]
88

99

docs/OAuthApi.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CyberSource::OAuthApi
2+
3+
All URIs are relative to *https://api-ma.Cybersource.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**create_access_token**](OAuthApi.md#create_access_token) | **POST** /oauth2/v3/token | Create access token and refresh token
8+
9+
10+
# **create_access_token**
11+
> AccessTokenResponse create_access_token(create_access_token_request, opts)
12+
13+
Create access token and refresh token
14+
15+
This request is used by technology partners to obtain an access token and a refresh token, which are contained in the response. The partner can then use the access token for authentication when submitting API requests to CyberSource on behalf of the merchant. The request must include the authorization code that was included in the URL redirect response from CyberSource (see [full documentation](https://developer.cybersource.com/api/developer-guides/OAuth/cybs_extend_intro.html)). Access tokens expire after 15 minutes. The refresh token is used to create a new access token, it expires after one year.
16+
17+
### Example
18+
```ruby
19+
# load the gem
20+
require 'cybersource_rest_client'
21+
22+
api_instance = CyberSource::OAuthApi.new
23+
24+
create_access_token_request = CyberSource::CreateAccessTokenRequest.new # CreateAccessTokenRequest | Request payload
25+
26+
opts = {
27+
v_c_client_correlation_id: "v_c_client_correlation_id_example" # String | We recommended that you submit this header with a unique value in every client request to this endpoint. It is sent back in the response header and logged both in the request log and response log.
28+
}
29+
30+
begin
31+
#Create access token and refresh token
32+
result = api_instance.create_access_token(create_access_token_request, opts)
33+
p result
34+
rescue CyberSource::ApiError => e
35+
puts "Exception when calling OAuthApi->create_access_token: #{e}"
36+
end
37+
```
38+
39+
### Parameters
40+
41+
Name | Type | Description | Notes
42+
------------- | ------------- | ------------- | -------------
43+
**create_access_token_request** | [**CreateAccessTokenRequest**](CreateAccessTokenRequest.md)| Request payload |
44+
**v_c_client_correlation_id** | **String**| We recommended that you submit this header with a unique value in every client request to this endpoint. It is sent back in the response header and logged both in the request log and response log. | [optional]
45+
46+
### Return type
47+
48+
[**AccessTokenResponse**](AccessTokenResponse.md)
49+
50+
### Authorization
51+
52+
No authorization required
53+
54+
### HTTP request headers
55+
56+
- **Content-Type**: application/x-www-form-urlencoded
57+
- **Accept**: application/json;charset=utf-8
58+
59+
60+

docs/PtsV2PaymentsPost201ResponseConsumerAuthenticationInformation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6+
**access_token** | **String** | JSON Web Token (JWT) used to authenticate the consumer with the authentication provider, such as, CardinalCommerce or Rupay. Note - Max Length of this field is 2048 characters. | [optional]
67
**acs_rendering_type** | **String** | Identifies the UI Type the ACS will use to complete the challenge. **NOTE**: Only available for App transactions using the Cardinal Mobile SDK. | [optional]
78
**acs_transaction_id** | **String** | Unique transaction identifier assigned by the ACS to identify a single transaction. | [optional]
89
**acs_url** | **String** | URL for the card-issuing bank’s authentication form that you receive when the card is enrolled. The value can be very large. | [optional]

docs/PtsV2PaymentsPost201ResponseOrderInformation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**amount_details** | [**PtsV2PaymentsPost201ResponseOrderInformationAmountDetails**](PtsV2PaymentsPost201ResponseOrderInformationAmountDetails.md) | | [optional]
77
**invoice_details** | [**PtsV2PaymentsPost201ResponseOrderInformationInvoiceDetails**](PtsV2PaymentsPost201ResponseOrderInformationInvoiceDetails.md) | | [optional]
8+
**reward_points_details** | [**PtsV2PaymentsPost201ResponseOrderInformationRewardPointsDetails**](PtsV2PaymentsPost201ResponseOrderInformationRewardPointsDetails.md) | | [optional]
89

910

0 commit comments

Comments
 (0)