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

ngx-hyperpay

v1.2.1

Published

Angular library for HyperPay payment gateway integration

Downloads

78

Readme

NGX-Hyperpay

An Angular library for easy integration of the HyperPay payment gateway. This library provides a component that wraps the HyperPay COPYandPAY integration, making it simple to add a payment form to your Angular application.

Installation

Install the package from npm:

npm install ngx-hyperpay

Backend Integration Required

Security Note: Do NOT perform sensitive operations (like generating checkout IDs or querying payment status with authorization tokens) on the client-side.

  1. Generate Checkout ID: Call your backend API to Request a checkoutId from HyperPay using your secret entityId and authorization token.
  2. Pass to Component: Pass the received checkoutId to the ngx-hyperpay component.
  3. Handle Callback: When the payment is complete, HyperPay redirects to your shopperResultUrl. The component will emit the resourcePath (or id).
  4. Verify Payment: Send this resourcePath to your backend. Your backend should then query HyperPay's status API using this path to confirm the payment validity and status.

Usage

  1. Import the NgxHyperpayComponent in your component or module:
import { NgxHyperpayComponent } from 'ngx-hyperpay';

@Component({
  selector: 'app-my-component',
  standalone: true,
  imports: [NgxHyperpayComponent],
  template: `
    <ngx-hyperpay
      [checkoutId]="checkoutId"
      [brands]="'VISA MASTER MADA'"
      [mode]="'test'"
      [shopperResultUrl]="'https://your-domain.com/callback'" 
      [redirectUrl]="'https://your-domain.com/home'"
      (onSuccess)="onPaymentSuccess($event)"
      (onFailure)="onPaymentFailure($event)"
      (onCancel)="onPaymentCancel($event)"
      (onError)="onPaymentError($event)"
    ></ngx-hyperpay>
  `
})
export class MyComponent {
  checkoutId = 'YOUR_CHECKOUT_ID'; // Obtain this from your server

  onPaymentSuccess(data: any) {
    console.log('Payment successful:', data);
  }

  onPaymentFailure(data: any) {
    console.log('Payment failed:', data);
  }

  onPaymentCancel(data: any) {
    console.log('Payment cancelled:', data);
  }

  onPaymentError(error: any) {
    console.error('An error occurred:', error);
  }
}

API

Inputs

| Input | Type | Default | Description | | --------------- | --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------- | | checkoutId | string | Required | The checkout ID obtained from your server-side integration with HyperPay. | | brands | string | 'VISA MASTER MADA' | A space-separated list of payment brands to display (e.g., 'VISA MASTER AMEX'). | | mode | 'test' | 'live' | 'test' | The mode for the HyperPay script. Use 'test' for development and 'live' for production. | | style | 'card' | 'plain' | 'card' | The visual style of the payment form. | | locale | 'en' | 'ar' | 'en' | The language of the payment widget. | | shopperResultUrl| string | '' | The custom callback URL to redirect to after payment. Overrides redirectUrl and default behavior. | | redirectUrl | string | '' | The URL to redirect to after the payment. Defaults to the current URL. |

Outputs

| Output | EventEmitter<any> | Description | | ----------- | ---------------------- | ------------------------------------------------------ | | onReady | void | Emitted when the HyperPay widget is ready. | | onSuccess | any | Emitted when the payment is successful. | | onFailure | any | Emitted when the payment fails. | | onCancel | any | Emitted when the user cancels the payment. | | onError | any | Emitted when an error occurs (e.g., script fails to load). | | getResourcePath| string | Emitted when resourcePath query parameter is found (decoded). | | getRawResourcePath| string | Emitted when resourcePath query parameter is found (raw encoded). | | getId | string | Emitted when id query parameter is found (decoded). | | getRawId | string | Emitted when id query parameter is found (raw encoded). |

Development

This library was generated with Angular CLI.

Build

Run ng build ngx-hyperpay to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build ngx-hyperpay, go to the dist folder cd dist/ngx-hyperpay and run npm publish.

Repository

The source code is available on GitLab.