Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
43 changes: 22 additions & 21 deletions AuthenticationSDK/Cybersource.gemspec
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
Gem::Specification.new do |s|
s.name = "AuthenticationSDK"
s.version = "0.0.1"
s.platform = Gem::Platform::RUBY
s.date = "2018-07-17"
s.summary = "Cybersource Payments REST API Ruby Gem"
s.description = "Move your business forward with the Cybersource Payments REST API"
s.authors = ["cybersource"]
s.email = ""
s.files = Dir.glob("{lib}/**/*")
s.name = "authenticationSDK"
s.version = "0.0.1"
s.platform = Gem::Platform::RUBY
s.date = "2018-07-17"
s.summary = "Cybersource Payments REST API Ruby Gem"
s.description = "Move your business forward with the Cybersource Payments REST API"
s.authors = ["cybersource"]
s.email = ""
s.files = Dir.glob("{lib}/**/*")

s.required_ruby_version = '>= 2.2.2'
s.required_rubygems_version = '>= 1.3.6'

s.required_ruby_version = '>= 2.2.2'
s.required_rubygems_version = '>= 1.3.6'

s.add_runtime_dependency 'activesupport', '~> 5.2', '>= 5.2.0'
s.add_runtime_dependency 'json', '~> 2.1.0', '>= 1.8.1'
s.add_runtime_dependency 'interface','~> 1.0', '>= 1.0.4'
s.add_runtime_dependency 'jwt', '~> 2.1.0'

s.add_development_dependency 'rspec', '~> 2.1'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'rubocop', '~> 0.57.2'
end
s.add_runtime_dependency 'activesupport', '~> 5.2', '>= 5.2.0'
s.add_runtime_dependency 'json', '~> 2.1.0', '>= 1.8.1'
s.add_runtime_dependency 'interface','~> 1.0', '>= 1.0.4'
s.add_runtime_dependency 'jwt', '~> 2.1.0'

s.add_development_dependency 'rspec', '~> 2.1'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'rubocop', '~> 0.57.2'
end

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def generateSignatureParameter(merchantconfig_obj, gmtdatetime, log_obj)
if request_type == Constants::GET_REQUEST_TYPE || request_type == Constants::DELETE_REQUEST_TYPE
targetUrl=gettargetUrlForGetDelete(request_type,merchantconfig_obj)
signatureString << targetUrl + "\n"
elsif request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE
elsif request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE || request_type == Constants::PATCH_REQUEST_TYPE
targetUrl=gettargetUrlForPutPost(request_type,merchantconfig_obj)
signatureString << targetUrl + "\n"
payload = merchantconfig_obj.requestJsonData
Expand Down Expand Up @@ -56,6 +56,8 @@ def gettargetUrlForPutPost(request_type, merchantconfig_obj)
targetUrlForPutPost = Constants::POST_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
elsif request_type == Constants::PUT_REQUEST_TYPE
targetUrlForPutPost = Constants::PUT_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
elsif request_type == Constants::PATCH_REQUEST_TYPE
targetUrlForPutPost = Constants::PATCH_REQUEST_TYPE_LOWER + ' ' + merchantconfig_obj.requestTarget
end
return targetUrlForPutPost
end
Expand Down
4 changes: 3 additions & 1 deletion AuthenticationSDK/authentication/http/HttpSignatureHeader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def getsignatureHeader(request_type)
headers = 'host date (request-target)' + ' ' + Constants::V_C_MERCHANT_ID
elsif request_type == Constants::PUT_REQUEST_TYPE
headers = 'host date (request-target) digest ' + Constants::V_C_MERCHANT_ID
else
elsif request_type == Constants::PATCH_REQUEST_TYPE
headers = 'host date (request-target) digest ' + Constants::V_C_MERCHANT_ID
else
raise StandardError.new(Constants::ERROR_PREFIX + Constants::INVALID_REQUEST_TYPE_METHOD)
end
return headers
Expand Down
4 changes: 2 additions & 2 deletions AuthenticationSDK/authentication/jwt/JwtToken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def getToken(merchantconfig_obj,gmtDatetime,log_obj)
request_type = merchantconfig_obj.requestType.upcase
filePath = merchantconfig_obj.keysDirectory + '/' + merchantconfig_obj.keyFilename + '.p12'
if (!File.exist?(filePath))
raise Constants::ERROR_PREFIX + Constants::FILE_NOT_FOUND + filePath
raise Constants::ERROR_PREFIX + Constants::FILE_NOT_FOUND + File.expand_path(filePath)
end
p12File = File.binread(filePath)
jwtBody=getJwtBody(request_type, gmtDatetime, merchantconfig_obj, log_obj)
Expand Down Expand Up @@ -47,7 +47,7 @@ def getToken(merchantconfig_obj,gmtDatetime,log_obj)
end
end
def getJwtBody(request_type, gmtDatetime, merchantconfig_obj,log_obj)
if request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE
if request_type == Constants::POST_REQUEST_TYPE || request_type == Constants::PUT_REQUEST_TYPE || request_type == Constants::PATCH_REQUEST_TYPE
payload = merchantconfig_obj.requestJsonData
# Note: Digest is not passed for GET calls
digest = DigestGeneration.new.generateDigest(payload, log_obj)
Expand Down
4 changes: 4 additions & 0 deletions AuthenticationSDK/util/Constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class Constants
POST_REQUEST_TYPE_LOWER = 'post' unless const_defined?(:POST_REQUEST_TYPE_LOWER)

