Table of Contents
- Overview
- Purpose
- Pre-Integration Requirements (Client Input)
- Authentication Overview
- Payment SDK Interface
- Example Implementation
- Integration Flow
- Testing Guidelines
- Deployment Guidelines
- Client Checklist Summary
- Ordway Connector Guidelines
Overview
The Payment Software Development Kit (SDK) enables seamless and secure integration of third-party payment gateways (Adyen, Braintree, Heartland etc.) with the Ordway Payments Service.
The SDK provides:
- JWT-based Authentication for secure API access
- Unified Payment Interface for create, refund, void, and reconcile operations
- Modular Gateway Integration, allowing plug-and-play support for multiple providers
Built using NestJS, the SDK aligns with modern authentication and microservice best practices.
Purpose
This guide helps client development teams integrate the Payment SDK efficiently.
It also lists the information required before setup, ensuring a smooth configuration process with your chosen payment provider.
Pre-Integration Requirements (Client Input)
Before integration, please provide the following details to the Ordway product team. This will allow the SDK to be correctly configured for your gateway and environment.
| Field | Description | Example |
|---|---|---|
| Payment Gateway Name | Provider you use | Adyen / Payarc/ Braintree / Heartland |
| Merchant Account ID | Provided by the gateway | merchant_12345 |
| API Key / Secret | Authentication credential | sk_live_ABC |
| Supported Currencies | Currency codes | USD, INR |
| Supported Payment Methods | Card, Wallet, UPI, ACH, etc. | Card, UPI |
| Sandbox / Production Endpoints | Test and live URLs | https://sandbox.adyen.com/... |
| Webhook Endpoints | Payment event callback URLs | https://api.client.com/payments/webhook |
| Environment Setup | Cloud or local | AWS / GCP / On-prem |
Authentication Overview
The Payments SDK uses JWT (JSON Web Token) for secure authentication across all API calls.
Workflow
- Include a Bearer token in each request.
- SDK validates the token using a secret (JWT_SECRET_KEY).
- If valid, the request continues with user and tenant context.
Environment Configuration Example
| JWT_SECRET_KEY=your_strong_secret_key |
Payment SDK Interface
The SDK standardizes all payment operations via the PaymentServiceInterface.
| Method | Purpose | Request Data Transfer Object (DTO) | Response |
|---|---|---|---|
| create() | Authorize and capture payment | CreatePaymentsDto | PaymentResponse |
| get() | Retrieve payment details | GetPaymentDto | PaymentResponse |
| refund() | Refund completed payment | RefundPaymentsDto | PaymentResponse |
| void() | Cancel authorized payment | VoidPaymentDto | PaymentResponse |
| reconcile() | Retrieve reconciliation data | ReconcilePaymentsDto | PaymentResponse |
Example Implementation
Sample: Adyen Gateway Integration
This sample demonstrates how to implement the PaymentServiceInterface using Adyen's payment gateway. It handles payment creation and returns a standardized response.
|
@Injectable() export class AdyenPaymentsService implements PaymentServiceInterface { constructor(private readonly adyenClient: AdyenClient) {} async create(params: CreatePaymentsDto): Promise<PaymentResponse> { const adyenRequest = { amount: { value: params.amount, currency: params.currency }, reference: params.payment_uid, }; const adyenResponse = await this.adyenClient.makeRequest('payments', adyenRequest); return { status: 'succeeded', transaction_ref: adyenResponse.pspReference, amount: params.amount, currency: params.currency, gateway_resp: adyenResponse, }; } } |
Integration Flow
To successfully interact with the Payments SDK, follow these steps:
- Obtain an authentication token using your credentials.
- Include the JWT Bearer Token in every API call.
- Call payment lifecycle methods (create, refund, etc.).
- Use webhooks or reconciliation APIs to sync status updates.
Testing Guidelines
To ensure safe and reliable validation during integration:
- Use Sandbox credentials for all validation.
- Test token expiry and renewal.
- Simulate success, failure, and partial payments.
- Cross-verify reconciliation with your accounting system.
Deployment Guidelines
To deploy the Payments SDK, you can use either Docker or Kubernetes. Below are the recommended setup commands for each environment.
Using Docker
|
docker run -p 3000:3000 \ -e JWT_SECRET_KEY='Your_Strong_JWT_Secret' \ -e ADYEN_API_KEY='sk_live_YourAdyenAPIKey' \ yourcompany/payments-sdk:latest |
Using Kubernetes
|
kubectl create secret generic payment-secrets \ --from-literal=JWT_SECRET_KEY='Your_Strong_JWT_Secret' \ --from-literal=ADYEN_API_KEY='sk_live_YourAdyenAPIKey' |
Then reference in your deployment YAML:
|
env: - name: JWT_SECRET_KEY valueFrom: secretKeyRef: name: payment-secrets key: JWT_SECRET_KEY |
Client Checklist Summary
The table below lists the required actions and ownership for each step:
Step |
Action Required | Owner |
|---|---|---|
1 |
Provide API keys and gateway credentials | Client |
2 |
Share sandbox endpoints and webhooks URLs | Client |
3 |
Configure JWT secret and expiry | Both |
4 |
Deploy SDK and run test transactions | Ordway |
5 |
Verify reconciliation data | Client |
Notes, Tips, and Warnings
- Tip: Always test in sandbox mode before production.
- Warning: Never expose JWT secrets or API keys publicly.
- Note: Token expiry can be adjusted to align with session policies.
Action Items
- After completing the implementation, provide the required YAML configuration file (Example, exactpay.yml) to finalize the integration process.
More Information
- Payment gateway connector software development kit
- Ordway Labs provides REST APIs to access our Billing and Finance platform
Ordway Connector Guidelines
The GitHub repository for the Ordway Payment SDK contains essential resources to support your integration:
- Sample Folder: Includes example interactors that demonstrate how to implement gateway-specific logic.
- Request/ Response Examples: Helps you understand how to structure API calls and interpret SDK responses.
- Testing Support: Use these samples to validate your connector implementation before going live.
For more information see Ordway Payment SDK GitHub Repository
Comments
0 comments
Please sign in to leave a comment.