Skip to content

Commit a291bec

Browse files
remove environments
1 parent 9979b53 commit a291bec

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

examples/nextjs/app/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ export default async function Home() {
99
unstable_noStore();
1010
const session = await createCheckoutSession(
1111
{
12-
environment:
13-
(process.env.GODADDY_ENVIRONMENT as 'dev' | 'test' | 'ote' | 'prod') ||
14-
'dev',
12+
environment: process.env.NEXT_PUBLIC_GODADDY_ENV as any | 'prod',
1513
returnUrl: 'https://godaddy.com',
1614
successUrl: 'https://godaddy.com/success',
1715
draftOrderId: process.env.NEXT_PUBLIC_GODADDY_DRAFT_ORDER_ID || '',

examples/nextjs/env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GoDaddy API Credentials
22
GODADDY_CLIENT_ID=
33
GODADDY_CLIENT_SECRET=
4-
NEXT_PUBLIC_GODADDY_ENV=test|dev|prod
4+
NEXT_PUBLIC_GODADDY_ENV=prod
55
NEXT_PUBLIC_GODADDY_HOST=api.godaddy.com
66

77
# Store and Order Identifiers

packages/react/src/lib/godaddy/godaddy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getHostByEnvironment(): string {
4444

4545
export async function createCheckoutSession(
4646
input: CheckoutSessionInput['input'],
47-
{ accessToken }: { accessToken: string; environment: Environments }
47+
{ accessToken }: { accessToken: string }
4848
): Promise<
4949
ResultOf<typeof CreateCheckoutSessionMutation>['createCheckoutSession']
5050
> {

packages/react/src/server.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
'use server';
22

3-
import type {
4-
CheckoutSessionInput,
5-
CheckoutSessionOptions,
6-
Environments,
7-
} from '@/types';
3+
import type { CheckoutSessionInput, CheckoutSessionOptions } from '@/types';
84
import * as GoDaddy from './lib/godaddy/godaddy';
95

106
let accessToken: string | undefined;
@@ -27,7 +23,6 @@ export async function createCheckoutSession(
2723
const getAccessTokenResponse = await getAccessToken({
2824
clientId: CLIENT_ID,
2925
clientSecret: CLIENT_SECRET,
30-
environment: input?.environment || 'dev',
3126
});
3227

3328
accessToken = getAccessTokenResponse?.access_token;
@@ -40,7 +35,6 @@ export async function createCheckoutSession(
4035

4136
return await GoDaddy.createCheckoutSession(input, {
4237
accessToken,
43-
environment: input?.environment || 'dev',
4438
});
4539
}
4640

@@ -54,7 +48,6 @@ async function getAccessToken({
5448
}: {
5549
clientId: string;
5650
clientSecret: string;
57-
environment: Environments;
5851
}) {
5952
if (!clientId || !clientSecret) {
6053
return;

0 commit comments

Comments
 (0)