PUT_REQUEST_TYPE_LOWER = 'put' unless const_defined?(:PUT_REQUEST_TYPE_LOWER)

PATCH_REQUEST_TYPE_LOWER = 'patch' unless const_defined?(:PATCH_REQUEST_TYPE_LOWER)

DELETE_REQUEST_TYPE_LOWER = 'delete' unless const_defined?(:DELETE_REQUEST_TYPE_LOWER)

Expand All @@ -13,6 +15,8 @@ class Constants
POST_REQUEST_TYPE = 'POST' unless const_defined?(:POST_REQUEST_TYPE)

PUT_REQUEST_TYPE = 'PUT' unless const_defined?(:PUT_REQUEST_TYPE)

PATCH_REQUEST_TYPE = 'PATCH' unless const_defined?(:PATCH_REQUEST_TYPE)

DELETE_REQUEST_TYPE = 'DELETE' unless const_defined?(:DELETE_REQUEST_TYPE)

Expand Down
39 changes: 0 additions & 39 deletions cyberSource_client.gemspec

This file was deleted.

50 changes: 50 additions & 0 deletions cybersource_rest_client.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- encoding: utf-8 -*-

=begin
#CyberSource Flex API

#Simple PAN tokenization service

OpenAPI spec version: 0.0.1

Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3

=end

$:.push File.expand_path("../lib", __FILE__)
require "cybersource_rest_client/version"

Gem::Specification.new do |s|
s.name = "cybersource_rest_client"
s.version = "0.0.4"
s.platform = Gem::Platform::RUBY
s.authors = ["CyberSource"]
s.email = ["cybersourcedev@gmail.com"]
s.homepage = "https://developer.cybersource.com"
s.summary = "CyberSource Ruby SDK Gem"
s.description = "Simple REST API for the CyberSource Global Payments Platform"
s.license = "CyberSource"
s.files = Dir.glob("{lib,AuthenticationSDK}/**/*")
s.required_ruby_version = ">= 1.9"

s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'

s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'

s.add_runtime_dependency 'activesupport', '~> 5.2', '>= 5.2.0'
s.add_runtime_dependency 'interface','~> 1.0', '>= 1.0.4'
s.add_runtime_dependency 'jwt', '~> 2.1.0'

s.add_development_dependency 'simplecov'
s.add_development_dependency 'rubocop', '~> 0.57.2'

s.require_paths = ["lib"]
end
10 changes: 5 additions & 5 deletions docs/AuthReversalRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client_reference_information** | [**V2paymentsidreversalsClientReferenceInformation**](V2paymentsidreversalsClientReferenceInformation.md) | | [optional]
**reversal_information** | [**V2paymentsidreversalsReversalInformation**](V2paymentsidreversalsReversalInformation.md) | | [optional]
**processing_information** | [**V2paymentsidreversalsProcessingInformation**](V2paymentsidreversalsProcessingInformation.md) | | [optional]
**order_information** | [**V2paymentsidreversalsOrderInformation**](V2paymentsidreversalsOrderInformation.md) | | [optional]
**point_of_sale_information** | [**V2paymentsidreversalsPointOfSaleInformation**](V2paymentsidreversalsPointOfSaleInformation.md) | | [optional]
**client_reference_information** | [**Ptsv2paymentsidreversalsClientReferenceInformation**](Ptsv2paymentsidreversalsClientReferenceInformation.md) | | [optional]
**reversal_information** | [**Ptsv2paymentsidreversalsReversalInformation**](Ptsv2paymentsidreversalsReversalInformation.md) | | [optional]
**processing_information** | [**Ptsv2paymentsidreversalsProcessingInformation**](Ptsv2paymentsidreversalsProcessingInformation.md) | | [optional]
**order_information** | [**Ptsv2paymentsidreversalsOrderInformation**](Ptsv2paymentsidreversalsOrderInformation.md) | | [optional]
**point_of_sale_information** | [**Ptsv2paymentsidreversalsPointOfSaleInformation**](Ptsv2paymentsidreversalsPointOfSaleInformation.md) | | [optional]


