🌿 VirdisPay Widget Examples

Professional crypto payment integration for your website

1. Basic Integration

Add VirdisPay to your website with just a few lines of code.

HTML Integration

<!-- Include VirdisPay Widget -->
<script src="https://widgets.virdispay.com/virdispay-widget.js"></script>

<!-- Add payment button -->
<button data-virdispay-widget="button"
        data-merchant-id="your_merchant_id"
        data-amount="99.99"
        data-currency="USD"
        data-description="Premium CBD Oil"
        data-theme="green">
  Pay with Crypto
</button>

JavaScript Integration

<script>
  // Initialize VirdisPay widget
  const widget = VirdisPay.init({
    type: 'button',
    merchantId: 'your_merchant_id',
    amount: 99.99,
    currency: 'USD',
    description: 'Premium CBD Oil',
    theme: 'green',
    onSuccess: function(payment) {
      console.log('Payment successful:', payment);
      // Redirect to success page
      window.location.href = '/success?tx=' + payment.transactionId;
    },
    onError: function(error) {
      console.error('Payment failed:', error);
      alert('Payment failed. Please try again.');
    }
  });
</script>

Live Demo

2. Widget Types

Choose from different widget types to match your website design.

Button Widget

Embedded Widget

Modal Widget

Hosted Checkout

3. Customization

Customize the appearance with different themes and sizes.

Available Themes

Button Sizes

Customizable Widget

4. E-commerce Integration

Integrate VirdisPay with popular e-commerce platforms.

WooCommerce Integration

// Add to your WooCommerce checkout
add_action('woocommerce_review_order_after_payment', 'add_virdispay_option');

function add_virdispay_option() {
    $total = WC()->cart->get_total();
    $currency = get_woocommerce_currency();
    
    echo '<div class="virdispay-checkout">';
    echo '<script src="https://widgets.virdispay.com/virdispay-widget.js"></script>';
    echo '<div data-virdispay-widget="embedded"
               data-merchant-id="' . get_option('virdispay_merchant_id') . '"
               data-amount="' . $total . '"
               data-currency="' . $currency . '"
               data-description="Order #' . WC()->session->get('order_id') . '"></div>';
    echo '</div>';
}

Shopify Integration

// Add to your Shopify checkout
<script src="https://widgets.virdispay.com/virdispay-widget.js"></script>

<script>
  document.addEventListener('DOMContentLoaded', function() {
    const checkout = Shopify.checkout;
    
    VirdisPay.init({
      type: 'embedded',
      merchantId: '{{ settings.virdispay_merchant_id }}',
      amount: checkout.total_price,
      currency: checkout.currency,
      description: 'Shopify Order #' + checkout.order_number,
      onSuccess: function(payment) {
        // Complete Shopify checkout
        window.location.href = checkout.order_status_url;
      }
    });
  });
</script>

5. Advanced API Integration

For custom implementations, use our REST API directly.

Create Payment Request

// Create payment request
const response = await fetch('https://api.virdispay.com/api/payments/create', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_api_key'
  },
  body: JSON.stringify({
    merchantId: 'your_merchant_id',
    amount: 99.99,
    currency: 'USD',
    description: 'Premium CBD Oil',
    customerEmail: 'customer@example.com',
    successUrl: 'https://yoursite.com/success',
    cancelUrl: 'https://yoursite.com/cancel'
  })
});

const paymentData = await response.json();
console.log('Payment created:', paymentData);

Check Payment Status

// Check payment status
const statusResponse = await fetch(`https://api.virdispay.com/api/payments/status/${paymentData.transactionId}`, {
  headers: {
    'Authorization': 'Bearer your_api_key'
  }
});

const statusData = await statusResponse.json();
console.log('Payment status:', statusData);

6. Key Features

🌿 Cannabis-Friendly

Designed specifically for hemp and cannabis businesses with no banking restrictions.

⚡ Ultra-Low Fees

Save up to 99.98% compared to Ethereum mainnet with smart routing.

🔒 Non-Custodial

Users keep their private keys. No custody of funds means maximum security.

🌐 Multi-Chain

Support for Polygon, Ethereum, BSC, and more networks.

📱 Mobile Optimized

Responsive design that works perfectly on all devices.

🛡️ Compliance Ready

Built-in KYC/AML features for regulatory compliance.

7. Quick Start Guide

Sign Up

Create your VirdisPay merchant account and get your merchant ID.

Include Widget

Add the VirdisPay widget script to your website.

Add Payment Button

Place payment buttons on your product pages or checkout.

Configure Callbacks

Set up success and error handling for your payment flow.

Test & Launch

Test payments in sandbox mode, then go live!