-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c7f33e
commit 1ff11fd
Showing
3 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import "https://deno.land/[email protected]/dotenv/load.ts"; | ||
import { Client } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
// Read environment variables | ||
// First, get your API keys from https://portal.vipps.no/ | ||
// Here we assume they are stored in a .env file, see .env.example | ||
const clientId = Deno.env.get("CLIENT_ID") || ""; | ||
const clientSecret = Deno.env.get("CLIENT_SECRET") || ""; | ||
|
||
|
@@ -16,6 +17,7 @@ const client = Client({ | |
retryRequests: false, | ||
}); | ||
|
||
// Create a checkout session | ||
const checkout = await client.checkout.create(clientId, clientSecret, { | ||
merchantInfo: { | ||
callbackUrl: "https://example.com/callbackUrl", | ||
|
@@ -30,6 +32,7 @@ const checkout = await client.checkout.create(clientId, clientSecret, { | |
}, | ||
}); | ||
|
||
// Check if the checkout session was created successfully | ||
if (!checkout.ok) { | ||
console.error("😟 Error creating checkout session 😟"); | ||
console.log(checkout.error); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ import { open } from "https://deno.land/x/[email protected]/index.ts"; | |
import "https://deno.land/[email protected]/dotenv/load.ts"; | ||
import { Client } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
// Read environment variables | ||
// First, get your API keys from https://portal.vipps.no/ | ||
// Here we assume they are stored in a .env file, see .env.example | ||
const clientId = Deno.env.get("CLIENT_ID") || ""; | ||
const clientSecret = Deno.env.get("CLIENT_SECRET") || ""; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import "https://deno.land/[email protected]/dotenv/load.ts"; | ||
import { Client } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
// Read environment variables | ||
// First, get your API keys from https://portal.vipps.no/ | ||
// Here we assume they are stored in a .env file, see .env.example | ||
const clientId = Deno.env.get("CLIENT_ID") || ""; | ||
const clientSecret = Deno.env.get("CLIENT_SECRET") || ""; | ||
|
||
|