10 changes: 5 additions & 5 deletions docs/Body.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_links** | [**InstrumentidentifiersLinks**](InstrumentidentifiersLinks.md) | | [optional]
**_links** | [**Tmsv1instrumentidentifiersLinks**](Tmsv1instrumentidentifiersLinks.md) | | [optional]
**id** | **String** | Unique identification number assigned by CyberSource to the submitted request. | [optional]
**object** | **String** | Describes type of token. For example: customer, paymentInstrument or instrumentIdentifier. | [optional]
**state** | **String** | Current state of the token. | [optional]
**card** | [**InstrumentidentifiersCard**](InstrumentidentifiersCard.md) | | [optional]
**bank_account** | [**InstrumentidentifiersBankAccount**](InstrumentidentifiersBankAccount.md) | | [optional]
**processing_information** | [**InstrumentidentifiersProcessingInformation**](InstrumentidentifiersProcessingInformation.md) | | [optional]
**metadata** | [**InstrumentidentifiersMetadata**](InstrumentidentifiersMetadata.md) | | [optional]
**card** | [**Tmsv1instrumentidentifiersCard**](Tmsv1instrumentidentifiersCard.md) | | [optional]
**bank_account** | [**Tmsv1instrumentidentifiersBankAccount**](Tmsv1instrumentidentifiersBankAccount.md) | | [optional]
**processing_information** | [**Tmsv1instrumentidentifiersProcessingInformation**](Tmsv1instrumentidentifiersProcessingInformation.md) | | [optional]
**metadata** | [**Tmsv1instrumentidentifiersMetadata**](Tmsv1instrumentidentifiersMetadata.md) | | [optional]


2 changes: 1 addition & 1 deletion docs/Body1.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**processing_information** | [**InstrumentidentifiersProcessingInformation**](InstrumentidentifiersProcessingInformation.md) | | [optional]
**processing_information** | [**Tmsv1instrumentidentifiersProcessingInformation**](Tmsv1instrumentidentifiersProcessingInformation.md) | | [optional]


18 changes: 9 additions & 9 deletions docs/Body2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_links** | [**InstrumentidentifiersLinks**](InstrumentidentifiersLinks.md) | | [optional]
**_links** | [**Tmsv1instrumentidentifiersLinks**](Tmsv1instrumentidentifiersLinks.md) | | [optional]
**id** | **String** | Unique identification number assigned by CyberSource to the submitted request. | [optional]
**object** | **String** | Describes type of token. For example: customer, paymentInstrument or instrumentIdentifier. | [optional]
**state** | **String** | Current state of the token. | [optional]
**bank_account** | [**PaymentinstrumentsBankAccount**](PaymentinstrumentsBankAccount.md) | | [optional]
**card** | [**PaymentinstrumentsCard**](PaymentinstrumentsCard.md) | | [optional]
**buyer_information** | [**PaymentinstrumentsBuyerInformation**](PaymentinstrumentsBuyerInformation.md) | | [optional]
**bill_to** | [**PaymentinstrumentsBillTo**](PaymentinstrumentsBillTo.md) | | [optional]
**processing_information** | [**PaymentinstrumentsProcessingInformation**](PaymentinstrumentsProcessingInformation.md) | | [optional]
**merchant_information** | [**PaymentinstrumentsMerchantInformation**](PaymentinstrumentsMerchantInformation.md) | | [optional]
**meta_data** | [**InstrumentidentifiersMetadata**](InstrumentidentifiersMetadata.md) | | [optional]
**instrument_identifier** | [**PaymentinstrumentsInstrumentIdentifier**](PaymentinstrumentsInstrumentIdentifier.md) | | [optional]
**bank_account** | [**Tmsv1paymentinstrumentsBankAccount**](Tmsv1paymentinstrumentsBankAccount.md) | | [optional]
**card** | [**Tmsv1paymentinstrumentsCard**](Tmsv1paymentinstrumentsCard.md) | | [optional]
**buyer_information** | [**Tmsv1paymentinstrumentsBuyerInformation**](Tmsv1paymentinstrumentsBuyerInformation.md) | | [optional]
**bill_to** | [**Tmsv1paymentinstrumentsBillTo**](Tmsv1paymentinstrumentsBillTo.md) | | [optional]
**processing_information** | [**Tmsv1paymentinstrumentsProcessingInformation**](Tmsv1paymentinstrumentsProcessingInformation.md) | | [optional]
**merchant_information** | [**Tmsv1paymentinstrumentsMerchantInformation**](Tmsv1paymentinstrumentsMerchantInformation.md) | | [optional]
**meta_data** | [**Tmsv1instrumentidentifiersMetadata**](Tmsv1instrumentidentifiersMetadata.md) | | [optional]
**instrument_identifier** | [**Tmsv1paymentinstrumentsInstrumentIdentifier**](Tmsv1paymentinstrumentsInstrumentIdentifier.md) | | [optional]


