npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pabgw/vue

v1.1.0

Published

PAB Gateway Payment Form — Vue 3 component

Downloads

166

Readme

@pabgw/vue

Vue 3 component and composable for embedding PAB Gateway payment forms into your application.

Installation

npm install @pabgw/vue

Requirements

  • Vue 3.0+

Quick Start

<template>
  <PabPayment
    :session="sessionToken"
    @success="onSuccess"
    @error="onError"
    @expired="onExpired"
  />
</template>

<script setup>
import { PabPayment } from '@pabgw/vue';

const props = defineProps({ sessionToken: String });

function onSuccess(data) {
  console.log('Payment successful', data.transactionId);
}

function onError(data) {
  console.error('Payment failed', data.message);
}

function onExpired() {
  console.warn('Session expired');
}
</script>

Usage Modes

The component supports two modes:

Payment Link (token)

Use a pre-generated payment link token:

<PabPayment token="pl_abc123" @success="onSuccess" />

Checkout API (session)

Create a Checkout Session from your backend and pass the resulting session identifier to the session prop.

<PabPayment :session="sessionSecret" @success="onSuccess" />

Use token OR session, not both.

Create a session (api/v2/sessions)

POST https://gateway.pabgw.com/api/v2/sessions
x-api-key: <partner-api-key>
x-merchant-key: <merchant-key>
Content-Type: application/json

{
  "mode": "payment",        // or "setup"
  "amount": 100.00,
  "reference": "INV-001",
  "payerEmail": "[email protected]"
}

Response (201 Created):

{
  "result": {
    "sessionId": "…",
    "sessionToken": "Xk3r…",
    "checkoutUrl": "https://quick2pay.pabgw.com/s/Xk3r…",
    "expiresAt": "…",
    "status": 0
  },
  "success": true,
  "statusCode": 201,
  "errors": []
}

The session lives under result; errors arrive as errors: [{ "code", "message" }]. status is numeric (0 = pending).

Pass result.sessionToken to the session prop:

<PabPayment :session="response.result.sessionToken" />

Setup mode (save a payment method without charging)

Omit amount and set mode: "setup". Supply payorCompanyId to attach the saved method to an existing customer.

{ "mode": "setup", "payorCompanyId": "<customer-guid>" }

Component Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | token | string | — | Payment link token | | session | string | — | Checkout API session token | | method | string | — | Pre-select payment method: 'cc' or 'ach' | | environment | 'production' \| 'sandbox' | 'production' | Loads the SDK and the payment form from the production or the sandbox hosts. Use 'sandbox' with a sandbox session or payment link |

Events

| Event | Payload | Description | |-------|---------|-------------| | ready | any | Payment form has loaded and is ready | | success | { transactionId, amount, authCode, feeAmount?, totalCharged?, lastDigits? } | Payment completed successfully | | error | { code, message } | Payment failed. code is not a fixed, enumerated list — branch on message for display. | | processing | — | Payment is being processed | | feesCalculated | { amount, feeAmount, totalAmount } | Fees have been calculated | | expired | — | Session has expired (Checkout API only) |

Composable (Programmatic)

For more control, use the usePabPayment composable:

<template>
  <div ref="containerRef" />
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { usePabPayment } from '@pabgw/vue';

const containerRef = ref(null);
const { mount, destroy } = usePabPayment();

onMounted(async () => {
  const pab = await mount({
    session: 'YOUR_SESSION_TOKEN',
    container: containerRef.value,
  });

  pab.on('success', (data) => console.log('Paid!', data));
  pab.mount();
});
</script>

Content Security Policy (CSP)

If your site uses a Content Security Policy header, add the directives for whichever environment you use:

# production (default)
frame-src https://pay.pabgw.com; script-src https://cdn.pabgw.com;

# sandbox
frame-src https://pay.dev-pabgw.com; script-src https://cdn.dev-pabgw.com;

With environment="sandbox" the component loads from the sandbox hosts instead, so add them while testing:

frame-src https://pay.dev-pabgw.com; script-src https://cdn.dev-pabgw.com;

Changelog

1.1.0

  • PabPayment is now part of the package (1.0.0 shipped without it, so importing the package failed).
  • Loads the SDK from cdn.pabgw.com.
  • New environment prop (production / sandbox).

License

MIT