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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/young-rings-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@oaknetwork/payments-sdk": minor
---

updated new cs domain
10 changes: 5 additions & 5 deletions packages/payments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The SDK ships 17 service modules. Import the factory function for each service y
| [Payment Methods](https://www.oaknetwork.org/docs/sdk/payment-methods) | `createPaymentMethodService(client)` | Add, list, get, delete payment methods |
| [Webhooks](https://www.oaknetwork.org/docs/sdk/webhooks) | `createWebhookService(client)` | Register, manage, and monitor webhooks |
| [Transactions](https://www.oaknetwork.org/docs/sdk/transactions) | `createTransactionService(client)` | List, get, and settle transactions |
| [Transfers](https://www.oaknetwork.org/docs/sdk/transfers) | `createTransferService(client)` | Create provider transfers (Stripe, PagarMe, BRLA) |
| [Transfers](https://www.oaknetwork.org/docs/sdk/transfers) | `createTransferService(client)` | Create provider transfers (Stripe, PagarMe, BRLA) |
| [Plans](https://www.oaknetwork.org/docs/sdk/plans) | `createPlanService(client)` | CRUD subscription plans |
| [Subscriptions](https://www.oaknetwork.org/docs/sdk/subscriptions) | `createSubscriptionService(client)` | Subscribe, cancel, list, pay subscriptions |
| [Refunds](https://www.oaknetwork.org/docs/sdk/refunds) | `createRefundService(client)` | Refund a payment (full or partial) |
Expand Down Expand Up @@ -387,10 +387,10 @@ if (result.ok) {

### Environments

| Environment | API Base URL | Description |
| ------------ | ----------------------------------- | -------------------------------- |
| `sandbox` | `https://api-stage.usecrowdpay.xyz` | Testing — all operations allowed |
| `production` | `https://app.usecrowdpay.xyz` | Live — test operations blocked |
| Environment | API Base URL | Description |
| ------------ | --------------------------------------- | -------------------------------- |
| `sandbox` | `https://stage-payments.oaknetwork.org` | Testing — all operations allowed |
| `production` | `https://payments.oaknetwork.org` | Live — test operations blocked |

```typescript
const client = createOakClient({
Expand Down
10 changes: 6 additions & 4 deletions packages/payments/src/types/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ export interface EnvironmentConfig {
}

export const ENVIRONMENT_URLS: Record<OakEnvironment, string> = {
sandbox: "https://api-stage.usecrowdpay.xyz",
production: "https://app.usecrowdpay.xyz",
sandbox: "https://stage-payments.oaknetwork.org",
production: "https://payments.oaknetwork.org",
};

/**
* @param environment - Target environment
* @returns Configuration for the specified environment
*/
export function getEnvironmentConfig(environment: OakEnvironment): EnvironmentConfig {
export function getEnvironmentConfig(
environment: OakEnvironment,
): EnvironmentConfig {
return {
apiUrl: ENVIRONMENT_URLS[environment],
allowsTestOperations: environment === "sandbox",
Expand All @@ -28,7 +30,7 @@ export function getEnvironmentConfig(environment: OakEnvironment): EnvironmentCo
*/
export function resolveBaseUrl(
environment: OakEnvironment,
customUrl?: string
customUrl?: string,
): string {
if (customUrl) {
return customUrl;
Expand Down
Loading