Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d6575ce
feat(payments): add
fahmidareem3 Apr 29, 2026
70b4dd4
feat: add subscription service and plan type
fahmidareem3 Apr 29, 2026
965080b
feat: add dispute service for dispute management
fahmidareem3 Apr 29, 2026
21e13dd
feat: add payout service
fahmidareem3 Apr 29, 2026
12a45fb
fix: align all sdk types with Crowdsplit staging
fahmidareem3 Apr 29, 2026
04ac796
feat: tighten transfer types for chain and payment method
fahmidareem3 Apr 29, 2026
69aacd7
chore: add changelog.md
fahmidareem3 Apr 29, 2026
4f9f62f
feat: add customer files, kyc platforms and other missing services
fahmidareem3 Apr 29, 2026
7f690c4
feat: close all remaining gaps with Crowdsplit staging
fahmidareem3 Apr 29, 2026
7ebedf3
fix: address all field level and enum audit findings
fahmidareem3 Apr 29, 2026
2d26673
feat: improve support for brazil clients
fahmidareem3 Apr 29, 2026
79f4124
fix: fix query params and missing enums
fahmidareem3 Apr 29, 2026
f488203
feat: add pix payment type, trading wallet and plaid response fields
fahmidareem3 Apr 29, 2026
13407f0
fix: fix webhook signature verification and balance response field
fahmidareem3 Apr 29, 2026
7184b18
test: rewrite integration tests for all new services
fahmidareem3 Apr 29, 2026
0c07868
fix: resolve PR review comments
fahmidareem3 Apr 29, 2026
756baa2
fix: remove wallet, merchant, providerproxy,pix and sandbox service
fahmidareem3 Apr 29, 2026
32abcdb
fix: parse webhook signature fields by key prefix
fahmidareem3 Apr 29, 2026
0d05181
Merge pull request #113 from oak-network/feature/update-payment-sdk
fahmidareem3 Apr 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/many-parrots-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@oaknetwork/payments-sdk': minor
---

Update payment sdk with the recent changes from Crowdsplit
2 changes: 2 additions & 0 deletions packages/payments/__tests__/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export function getConfigFromEnv(): OakClientConfig {
};
}

export const INTEGRATION_TEST_TIMEOUT = 30000;

export function getTestEnvironment(): TestEnvironment {
return {
paymentCustomerId: process.env.PAYMENT_CUSTOMER_ID,
Expand Down
104 changes: 104 additions & 0 deletions packages/payments/__tests__/integration/disputeService.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import { createOakClient, createDisputeService } from '../../src';
import { DisputeService } from '../../src/services/disputeService';
import { getConfigFromEnv, INTEGRATION_TEST_TIMEOUT } from '../config';

describe('DisputeService - Integration', () => {
let disputes: DisputeService;

beforeAll(() => {
const client = createOakClient({
...getConfigFromEnv(),
retryOptions: {
maxNumberOfRetries: 2,
delay: 500,
backoffFactor: 2,
},
});
disputes = createDisputeService(client);
});

// ---------------------------------------------------------------
// Service shape
// ---------------------------------------------------------------
describe('service interface', () => {
it('should expose list method', () => {
expect(typeof disputes.list).toBe('function');
});

it('should expose updateEvidence method', () => {
expect(typeof disputes.updateEvidence).toBe('function');
});

it('should expose submit method', () => {
expect(typeof disputes.submit).toBe('function');
});

it('should expose close method', () => {
expect(typeof disputes.close).toBe('function');
});
});

// ---------------------------------------------------------------
// list()
// ---------------------------------------------------------------
describe('list', () => {
it(
'should return a response when listing disputes',
async () => {
const response = await disputes.list();
// May return empty list or data - both are valid
expect(response).toBeDefined();
if (response.ok) {
expect(response.value).toBeDefined();
}
},
INTEGRATION_TEST_TIMEOUT,
);
});

// ---------------------------------------------------------------
// updateEvidence() - error path
// ---------------------------------------------------------------
describe('updateEvidence', () => {
it(
'should return an error for a non-existent dispute',
async () => {
const response = await disputes.updateEvidence('non-existent-id', {
text_evidences: [
{ key: 'customer_name', value: 'Test Customer' },
],
});
expect(response.ok).toBe(false);
},
INTEGRATION_TEST_TIMEOUT,
);
});

// ---------------------------------------------------------------
// submit() - error path
// ---------------------------------------------------------------
describe('submit', () => {
it(
'should return an error for a non-existent dispute',
async () => {
const response = await disputes.submit('non-existent-id');
expect(response.ok).toBe(false);
},
INTEGRATION_TEST_TIMEOUT,
);
});

// ---------------------------------------------------------------
// close() - error path
// ---------------------------------------------------------------
describe('close', () => {
it(
'should return an error for a non-existent dispute',
async () => {
const response = await disputes.close('non-existent-id');
expect(response.ok).toBe(false);
},
INTEGRATION_TEST_TIMEOUT,
);
});
});
Loading
Loading