18 changes: 9 additions & 9 deletions docs/Body3.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_links** | [**InstrumentidentifiersLinks**](InstrumentidentifiersLinks.md) | | [optional]
**_links** | [**Tmsv1instrumentidentifiersLinks**](Tmsv1instrumentidentifiersLinks.md) | | [optional]
**id** | **String** | Unique identification number assigned by CyberSource to the submitted request. | [optional]
**object** | **String** | Describes type of token. For example: customer, paymentInstrument or instrumentIdentifier. | [optional]
**state** | **String** | Current state of the token. | [optional]
**bank_account** | [**PaymentinstrumentsBankAccount**](PaymentinstrumentsBankAccount.md) | | [optional]
**card** | [**PaymentinstrumentsCard**](PaymentinstrumentsCard.md) | | [optional]
**buyer_information** | [**PaymentinstrumentsBuyerInformation**](PaymentinstrumentsBuyerInformation.md) | | [optional]
**bill_to** | [**PaymentinstrumentsBillTo**](PaymentinstrumentsBillTo.md) | | [optional]
**processing_information** | [**PaymentinstrumentsProcessingInformation**](PaymentinstrumentsProcessingInformation.md) | | [optional]
**merchant_information** | [**PaymentinstrumentsMerchantInformation**](PaymentinstrumentsMerchantInformation.md) | | [optional]
**meta_data** | [**InstrumentidentifiersMetadata**](InstrumentidentifiersMetadata.md) | | [optional]
**instrument_identifier** | [**PaymentinstrumentsInstrumentIdentifier**](PaymentinstrumentsInstrumentIdentifier.md) | | [optional]
**bank_account** | [**Tmsv1paymentinstrumentsBankAccount**](Tmsv1paymentinstrumentsBankAccount.md) | | [optional]
**card** | [**Tmsv1paymentinstrumentsCard**](Tmsv1paymentinstrumentsCard.md) | | [optional]
**buyer_information** | [**Tmsv1paymentinstrumentsBuyerInformation**](Tmsv1paymentinstrumentsBuyerInformation.md) | | [optional]
**bill_to** | [**Tmsv1paymentinstrumentsBillTo**](Tmsv1paymentinstrumentsBillTo.md) | | [optional]
**processing_information** | [**Tmsv1paymentinstrumentsProcessingInformation**](Tmsv1paymentinstrumentsProcessingInformation.md) | | [optional]
**merchant_information** | [**Tmsv1paymentinstrumentsMerchantInformation**](Tmsv1paymentinstrumentsMerchantInformation.md) | | [optional]
**meta_data** | [**Tmsv1instrumentidentifiersMetadata**](Tmsv1instrumentidentifiersMetadata.md) | | [optional]
**instrument_identifier** | [**Tmsv1paymentinstrumentsInstrumentIdentifier**](Tmsv1paymentinstrumentsInstrumentIdentifier.md) | | [optional]


58 changes: 5 additions & 53 deletions docs/CaptureApi.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# CyberSource::CaptureApi

All URIs are relative to *https://api.cybersource.com*
All URIs are relative to *https://apitest.cybersource.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**capture_payment**](CaptureApi.md#capture_payment) | **POST** /v2/payments/{id}/captures | Capture a Payment
[**get_capture**](CaptureApi.md#get_capture) | **GET** /v2/captures/{id} | Retrieve a Capture
[**capture_payment**](CaptureApi.md#capture_payment) | **POST** /pts/v2/payments/{id}/captures | Capture a Payment


# **capture_payment**
Expand All @@ -18,7 +17,7 @@ Include the payment ID in the POST request to capture the payment amount.
### Example
```ruby
# load the gem
require 'cyberSource_client'
require 'cybersource_rest_client'

api_instance = CyberSource::CaptureApi.new

Expand Down Expand Up @@ -53,55 +52,8 @@ No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json



# **get_capture**
> InlineResponse2004 get_capture(id)

Retrieve a Capture

Include the capture ID in the GET request to retrieve the capture details.

### Example
```ruby
# load the gem
require 'cyberSource_client'

api_instance = CyberSource::CaptureApi.new

id = "id_example" # String | The capture ID returned from a previous capture request.


begin
#Retrieve a Capture
result = api_instance.get_capture(id)
p result
rescue CyberSource::ApiError => e
puts "Exception when calling CaptureApi->get_capture: #{e}"
end
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| The capture ID returned from a previous capture request. |

### Return type

[**InlineResponse2004**](InlineResponse2004.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json
- **Content-Type**: application/json;charset=utf-8
- **Accept**: application/json;charset=utf-8



Loading