File tree Expand file tree Collapse file tree 4 files changed +4
-13
lines changed Expand file tree Collapse file tree 4 files changed +4
-13
lines changed Original file line number Diff line number Diff 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 || '' ,
Original file line number Diff line number Diff line change 11# GoDaddy API Credentials
22GODADDY_CLIENT_ID=
33GODADDY_CLIENT_SECRET=
4- NEXT_PUBLIC_GODADDY_ENV=test|dev| prod
4+ NEXT_PUBLIC_GODADDY_ENV=prod
55NEXT_PUBLIC_GODADDY_HOST=api.godaddy.com
66
77# Store and Order Identifiers
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ function getHostByEnvironment(): string {
4444
4545export 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> {
Original file line number Diff line number Diff line change 11'use server' ;
22
3- import type {
4- CheckoutSessionInput ,
5- CheckoutSessionOptions ,
6- Environments ,
7- } from '@/types' ;
3+ import type { CheckoutSessionInput , CheckoutSessionOptions } from '@/types' ;
84import * as GoDaddy from './lib/godaddy/godaddy' ;
95
106let 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 ;
You can’t perform that action at this time.
0 commit comments