Documentation

Welcome to the WhiskyPay documentation. This guide will help you integrate our crypto payment system into your application with step-by-step instructions.

1. Getting Started

Before you begin integrating WhiskyPay, ensure you have:

  • Created a WhiskyPay account on our dashboard
  • Registered your SaaS application
  • Obtained your unique SaaS ID
  • Set up your merchant wallet with USDC

Important: Your merchant wallet must have at least a small amount of USDC already in it for transactions to work properly.

2. Installation

Install the WhiskyPay SDK via npm or yarn:

npm install @whisky-pay/whisky-pay-sdk
yarn add @whisky-pay/whisky-pay-sdk

3. Integration

Import and initialize the WhiskyPay SDK in your application:

import { WhiskyPaySDK } from '@whisky-pay/whisky-pay-sdk';

// Initialize the SDK with your SaaS ID
const whiskyPay = new WhiskyPaySDK({
  saasId: 'your_saas_id',
  environment: 'production' // or 'test'
});

// Create a payment session
const createPayment = async () => {
  try {
    const session = await whiskyPay.createSession({
      amount: 10.99,
      currency: 'USDC',
      customerEmail: 'customer@example.com',
      metadata: {
        orderId: '12345',
        productName: 'Premium Subscription'
      }
    });
    
    // Open the payment modal
    whiskyPay.openPaymentModal(session.id);
  } catch (error) {
    console.error('Payment session creation failed:', error);
  }
}

4. Configuration

Configure the SDK with these options:

OptionTypeDescriptionRequired
saasIdStringYour unique SaaS identifierYes
environmentString'production' or 'test'No (defaults to 'test')
onSuccessFunctionCallback function on successful paymentNo
onCancelFunctionCallback function when user cancels paymentNo
onErrorFunctionCallback function when payment encounters an errorNo

5. Webhooks

Configure webhooks in your dashboard to receive real-time payment notifications:

  1. Log in to your WhiskyPay dashboard
  2. Navigate to the "Create Saas" section
  3. Add your callback URL to receive webhook events
  4. Set up email notifications if desired

Webhook events include:

  • payment.succeeded - When a payment is successfully completed
  • payment.failed - When a payment attempt fails
  • payment.refunded - When a payment is refunded

6. Testing

Test your integration thoroughly before going live:

Test Environment

Set environment: 'test' in your SDK configuration to use the test environment.

In test mode, you can use any USDC-compatible wallet to simulate payments without real transactions.

7. Going Live

When you're ready to accept real payments:

  1. Set environment: 'production' in your SDK configuration
  2. Ensure your merchant wallet has sufficient USDC balance
  3. Verify your webhook endpoints are properly configured
  4. Test a real transaction with a minimal amount

Best Practice: Start with small transactions and gradually scale up as you confirm everything is working correctly.

8. API Reference

The SDK provides these key methods:

createSession(options)

Creates a new payment session with the specified options.

Parameters:

  • amount (Number, required): The payment amount
  • currency (String, required): Currently only 'USDC' is supported
  • customerEmail (String, optional): Customer's email for receipts
  • metadata (Object, optional): Any additional data for tracking

Returns: A Promise that resolves to a session object

openPaymentModal(sessionId)

Opens the payment modal for the given session.

Parameters:

  • sessionId (String, required): The ID of the payment session

verifyPayment(sessionId)

Checks the status of a payment session.

Parameters:

  • sessionId (String, required): The ID of the payment session

Returns: A Promise that resolves to the payment status

9. FAQs

How secure are WhiskyPay transactions?

WhiskyPay transactions are secured by the Solana blockchain. We never have custody of customer funds - payments go directly from the customer's wallet to your merchant wallet.

What cryptocurrencies do you support?

Currently, we only support USDC on the Solana blockchain. We plan to add support for more cryptocurrencies in the future.

Do I need to have crypto experience to use WhiskyPay?

No, our SDK is designed to be simple and straightforward, even for developers without crypto experience. You just need to ensure your merchant wallet has some USDC balance.

How do I handle refunds?

Currently, refunds need to be processed manually from your merchant wallet. We're working on adding automated refund functionality in a future release.

What fees does WhiskyPay charge?

During our proof of concept phase, WhiskyPay does not charge any processing fees beyond the standard Solana network fees, which are typically a fraction of a cent per transaction.

Need More Help?

If you have questions or need assistance with your integration, our team is here to help.