Skip to content

Commit d463a2a

Browse files
authored
Merge pull request #120 from CyberSource/feature/mle-implementation
MLE implementation
2 parents 84c4171 + 833e5f6 commit d463a2a

File tree

111 files changed

+4130
-128
lines changed

Some content is hidden

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

111 files changed

+4130
-128
lines changed

MLE.md

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
[![Generic badge](https://img.shields.io/badge/MLE-NEW-GREEN.svg)](https://shields.io/)
2+
3+
# Message Level Encryption (MLE) Feature
4+
5+
This feature provides an implementation of Message Level Encryption (MLE) for APIs provided by CyberSource, integrated within our SDK. This feature ensures secure communication by encrypting messages at the application level before they are sent over the network.
6+
7+
## Configuration
8+
9+
### Global MLE Configuration
10+
11+
In the `merchantConfig` object, set the `useMLEGlobally` variable to enable or disable MLE for all supported APIs for the Rest SDK.
12+
13+
- **Variable**: `useMLEGlobally`
14+
- **Type**: `Boolean`
15+
- **Default**: `false`
16+
- **Description**: Enables MLE globally for all APIs when set to `true`. If set to `true`, it will enable MLE for all API calls that support MLE by CyberSource, unless overridden by `mapToControlMLEonAPI`.
17+
18+
### API-level MLE Control
19+
20+
Optionally, you can control the MLE feature at the API level using the `mapToControlMLEonAPI` variable in the `merchantConfig` object.
21+
22+
- **Variable**: `mapToControlMLEonAPI`
23+
- **Type**: `Hash of string to boolean`
24+
- **Description**: Overrides the global MLE setting for specific APIs. The key is the function name of the API in the SDK, and the value is a boolean indicating whether MLE should be enabled (`true`) or disabled (`false`) for that specific API call.
25+
26+
### MLE Key Alias
27+
28+
Another optional parameter for MLE is `mleKeyAlias`, which specifies the key alias used to retrieve the MLE certificate from the JWT P12 file.
29+
30+
- **Variable**: `mleKeyAlias`
31+
- **Type**: `String`
32+
- **Default**: `CyberSource_SJC_US`
33+
- **Description**: By default, CyberSource uses the `CyberSource_SJC_US` public certificate to encrypt the payload. However, users can override this default value by setting their own key alias.
34+
35+
## Notes
36+
37+
- If `useMLEGlobally` is set to true, it will enable MLE for all API calls that support MLE by CyberSource, unless overridden by `mapToControlMLEonAPI`.
38+
- If `mapToControlMLEonAPI` is not provided or does not contain a specific API function name, the global `useMLEGlobally` setting will be applied.
39+
- The `mleKeyAlias` parameter is optional and defaults to `CyberSource_SJC_US` if not specified by the user. Users can override this default value by setting their own key alias.
40+
- Example configurations contain only properties related to MLE.
41+
42+
## Example Configuration
43+
44+
### Option 1: Enable MLE globally for all MLE supported APIs
45+
46+
```ruby
47+
configuration_dictionary = {
48+
"useMLEGlobally": true # Globally MLE will be enabled for all MLE supported APIs
49+
}
50+
```
51+
52+
### Option 2: Enable/Disable MLE for specific APIs
53+
54+
```ruby
55+
configuration_dictionary = {}
56+
configuration_dictionary['useMLEGlobally'] = true # globally MLE will be enabled for all the MLE supported APIs by Cybs in SDK
57+
mapToControlMLE = {
58+
'create_payment' => false, # only create_payment function will have MLE=false i.e. (/pts/v2/payments POST API) out of all MLE supported APIs
59+
'capture_payment' => true # capture_payment function will have MLE=true i.e. (/pts/v2/payments/{id}/captures POST API), if it not in list of MLE supportedAPIs else it will already have MLE=true by global MLE parameter.
60+
}
61+
configuration_dictionary['mapToControlMLEonAPI'] = mapToControlMLE
62+
# Set other properties
63+
api_client = CyberSource::ApiClient.new
64+
# Create API instance using the configuration dictionary
65+
api_instance = CyberSource::PaymentsApi.new(api_client, configuration_dictionary)
66+
67+
```
68+
69+
### Option 3: Disable MLE globally and enable for specific APIs
70+
71+
```ruby
72+
configuration_dictionary = {
73+
"useMLEGlobally": false, # Globally MLE will be disabled for all APIs
74+
"mleKeyAlias": "Custom_Key_Alias" # optional if any custom value provided by Cybs
75+
}
76+
mapToControlMLE = {
77+
'apiFunctionName1' => false, # MLE will be disabled for this API
78+
'apiFunctionName2' => true # MLE will be enabled for this API
79+
}
80+
configuration_dictionary['mapToControlMLEonAPI'] = mapToControlMLE
81+
```
82+
83+
In the above examples:
84+
- MLE is enabled/disabled globally (`useMLEGlobally` is true/false).
85+
- `apiFunctionName1` will have MLE disabled/enabled based on value provided.
86+
- `apiFunctionName2` will have MLE enabled.
87+
- `mleKeyAlias` is set to `Custom_Key_Alias`, overriding the default value.
88+
89+
Please refer to the given link for sample codes with MLE: [MLE Samples](https://github.com/CyberSource/cybersource-rest-samples-ruby/tree/master/Samples/MLEFeature)
90+
91+
92+
## Additional Information
93+
94+
### API Support
95+
96+
- MLE is initially designed to support a few APIs.
97+
- It can be extended to support more APIs in the future based on requirements and updates.
98+
99+
### Authentication Type
100+
101+
- MLE is only supported with `JWT (JSON Web Token)` authentication type within the SDK.
102+
103+
### Using the SDK
104+
105+
To use the MLE feature in the SDK, configure the `merchantConfig` object as shown above and pass it to the SDK initialization.
106+
107+
## Contact
108+
109+
For any issues or further assistance, please open an issue on the GitHub repository or contact our support team.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ API credentials are different for each environment, so be sure to switch to the
7676

7777
## Features
7878

79+
### Message Level Encryption (MLE) Feature
80+
[![Generic badge](https://img.shields.io/badge/MLE-NEW-GREEN.svg)](https://shields.io/)
81+
82+
This feature provides an implementation of Message Level Encryption (MLE) for APIs provided by CyberSource, integrated within our SDK. This feature ensures secure communication by encrypting messages at the application level before they are sent over the network.
83+
84+
More information about this new MLE feature can be found in this file : [MLE.md](MLE.md)
85+
7986
### MetaKey Support
8087

8188
A Meta Key is a single key that can be used by one, some, or all merchants (or accounts, if created by a Portfolio user) in the portfolio.

cybersource_rest_client.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require "cybersource_rest_client/version"
1717

1818
Gem::Specification.new do |s|
1919
s.name = "cybersource_rest_client"
20-
s.version = "0.0.69"
20+
s.version = "0.0.70"
2121
s.platform = Gem::Platform::RUBY
2222
s.authors = ["CyberSource"]
2323
s.email = ["[email protected]"]

docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**parent_profile_id** | **String** | Specify the Vault ID to which transacting MID needs to be assigned.Provide Vault ID as seen on EBC Vault management page. If not provided , transacting MID will be assigned to the existing default Vault at merchant's level. If there are no Vaults at merchant level , a new Vault will be created and transacting MID will be assigned to it. | [optional]
77
**vault** | [**CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault**](CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault.md) | | [optional]
8+
**network_token_enrollment** | [**NetworkTokenEnrollment**](NetworkTokenEnrollment.md) | | [optional]
89

910

docs/GenerateCaptureContextRequest.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**client_version** | **String** | Specify the version of Microform that you want to use. | [optional]
77
**target_origins** | **Array<String>** | The [target origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of the website on which you will be launching Microform is defined by the scheme (protocol), hostname (domain) and port number (if used). You must use https://hostname (unless you use http://localhost) Wildcards are NOT supported. Ensure that subdomains are included. Any valid top-level domain is supported (e.g. .com, .co.uk, .gov.br etc) Examples: - https://example.com - https://subdomain.example.com - https://example.com:8080<br><br> If you are embedding within multiple nested iframes you need to specify the origins of all the browser contexts used, for example: targetOrigins: [ \"https://example.com\", \"https://basket.example.com\", \"https://ecom.example.com\" ] | [optional]
8-
**allowed_card_networks** | **Array<String>** | The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Accept Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (Accept Check) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Accept Card) and Microform (Accept Check) at least one card network should be specified in the allowedCardNetworks field in the capture context request. | [optional]
8+
**allowed_card_networks** | **Array<String>** | The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/Echeck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/Echeck) at least one card network should be specified in the allowedCardNetworks field in the capture context request. | [optional]
99
**allowed_payment_types** | **Array<String>** | The payment types that are allowed for the merchant. Possible values when launching Microform: - CARD - CHECK <br><br> | [optional]
10+
**transient_token_response_options** | [**Microformv2sessionsTransientTokenResponseOptions**](Microformv2sessionsTransientTokenResponseOptions.md) | | [optional]
1011

1112

docs/GenerateUnifiedCheckoutCaptureContextRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ Name | Type | Description | Notes
1111
**locale** | **String** | Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-appendix-languages.html) | [optional]
1212
**capture_mandate** | [**Upv1capturecontextsCaptureMandate**](Upv1capturecontextsCaptureMandate.md) | | [optional]
1313
**order_information** | [**Upv1capturecontextsOrderInformation**](Upv1capturecontextsOrderInformation.md) | | [optional]
14+
**transient_token_response_options** | [**Microformv2sessionsTransientTokenResponseOptions**](Microformv2sessionsTransientTokenResponseOptions.md) | | [optional]
1415

1516

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CyberSource::Microformv2sessionsTransientTokenResponseOptions
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**include_card_prefix** | **BOOLEAN** | Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix. Possible values: - True - False<br><br> To select the type of card number prefix: - No field included: A 6-digit prefix is returned (default) - True: An 8-digit prefix is returned - False: No prefix is returned<br><br> The following conditions apply: - 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more. - Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.<br><br> **Important:** If your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure. | [optional]
7+
8+

docs/NetworkTokenEnrollment.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CyberSource::NetworkTokenEnrollment
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**business_information** | [**TmsBusinessInformation**](TmsBusinessInformation.md) | | [optional]
7+
**network_token_services** | [**NetworkTokenServicesEnablement**](NetworkTokenServicesEnablement.md) | | [optional]
8+
9+
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CyberSource::NetworkTokenServicesEnablement
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**visa_token_service** | [**NetworkTokenServicesEnablementVisaTokenService**](NetworkTokenServicesEnablementVisaTokenService.md) | | [optional]
7+
**mastercard_digital_enablement_service** | [**NetworkTokenServicesEnablementMastercardDigitalEnablementService**](NetworkTokenServicesEnablementMastercardDigitalEnablementService.md) | | [optional]
8+
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CyberSource::NetworkTokenServicesEnablementMastercardDigitalEnablementService
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**enrollment** | **BOOLEAN** | Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted | [optional]
7+
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CyberSource::NetworkTokenServicesEnablementVisaTokenService
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**enrollment** | **BOOLEAN** | Indicates if an enrollment to create a TRID for the Visa card association should be attempted | [optional]
7+
8+

docs/TmsBusinessInformation.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CyberSource::TmsBusinessInformation
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**name** | **String** | Name of the network token merchant. | [optional]
7+
**doing_business_as** | **String** | Name the network token merchant does business as | [optional]
8+
**address** | [**TmsBusinessInformationAddress**](TmsBusinessInformationAddress.md) | | [optional]
9+
**website_url** | **String** | Website of network token merchant. | [optional]
10+
**business_identification_type** | **String** | The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided. | [optional]
11+
**business_identification_value** | **String** | The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided. | [optional]
12+
**acquirer** | [**TmsBusinessInformationAcquirer**](TmsBusinessInformationAcquirer.md) | | [optional]
13+
14+
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CyberSource::TmsBusinessInformationAcquirer
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**acquirer_id** | **String** | Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided. | [optional]
7+
**acquirer_merchant_id** | **String** | Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided. | [optional]
8+
9+

docs/TmsBusinessInformationAddress.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CyberSource::TmsBusinessInformationAddress
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**country** | **String** | Country of network token merchant. | [optional]
7+
**locality** | **String** | City of network token merchant. | [optional]
8+
9+

docs/Upv1capturecontextsCaptureMandate.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ Name | Type | Description | Notes
99
**request_shipping** | **BOOLEAN** | Configure Unified Checkout to capture customer shipping details. Possible values: - True - False | [optional]
1010
**ship_to_countries** | **Array<String>** | List of countries available to ship to. Use the two-character ISO Standard Country Codes. | [optional]
1111
**show_accepted_network_icons** | **BOOLEAN** | Configure Unified Checkout to display the list of accepted card networks beneath the payment button Possible values: - True - False | [optional]
12+
**request_save_card** | **BOOLEAN** | Configure Unified Checkout to display the \"Save card for future use\" checkbox.<br> Configurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.<br> Applicable when manually entering the details and not enrolling in Click to Pay. Possible values: - True - False<br><br> **Use Cases:** **Offer consumers option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to true. - When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout. - When selected this provides a response in both the Transient Token and Get Credentials API response.<br><br> **Do not offer consumers the option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request. - When set to false, the save card option is not shown to consumers when manually entering card details. | [optional]
13+
**combo_card** | **BOOLEAN** | Configure Unified Checkout to display combo card at checkout.<br> A combo debit/credit card is a single card that functions both as a Debit/Credit card. Unified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card. **Important:** This is applicable to Visa cards only. Possible values: - True - False<br><br> **Use Cases:** **Offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to true. - When set to true, Combo Card selection is shown at checkout <br><br> **Do not offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request. - The Combo Card selection is not shown at checkout. | [optional]
1214

1315

0 commit comments

Comments
 (0)