Skip to content

Downloads the PaymentsBatchDetails report from CyberSource using their REST API

Notifications You must be signed in to change notification settings

sul-dlss/cybersource-rest-ruby

Repository files navigation

Download the Payment Batch Detail Report using the CyberSource SDK

This LibSys repository is a hard fork and heavily modified and pruned version of the CyberSource working code sample which demonstrates Ruby integration with the CyberSource REST APIs through the CyberSource Ruby SDK.

Requirements

Running the Samples From the Command Line

  • Clone this repository:
    $ git clone https://github.com/sul-dlss/cybersource-rest-ruby
  • Install the gems
    $ bundle
  • Run the test report:
    $ SLEEP=0 rspec

Create Persistent Volume

kubectl -n ${namespace} apply -f pv-volume.yaml

Setting the API credentials for an API request

Configure the MERCHANT_KEY_ID and MERCHANT_SECRET_KEY variables in the environment The variables for STAGE, APP_PASSWORD (for folio) and APP_USERNAME are configured using the db-connect-modules folio secret.

Obtain the merchantsecretKey and merchantKeyId from the CyberSource Business Center. You will need permissions from [email protected] to access the CyberSource Business Center with the option to generate security keys.

Create secret with the Cybersource credentials

apiVersion: v1
kind: Secret
metadata:
  name: cybersource
type: Opaque
data:
  MERCHANT_KEY_ID: base64 encoded accessKey
  MERCHANT_SECRET_KEY: base64 encoded secretKey
  EMAIL_REPORT_TO: base64 encoded comma-seperatred list of email addresses

Then:

kubectl -n ${namespace} apply -f secret.yaml

Create secret with sendmail config

Edit the sendmail.yaml, sendmail.mc: SMART_HOST entry to be the cluster mail host.

kubectl -n ${namespace} apply -f sendmail.yaml

Run the ChronJob

kubectl -n ${namespace} apply -f cronjob.yaml

Run the Debug pod

kubectl -n ${namespace} apply -f debug.yaml

Give sendmail a couple of minutes to restart before checking the /home/harvester/harvestlog directory.

Switching between the sandbox environment and the production environment

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 sample code is configured to communicate with the sandbox environment. To switch to the sandbox environment, set the CYBS_ENV=sandbox environment variable.

CyberSource API Reference

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.

About

Downloads the PaymentsBatchDetails report from CyberSource using their REST API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages