Skip to content

Commit

Permalink
Test which country appears here
Browse files Browse the repository at this point in the history
  • Loading branch information
pulgueta committed Feb 7, 2024
1 parent e049939 commit 3984eb4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ import { PaddleButtons } from './paddle-buttons';
import { currentUser } from '~/lib/auth/currentUser';
import { env } from '~/env/server.mjs';

const ipData = new IPData(env.IPDATA_KEY);
const { lookup } = new IPData(env.IPDATA_KEY);

export const PayButton = async () => {
const plansPromise = getPaidSubscriptions();
const userPromise = currentUser();
const countryPromise = ipData.lookup();
const countryPromise = lookup();

const [user, plans, country] = await Promise.all([
userPromise,
plansPromise,
countryPromise,
]);

console.log(country);

const isColombia = country.country_code === 'CO';

return isColombia ? (
Expand Down

0 comments on commit 3984eb4

Please sign in to comment.