### Install Pakasir SDK with npm, pnpm, or bun Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Instructions for installing the Pakasir SDK using popular package managers like npm, pnpm, and bun. This is the first step to integrating Pakasir into your project. ```bash npm install pakasir-sdk # or pnpm add pakasir-sdk # or bun add pakasir-sdk ``` -------------------------------- ### Simulate Payment for Testing with Pakasir SDK Source: https://context7.com/zeative/pakasir-sdk/llms.txt This example demonstrates how to simulate a successful payment in a testing or sandbox environment using the Pakasir SDK. It covers creating a test payment and then simulating its completion. The `simulationPayment` function helps in testing payment flows end-to-end without actual transactions. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'my-store-sandbox', apikey: 'sk_test_abc123xyz' }); // Create a test payment const payment = await pakasir.createPayment('qris', 'TEST-ORDER-001', 50000); console.log(`Created payment: ${payment.status}`); // Output: Created payment: pending // Simulate successful payment const completed = await pakasir.simulationPayment('TEST-ORDER-001', 50000); console.log(completed.status); // Output: completed console.log(completed.completed_at); // Output: 2026-01-01T12:30:45.000Z // Test your payment flow end-to-end async function testPaymentFlow() { const orderId = `TEST-${Date.now()}`; const amount = 100000; // Step 1: Create payment const payment = await pakasir.createPayment('qris', orderId, amount); console.log('✓ Payment created'); // Step 2: Simulate payment success await new Promise(resolve => setTimeout(resolve, 2000)); // Wait 2s const result = await pakasir.simulationPayment(orderId, amount); console.log('✓ Payment simulated as completed'); // Step 3: Verify status const detail = await pakasir.detailPayment(orderId, amount); console.assert(detail.status === 'completed', 'Payment should be completed'); console.log('✓ Test passed'); } ``` -------------------------------- ### Create a payment using Pakasir SDK (TypeScript) Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md A quick start example demonstrating how to initialize the Pakasir SDK and create a payment transaction. It requires your project slug, API key, payment method, order ID, and amount. The result of the payment creation is logged to the console. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'your-slug', apikey: 'your-api-key', }); const result = await pakasir.createPayment('qris', 'your-order-id', 10000); console.log(result); ``` -------------------------------- ### Retrieve Payment Details via Pakasir API (TypeScript) Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md This example demonstrates how to fetch the current status of a payment transaction. It requires the order ID and the transaction amount to retrieve the details. ```typescript const detail = await pakasir.detailPayment('ORDER-12345', 100000); console.log(detail); ``` -------------------------------- ### Monitor Payment Status Changes with Pakasir SDK Source: https://context7.com/zeative/pakasir-sdk/llms.txt This code snippet illustrates how to monitor payment status changes in real-time using the Pakasir SDK's automatic polling feature. It utilizes the `watchPayment` function, which allows you to define callbacks for status changes and errors. The example shows how to handle payment completion and cancellation, and includes a comprehensive checkout page scenario. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Create payment first const payment = await pakasir.createPayment('qris', 'ORDER-WATCH-001', 100000); // Start watching for status changes pakasir.watchPayment('ORDER-WATCH-001', 100000, { interval: 3000, // Check every 3 seconds timeout: 600000, // Stop after 10 minutes (600,000ms) onStatusChange: (payment) => { console.log(`Payment status changed: ${payment.status}`); if (payment.status === 'completed') { console.log('Payment successful!'); console.log(`Completed at: ${payment.completed_at}`); // Fulfill order, send confirmation email, etc. fulfillOrder(payment.order_id); // Stop watching after completion pakasir.stopWatch('ORDER-WATCH-001', 100000); } else if (payment.status === 'canceled') { console.log('Payment was canceled'); pakasir.stopWatch('ORDER-WATCH-001', 100000); } }, onError: (error) => { console.error('Watch error:', error.message); // Handle network errors, API errors, etc. } }); // Later: manually stop watching if needed pakasir.stopWatch('ORDER-WATCH-001', 100000); // Complete example: Checkout page with real-time status async function checkoutWithRealTimeStatus(orderId: string, amount: number) { const payment = await pakasir.createPayment('qris', orderId, amount); // Display QR code to user displayQRCode(payment.payment_url); showStatusMessage('Waiting for payment...'); // Watch for completion pakasir.watchPayment(orderId, amount, { interval: 2000, timeout: 900000, // 15 minutes onStatusChange: (payment) => { if (payment.status === 'completed') { hideQRCode(); showSuccessMessage('Payment received! Processing your order...'); redirectToThankYouPage(); pakasir.stopWatch(orderId, amount); } }, onError: (error) => { showErrorMessage('Connection issue. Please refresh the page.'); console.error(error); } }); } ``` -------------------------------- ### Cancel Pending Payment with Pakasir SDK Source: https://context7.com/zeative/pakasir-sdk/llms.txt This snippet shows how to cancel a pending payment using the Pakasir SDK. It includes examples of successful cancellation and error handling for cases like trying to cancel a completed payment. The function `cancelPayment` takes an order ID and amount as input and returns the status of the cancellation. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Cancel a pending payment const canceled = await pakasir.cancelPayment('ORDER-2026-00123', 100000); console.log(canceled.status); // Output: canceled // Handle cancellation errors try { await pakasir.cancelPayment('ORDER-COMPLETED-001', 50000); } catch (error) { console.error(error.message); // Output: Failed to cancel payment! (cannot cancel completed payment) } // Use case: User cancels checkout async function handleCheckoutCancellation(orderId: string, amount: number) { try { const result = await pakasir.cancelPayment(orderId, amount); console.log(`Payment ${orderId} has been canceled`); return { success: true, data: result }; } catch (error) { console.error('Cancellation failed:', error); return { success: false, error: error.message }; } } ``` -------------------------------- ### Initialize Pakasir SDK with Credentials Source: https://context7.com/zeative/pakasir-sdk/llms.txt Initializes the Pakasir SDK using your project slug and API key. Ensure these credentials are valid for the SDK to function correctly. The SDK will throw an error if credentials are missing or invalid. ```typescript import { Pakasir } from 'pakasir-sdk'; // Initialize with your project slug and API key from https://app.pakasir.com/projects const pakasir = new Pakasir({ slug: 'your-project-slug', apikey: 'your-api-key-here' }); // The SDK will throw an error if credentials are missing or invalid ``` -------------------------------- ### Payment Methods and Fees Calculation with Pakasir SDK Source: https://context7.com/zeative/pakasir-sdk/llms.txt Lists available payment methods and demonstrates how to calculate the total payment amount including fees using the Pakasir SDK. This is crucial for displaying accurate costs to users before they complete a transaction. ```typescript import { Pakasir, PaymentMethod } from 'pakasir-sdk'; // Payment method types const methods: PaymentMethod[] = [ 'all', // All methods - varies by selection 'qris', // QRIS - 0.7% to 1% 'paypal', // PayPal - 1% (min Rp3,000) 'bni_va', // BNI Virtual Account - Rp3,500 'bri_va', // BRI Virtual Account - Rp3,500 'cimb_niaga_va', // CIMB Niaga VA - Rp3,500 'maybank_va', // Maybank VA - Rp3,500 'permata_va', // Permata VA - Rp3,500 'bnc_va', // BNC VA - Rp3,500 'atm_bersama_va', // ATM Bersama VA - Rp3,500 'sampoerna_va', // Sampoerna VA - Rp2,000 'artha_graha_va' // Artha Graha VA - Rp2,000 ]; const Pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Calculate fees before creating payment function calculateTotalWithFee(method: PaymentMethod, amount: number): number { const payment = Pakasir.getPaymentUrl(method, 'TEMP-ID', amount); return payment.total_payment; } // Compare payment methods const amount = 100000; console.log(`QRIS: Rp${calculateTotalWithFee('qris', amount)}`); // QRIS: Rp101010 console.log(`BNI VA: Rp${calculateTotalWithFee('bni_va', amount)}`); // BNI VA: Rp103500 console.log(`PayPal: Rp${calculateTotalWithFee('paypal', amount)}`); // PayPal: Rp103000 ``` -------------------------------- ### Create Payment Transaction via API Source: https://context7.com/zeative/pakasir-sdk/llms.txt Creates a new payment transaction for various methods like QRIS, PayPal, or bank Virtual Accounts. Requires the payment method, a unique order ID, the amount in Rupiah, and an optional redirect URL. The output includes payment details, status, and a payment URL. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Create a QRIS payment for Rp100,000 const payment = await pakasir.createPayment( 'qris', 'ORDER-2026-00123', 100000, 'https://mystore.com/payment/success' ); console.log(payment); // Output: // { // project: 'my-store', // order_id: 'ORDER-2026-00123', // amount: 100000, // fee: 1010, // status: 'pending', // total_payment: 101010, // payment_method: 'qris', // payment_number: 'ID1234567890123456', // payment_url: 'https://app.pakasir.com/pay/my-store/100000?order_id=ORDER-2026-00123&redirect=...', // redirect_url: 'https://mystore.com/payment/success', // expired_at: '2026-01-02T12:00:00.000Z', // completed_at: null // } // Create PayPal payment (min Rp10,000) const paypalPayment = await pakasir.createPayment( 'paypal', 'ORDER-PP-456', 150000, 'https://mystore.com/success' ); // Create BNI Virtual Account payment const vaPayment = await pakasir.createPayment( 'bni_va', 'ORDER-VA-789', 500000 ); ``` -------------------------------- ### Stop Payment Monitoring with Pakasir SDK Source: https://context7.com/zeative/pakasir-sdk/llms.txt Demonstrates how to manually stop watching a payment's status using the Pakasir SDK. This is useful for cleaning up watchers when a user navigates away from a checkout page or after a webhook confirms a transaction. ```typescript import { Pakasir } from 'pakasir-sdk'; const Pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Start watching pakasir.watchPayment('ORDER-001', 100000, { onStatusChange: (payment) => console.log(payment.status) }); // Stop watching manually pakasir.stopWatch('ORDER-001', 100000); // Use case: User navigates away from checkout function handlePageUnload() { // Clean up watchers when user leaves checkout page const activeOrders = ['ORDER-001', 'ORDER-002']; activeOrders.forEach(orderId => { pakasir.stopWatch(orderId, 100000); }); } window.addEventListener('beforeunload', handlePageUnload); // Use case: Stop after receiving webhook async function webhookHandler(req, res) { const { order_id, amount, status } = req.body; if (status === 'completed') { // Stop client-side polling since webhook confirmed completion pakasir.stopWatch(order_id, amount); await processOrder(order_id); } res.status(200).send('OK'); } ``` -------------------------------- ### Simulation Payment API Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Simulates a successful payment for testing purposes. This endpoint is useful for development and testing environments to verify payment workflows without actual transactions. ```APIDOC ## POST /simulation/payment ### Description Simulate a successful payment for testing purposes. ### Method POST ### Endpoint /simulation/payment ### Parameters #### Path Parameters - **order_id** (string) - Required - The ID of the order to simulate payment for. - **amount** (number) - Required - The amount of the payment to simulate. ### Request Example ```json { "order_id": "ORDER-12345", "amount": 100000 } ``` ### Response #### Success Response (200) - **payment_status** (string) - The status of the simulated payment (e.g., 'completed'). #### Response Example ```json { "payment_status": "completed" } ``` ``` -------------------------------- ### Simulate Payment Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Simulates a successful payment transaction for a given order ID and amount. This function is useful for testing payment workflows without actual financial transactions. It returns the simulated payment status. ```typescript const simulated = await pakasir.simulationPayment('ORDER-12345', 100_000); console.log(simulated); ``` -------------------------------- ### TypeScript Type Definitions for Pakasir SDK Source: https://context7.com/zeative/pakasir-sdk/llms.txt Defines the core TypeScript types used within the Pakasir SDK, including configuration, payment method, and payment payload structures. These types ensure type safety and provide autocompletion during development. ```typescript import { Pakasir, PakasirConfig, PaymentMethod, PaymentPayload } from 'pakasir-sdk'; // Configuration type const config: PakasirConfig = { slug: 'my-store', // Your project slug from Pakasir dashboard apikey: 'sk_live_...' }; // Payment response type const payment: PaymentPayload = { project: 'my-store', order_id: 'ORDER-123', amount: 100000, fee: 1010, status: 'pending', // 'pending' | 'canceled' | 'completed' total_payment: 101010, payment_method: 'qris', payment_number: 'ID1234567890123456', payment_url: 'https://app.pakasir.com/pay/...', redirect_url: 'https://mystore.com/success', expired_at: '2026-01-02T12:00:00.000Z', completed_at: null }; // Type-safe payment method selection function createPaymentWithMethod(method: PaymentMethod) { const Pakasir = new Pakasir(config); return Pakasir.createPayment(method, 'ORDER-001', 100000); } // Type guards for status checking function isPaymentCompleted(payment: PaymentPayload): boolean { return payment.status === 'completed'; } function isPaymentPending(payment: PaymentPayload): boolean { return payment.status === 'pending'; } ``` -------------------------------- ### Create Payment Transaction via Pakasir API (TypeScript) Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md This snippet shows how to create a new payment transaction using the Pakasir SDK. It takes the payment method, a unique order ID, the transaction amount, and an optional redirect URL. The function returns details of the created payment. ```typescript const payment = await pakasir.createPayment('qris', 'ORDER-12345', 100000, 'https://example.com/success'); console.log(payment); ``` -------------------------------- ### Generate Payment URL for Client-Side Redirects Source: https://context7.com/zeative/pakasir-sdk/llms.txt Generates a payment URL directly for client-side redirects without making an API call to the server. This method is useful for immediate user redirection. It also provides local fee and total payment calculations. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Generate URL only (no API call made) const paymentInfo = pakasir.getPaymentUrl( 'qris', 'ORDER-CLIENT-001', 75000, 'https://mystore.com/success' ); console.log(paymentInfo.payment_url); // Output: https://app.pakasir.com/pay/my-store/75000?order_id=ORDER-CLIENT-001&redirect=https://mystore.com/success&qris_only=1 // Redirect user directly in browser window.location.href = paymentInfo.payment_url; // Calculate fees locally console.log(`Fee: Rp${paymentInfo.fee}`); console.log(`Total: Rp${paymentInfo.total_payment}`); // Output: // Fee: Rp835 // Total: Rp75835 // Generate URL for all payment methods selector const allMethods = pakasir.getPaymentUrl('all', 'ORDER-002', 50000); // User can choose QRIS, PayPal, or Virtual Account on payment page ``` -------------------------------- ### Monitor Payment Status Changes Source: https://context7.com/zeative/pakasir-sdk/llms.txt Provides functionality to monitor payment status changes in real-time using automatic polling. This ensures timely updates and actions based on payment status. ```APIDOC ## Monitor Payment Status Changes ### Description Watch payment status in real-time with automatic polling. ### Method GET (assumed for polling, based on SDK method usage) ### Endpoint `/payments/watch` (assumed, based on SDK method usage) ### Parameters #### Path Parameters None #### Query Parameters - **orderId** (string) - Required - The unique identifier for the order. - **amount** (number) - Required - The amount of the payment. - **options** (object) - Optional - Configuration options for watching. - **interval** (number) - Optional - The interval in milliseconds to check for status changes. Defaults to 3000ms. - **timeout** (number) - Optional - The timeout in milliseconds after which to stop watching. Defaults to 600000ms (10 minutes). - **onStatusChange** (function) - Optional - Callback function triggered when the payment status changes. Receives the payment object as an argument. - **onError** (function) - Optional - Callback function triggered on encountering an error during watching. Receives an error object as an argument. ### Request Example ```typescript // SDK usage example: pakasir.watchPayment('ORDER-WATCH-001', 100000, { interval: 3000, timeout: 600000, onStatusChange: (payment) => { console.log(`Payment status changed: ${payment.status}`); if (payment.status === 'completed') { pakasir.stopWatch('ORDER-WATCH-001', 100000); } }, onError: (error) => { console.error('Watch error:', error.message); } }); ``` ### Response #### Success Response (200) Callbacks handle status updates and errors. No direct response body for the watch operation itself. #### Response Example ```json // onStatusChange callback example: { "order_id": "ORDER-WATCH-001", "status": "completed", "completed_at": "2026-01-01T12:30:45.000Z" } ``` ### Stopping the Watcher - **stopWatch(orderId, amount)**: Manually stops the real-time watching for a specific payment. ### Request Example ```typescript // SDK usage example: pakasir.stopWatch('ORDER-WATCH-001', 100000); ``` ``` -------------------------------- ### Watch Payment API Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Monitors payment status changes in real-time using polling. This is useful for applications that need to react immediately to payment status updates. ```APIDOC ## POST /watch/payment ### Description Monitor payment status changes in real-time with polling. ### Method POST ### Endpoint /watch/payment ### Parameters #### Path Parameters - **order_id** (string) - Required - The ID of the order to watch. - **amount** (number) - Required - The amount of the payment. #### Request Body - **interval** (number) - Optional - Polling interval in milliseconds. Defaults to 3000. - **timeout** (number) - Optional - Auto-stop timeout in milliseconds. Defaults to 600000 (10 minutes). - **onStatusChange** (function) - Optional - Callback function executed when the payment status changes. Receives a PaymentPayload object. - **onError** (function) - Optional - Callback function executed when an error occurs during the watch process. Receives an Error object. ### Request Example ```json { "order_id": "ORDER-12345", "amount": 100000, "interval": 5000, "timeout": 120000, "onStatusChange": "(payment) => console.log('Status:', payment)", "onError": "(error) => console.error(error)" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message that the watch process has started. #### Response Example ```json { "message": "Payment watching started successfully." } ``` ``` -------------------------------- ### Check Payment Transaction Status and Details Source: https://context7.com/zeative/pakasir-sdk/llms.txt Retrieves the current status and detailed information for a specific payment transaction using the order ID and amount. This is crucial for verifying payment completion, especially in webhook handlers or for displaying transaction status to users. ```typescript import { Pakasir } from 'pakasir-sdk'; const pakasir = new Pakasir({ slug: 'my-store', apikey: 'sk_live_abc123xyz' }); // Check payment status const detail = await pakasir.detailPayment('ORDER-2026-00123', 100000); console.log(`Status: ${detail.status}`); // Output: Status: pending | completed | canceled console.log(detail); // Output: // { // project: 'my-store', // order_id: 'ORDER-2026-00123', // amount: 100000, // fee: 1010, // status: 'completed', // total_payment: 101010, // payment_method: 'qris', // payment_number: null, // payment_url: 'https://app.pakasir.com/pay/...', // redirect_url: 'https://mystore.com/payment/success', // expired_at: null, // completed_at: '2026-01-01T13:45:23.000Z' // } // Use in webhook handler async function handleWebhook(orderId: string, amount: number) { const payment = await pakasir.detailPayment(orderId, amount); if (payment.status === 'completed') { // Process order fulfillment await fulfillOrder(orderId); } } ``` -------------------------------- ### Generate Payment URL without API Call (TypeScript) Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md This function generates a payment URL directly, which is useful for client-side redirects without needing to make an API call. It requires the payment method, order ID, and amount. ```typescript const payment = pakasir.getPaymentUrl('qris', 'ORDER-12345', 100000); console.log(payment); ``` -------------------------------- ### Watch Payment Status Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Monitors the status of a payment in real-time using polling. It accepts an order ID, amount, and an options object for configuration. The function provides callbacks for status changes and errors. Configurable options include polling interval and timeout. ```typescript pakasir.watchPayment('ORDER-12345', 100_000, { interval: 3000, timeout: 600000, onStatusChange: (payment) => { console.log('Status:', payment); }, onError: (error) => console.error(error), }); ``` -------------------------------- ### PaymentPayload Type Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Defines the structure of the response object returned by payment-related operations. ```APIDOC ### Type: PaymentPayload Response type returned by all payment methods: ```typescript type PaymentPayload = { project: string; order_id: string; amount: number; fee: number; status: 'pending' | 'canceled' | 'completed'; total_payment: number; payment_method: string; payment_number: string | null; payment_url: string | null; redirect_url: string | null; expired_at: string | Date | null; completed_at: string | Date | null; }; ``` ``` -------------------------------- ### Stop Watch API Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Manually stops the monitoring process for a specific payment. ```APIDOC ## POST /stop/watch ### Description Manually stop watching a payment. ### Method POST ### Endpoint /stop/watch ### Parameters #### Path Parameters - **order_id** (string) - Required - The ID of the order to stop watching. - **amount** (number) - Required - The amount of the payment. ### Request Example ```json { "order_id": "ORDER-12345", "amount": 100000 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message that the watch process has been stopped. #### Response Example ```json { "message": "Payment watching stopped successfully." } ``` ``` -------------------------------- ### PaymentPayload Type Definition Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Defines the structure of the response payload returned by Pakasir's payment-related functions. This type includes details about the order, payment status, amounts, and relevant timestamps. It is crucial for handling payment information correctly. ```typescript type PaymentPayload = { project: string; order_id: string; amount: number; fee: number; status: 'pending' | 'canceled' | 'completed'; total_payment: number; payment_method: string; payment_number: string | null; payment_url: string | null; redirect_url: string | null; expired_at: string | Date | null; completed_at: string | Date | null; }; ``` -------------------------------- ### Cancel Pending Payment Source: https://context7.com/zeative/pakasir-sdk/llms.txt Allows you to cancel an existing payment that is still in a pending state. This is useful for user-initiated cancellations or correcting erroneous transactions before they are finalized. ```APIDOC ## Cancel Pending Payment ### Description Cancel an existing payment that is still pending. ### Method POST (assumed, based on SDK method usage) ### Endpoint `/payments/cancel` (assumed, based on SDK method usage) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **orderId** (string) - Required - The unique identifier for the order. - **amount** (number) - Required - The amount of the payment to be canceled. ### Request Example ```typescript // SDK usage example: await pakasir.cancelPayment('ORDER-2026-00123', 100000); ``` ### Response #### Success Response (200) - **status** (string) - Description: The status of the cancellation operation, e.g., 'canceled'. #### Response Example ```json { "status": "canceled" } ``` #### Error Handling - Throws an error if the payment cannot be canceled (e.g., already completed). ### Request Example ```typescript // SDK usage example: try { await pakasir.cancelPayment('ORDER-COMPLETED-001', 50000); } catch (error) { console.error(error.message); // Output: Failed to cancel payment! (cannot cancel completed payment) } ``` ``` -------------------------------- ### Cancel Pending Payment via Pakasir API (TypeScript) Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md This snippet shows how to cancel an existing payment transaction that is still pending. It requires the order ID and the transaction amount. ```typescript const canceled = await pakasir.cancelPayment('ORDER-12345', 100000); console.log(canceled); ``` -------------------------------- ### Stop Payment Watch Source: https://github.com/zeative/pakasir-sdk/blob/main/README.md Manually stops the real-time monitoring of a specific payment. This function requires the order ID and amount of the payment being watched. It halts any ongoing polling processes for that payment. ```typescript pakasir.stopWatch('ORDER-12345', 100_000); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.