### Initialize Vipps Mobilepay SDK Client and Create Payment Source: https://github.com/vippsas/deno-sdk/blob/main/README.md This snippet demonstrates how to initialize the Vipps Mobilepay SDK client, authenticate to retrieve an access token, and then create a payment. It assumes necessary credentials like merchantSerialNumber, subscriptionKey, clientId, and clientSecret are available. The example uses test mode and handles potential token retrieval errors. ```typescript import { Client } from "https://deno.land/x/vipps_mobilepay_sdk@1.2.0/mod.ts"; // Create a client const client = Client({ merchantSerialNumber, subscriptionKey, useTestMode: true, retryRequests: false, }); // Grab a token const accessToken = await client.auth.getToken(clientId, clientSecret); // Check if the token was retrieved successfully if (!accessToken.ok) { console.error("😟 Error retrieving token 😟"); console.error(accessToken.error); Deno.exit(1); } const token = accessToken.data.access_token; // Create a payment const payment = await client.payment.create(token, { amount: { currency: "NOK", value: 1000, // This value equals 10 NOK }, paymentMethod: { type: "WALLET" }, customer: { phoneNumber: "4712345678" }, returnUrl: `https://yourwebsite.com/redirect`, userFlow: "WEB_REDIRECT", paymentDescription: "One pair of socks", }); ``` -------------------------------- ### Run Deno Tests and Generate Coverage Report Source: https://github.com/vippsas/deno-sdk/blob/main/README.md These commands show how to execute tests for the Deno SDK project and how to generate a comprehensive HTML test coverage report. Running `deno test` performs basic tests, while the second command generates a detailed coverage report. ```shell deno test ``` ```shell deno test --coverage && deno coverage ./coverage --html ``` -------------------------------- ### Package Vipps Mobilepay SDK for NPM Source: https://github.com/vippsas/deno-sdk/blob/main/README.md This command is used to package and publish the latest tagged version of the Vipps Mobilepay SDK to NPM. It executes a Deno script responsible for the publishing process. ```shell deno run -A scripts/publish_latest_tag_to_npm.ts ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.