0.1.1 • Published 1 year ago

ngx-tingg v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ngx-tingg

An Angular library that abstracts the complexity of using Cellulant's Tingg APIs.

*This is still a work in progress

Documentation

API reference: Documentation

Features

  • Gracefully handle errors
  • Post a charge request

Run on your Project

Install the project

  npm i ngx-tingg

Install dependencies

  ng add @angular/material

On your app.module.ts or the component to be used, import the following:

  import { NgxTinggModule } from 'ngx-tingg';

  @NgModule({
  declarations: [
    MyComponent
  ],
  imports: [
    BrowserModule,

    //import this
    NgxTinggModule.forRoot(
      grant_type: string,
      client_id: string,
      client_secret: string,
      apikey: string,
      isProduction: boolean
    )
  ],

Finally on your HTML file,

  <tingg-charge-request></tingg-charge-request>

A payment form will be loaded on your view.

Run your app

  ng serve

API Reference

ParameterTypeDescription
@Input(): country_code = KENstringCountry code
@Input(): currency_code = KESstringCurrency code
@Input(): service_code = undefinedstringService code
@Input(): merchant_transaction_id = randomstringMerchant ID code
@Input(): charge_amount = undefinednumberAmount
@Input(): charge_msisdn = undefinednumberPhone number
@Input(): payment_mode_code = STK_PUSHstringPayment mode code
@Input(): payment_option_code = SAFKEstringPayment payment_option_code code

Example

  <tingg-charge-request [country_code]="'KEN'" [currency_code]="'KES'" [service_code]="'111'" [merchant_transaction_id]="'11'"></tingg-charge-request>

Running Tests

To run tests, run the following command

  ng e2e
0.1.1

1 year ago

0.1.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago