You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[CyberSource API Keys](https://prod.developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration/createCertSharedKey.html)
14
15
15
16
## Dependencies
17
+
16
18
* activesupport 6.0.3.2
17
19
* interface 1.0.4
18
20
* json 2.1.0
19
21
* jwt 2.1.0
20
22
* typhoeus 1.3.1
21
23
22
24
## Installation
25
+
23
26
### Bundler
24
-
Be sure to always use HTTPS rubygems source in your gemfile and include the cybersource_rest_client.
25
27
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.
30
29
30
+
```ruby
31
+
source 'https://rubygems.org'do
32
+
gem 'cybersource_rest_client'
33
+
end
31
34
```
32
35
33
36
## Registration & Configuration
37
+
34
38
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)
35
39
36
40
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.
37
41
38
42
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.
39
43
40
44
## SDK Usage Examples and Sample Code
45
+
41
46
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)
43
49
44
50
In that respository, we have comprehensive sample code for all common uses of our API:
45
51
46
52
Additionally, you can find details and examples of how our API is structured in our API Reference Guide:
53
+
47
54
*[Developer Center API Reference](https://developer.cybersource.com/api/reference/api-reference.html)
48
55
49
56
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
59
66
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).
60
67
61
68
### 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>
**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]
**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 `authorization_code`. When you use this value, you must also include the `code` field in the request. For subsequent request, use `refresh_token`. When you use this value, you must also include the `refresh_token` 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 `authorization_code`. | [optional]
10
+
**refresh_token** | **String** | Conditional. Required if grant_type is `refresh_token`. | [optional]
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.
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
+
rescueCyberSource::ApiError => e
35
+
puts"Exception when calling OAuthApi->create_access_token: #{e}"
**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]
**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]
6
7
**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]
7
8
**acs_transaction_id** | **String** | Unique transaction identifier assigned by the ACS to identify a single transaction. | [optional]
8
9
**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]
0 commit comments