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

chamsswitch-sdk

v0.0.10

Published

> Chamsswitch's official angular package to seamlessly integrate the payment sdk to recieve payments.

Readme

CHAMSSWITCH PAYMENT SDK

Chamsswitch's official angular package to seamlessly integrate the payment sdk to recieve payments.

INSTALLATION

Firstly, you need to create a Chamsswitch Merchant Account account.
npm and angular2+ are required

To install the latest version of payment-chamsswitch-sdk, simply run the command:

npm i chamsswitch-sdk --save

USAGE

1. Import the module

Import the module in your app.module.ts or any module in which the component is needed, configure your issued clientId, clientSecret and integrationKey in the forRoot function like so:

...
import { ChamsswitchSdkModule } from 'chamsswitch-sdk';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ChamsswitchSdkModule.forRoot({ 
      clientId: "Ken0000004",
      clientSecret: "d36eb5dd-a89f-411a-b024-4cdc11673c11",
      integrationKey: "a6ccab0e-157d-4fb7-b15d-ddb7cd149153",
    })
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Parameters

Below is a list of the configuration supported parameters, this parameters are important, so they should be protected.

| Parameters | Data Type | Required | Description | |-----------------------|-----------|-------------|---------------------------------------------------------------------------------| | clientId | string | yes | clientid is one the credentials provided to merchant after registration | | clientSecret | string | yes | clientSecret is one the credentials provided to merchant after registration | | integrationKey | string | yes | integrationKey is one the credentials provided to merchant after registration |

2. Implement the chamsswitch payment sdk in your project

The payment-chamsswitch-sdk component is used. There are two ways to configure the component.

1. The minimum compulsory parameter you can supply to the payment sdk in order to generate a payment checkout button, use the component properties directly like so:

<payment-chamsswitch-sdk 
    [amount]="'10000'" 
    [currency]="'NGN'" 
    [email]="'[email protected]'"
    (paymentCallback)="yourCallbackFn($event)"
></payment-chamsswitch-sdk>

2. You can also supply more optional parameters like so:

<payment-chamsswitch-sdk 
    [amount]="'10000'" 
    [currency]="'NGN'" 
    [email]="'[email protected]'"
    [merchantRef]="'xxxxxxxxxxx'"
    [narration]="'xxxxxxxxxxxxxxxxxxxxxxx'"
    [callBackUrl]="'(https|http)://xxxxx.xxx.xxx/'"
    [lastName]="'Doe'"
    [firstName]="'John'"
    [customerId]="'xxxxxxxxx'"
    [phone]="'xxxxxxxxxxxx'"
    (paymentCallback)="yourCallbackFn($event)"
></payment-chamsswitch-sdk>

Note:

  • merchantRef is the merchant unique transaction reference to recognize each transaction on our server.
  • amount Amount to be debited from customer.

The event paymentCallback is raised after a transaction is completed. You can get the result of a transaction from the event handler assigned to it. A sample event handler will be like so:

  yourCallbackFn(event: any){
    console.log('received data: ', event);
  }

Parameters

Below is a list of the supported parameters to show up the payment sdk checkout button.

| Parameters | Data Type | Required | Description | |-----------------------|-----------|-------------|-----------------------------------------------------------------------------------| | amount | number | yes | Amount to be debited from customer. | | currency | string | yes | The currency code eg NGN. | | email | string | yes | The paying customer email address. | | merchantRef | string | no | The merchant ref is unique ref the merchant generate for each transaction. | | narration | string | no | Reason for the transaction. | | callBackUrl | string | no | This is the merchant specified destination link after payment is processed. | | customerId | string | no | The paying customer's ID. | | lastName | string | no | The paying customer's last name. | | firstName | string | no | The paying customer first name. | | email | string | no | The paying customer email address. | | paymentCallback | string | yes | The callback function that will inject the transaction details into your function.|

After a successful transaction, you will get a sample response like so and this response will be injected into your callback function supplied to the paymentCallback like so:

{
  "type": "successful",
  "message": {
    "merchantCode": "Ken0000004",
    "paymentReference": "7ff00bdf9150495e8d8f46484859efa9",
    "merchantReference": "65472029240600570",
    "amountCollected": 38300,
    "amount": 38300,
    "callBackUrl": "https://your_callback_url.com/?advicereference=de0d33f9-e697-4c0c-8dc8-ceaa24e832fb&paymentreference=7ff00bdf9150495e8d8f46484859efa9",
    "processorCode": "00",
    "transactionStatus": "Successful",
    "currencyCode": "NGN",
    "accountNumber": "95782a0826b00e0917f40deadb36f7142fcfd520162780b3513441c5b6e440d6",
    "accountNumberMasked": "5200*****0007",
    "narration": "",
    "env": "Test",
    "message": "Successful",
    "returnUrl": "https://api.pelpay.ng/payment/card/webhook?advicereference=de0d33f9-e697-4c0c-8dc8-ceaa24e832fb&paymentreference=7ff00bdf9150495e8d8f46484859efa9",
    "customerName": "Samuel John",
    "paymentDate": "2023-09-11T23:52:04.809021+01:00",
    "orgId": "1snn5n9w"
  }
}

NOTE: The key type gives the final status of the transaction.
There are quite a number of response codes that can be returned, the full list can be viewed here

- Handling the Response

For integrity purpose, you are advised to make a server side request to get the final status of a transaction before giving value. To do this, make a GET request to the endpoint below with the paymentReference field from the event you got in your callbackfn:

Test mode:

https://api.pelpay.ng/api/Transaction/bypaymentreference/{paymentReference}

TEST CARDS

| Type | Card Number | Expiry Date | Pin | CVV | OTP | |---------------|-------------------|-------------|---------|-------|-------| | Master Card | 5200000000000007 | 12/50 | 1111 | 111 | 1234 |

License

The MIT License (MIT). Please see License File for more information.