cybersource-apimatic-sdk
v0.0.2
Published
Sample SDKs for cybersource by APIMatic
Readme
Getting Started with CyberSource Merged Spec
Introduction
All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
Install the Package
Run the following command from your project directory to install the package from npm:
npm install [email protected]For additional package details, see the Npm page for the [email protected] npm.
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
| timeout | number | Timeout for API calls.Default: 0 |
| httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. |
| unstableHttpClientOptions | any | Unstable configurable http client options. |
| logging | PartialLoggingOptions | Logging Configuration to enable logging |
The API client can be initialized as follows:
Code-Based Client Initialization
import { Client, LogLevel } from 'cybersource-apimatic-sdk';
const client = new Client({
timeout: 0,
logging: {
logLevel: LogLevel.Info,
logRequest: {
logBody: true
},
logResponse: {
logHeaders: true
}
},
});Configuration-Based Client Initialization
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'cybersource-apimatic-sdk';
// Provide absolute path for the configuration file
const absolutePath = path.resolve('./config.json');
// Read the configuration file content
const fileContent = fs.readFileSync(absolutePath, 'utf-8');
// Initialize client from JSON configuration content
const client = Client.fromJsonConfig(fileContent);See the Configuration-Based Client Initialization section for details.
Environment-Based Client Initialization
import * as dotenv from 'dotenv';
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'cybersource-apimatic-sdk';
// Optional - Provide absolute path for the .env file
const absolutePath = path.resolve('./.env');
if (fs.existsSync(absolutePath)) {
// Load environment variables from .env file
dotenv.config({ path: absolutePath, override: true });
}
// Initialize client using environment variables
const client = Client.fromEnvironment(process.env);See the Environment-Based Client Initialization section for details.
List of APIs
- Network Tokens
- Instrument Identifier
- Customer Payment Instrument
- Payment Instrument
- Customer Shipping Address
- Microform Integration
- Decision Manager
- Pull Funds
- Subscriptions Follow-Ons
- Report Definitions
- Report Downloads
- Report Subscriptions
- Net Fundings
- Notification of Changes
- Purchase and Refund Details
- Payment Batch Summaries
- Conversion Details
- Download DTD
- Download XSD
- Chargeback Summaries
- Chargeback Details
- Retrieval Summaries
- Retrieval Details
- Interchange Clearing Level Details
- Invoice Settings
- Payer Authentication
- Bin Lookup
- Merchant Defined Fields
- Payments
- Capture
- Reversal
- Refund
- Credit
- Void
- Billing Agreements
- Orders
- Payment-Tokens
- Transaction Batches
- Tokenize
- Customer
- Payouts
- Plans
- Subscriptions
- Reports
- Invoices
- Verification
- Transaction Details
- Search Transactions
- Secure File Share
SDK Infrastructure
Configuration
- HttpClientOptions
- RetryConfiguration
- ProxySettings
- Configuration-Based Client Initialization
- Environment-Based Client Initialization
- PartialLoggingOptions
- PartialRequestLoggingOptions
- PartialResponseLoggingOptions
- LoggerInterface
