@pmcretail/ngx-tmc-lib
v1.0.11
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
Downloads
781
Maintainers
Keywords
Readme
NgxTmcLib
This library was generated with Angular CLI version 8.2.14.
Code scaffolding
Run ng generate component component-name --project ngx-tmc-lib to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-tmc-lib.
Note: Don't forget to add
--project ngx-tmc-libor else it will be added to the default project in yourangular.jsonfile.
Install
npm i @pmcretail/ngx-tmc-libGift Card Usage
TMC request for gift card
let tmcRequest:any = {
paymentprocessor: PAYMENT_PROCESSOR.GIFTCARD,
action: TMC_ACTION.ADD_CARD,
transactionRef: "123456",
provider : GC_PROVIDER.GIVEX,
cardNumber : "60362834875161611880",
giftCardExpiryDate:"2023-07-24",
amount: 20.00,
currencycode: "GBP",
hmacsha1: "cjkcbasjkbcaskckasnlck"
}
TMC-Lib request as per following
let request = {} as GCRequest ;
request.requestData = tmcRequest;
request.settings = {} // either GCGivexSetting or GCNetsuiteSetting portal settings
Get provider for perfoming operation
let provider:IGCProdiver = this.gcProviderFactory.getGCProvider(tmcRequest.provider)
provider.checkBalance(request).then(response => {
console.info("Response ===>",response)
}).catch(error=>{
console.info("Error ===>",error)
})
Supported operation
checkBalance(request: GCRequest): Promise<any>
activateCard(request: GCRequest): Promise<any>
doRedemption(request:GCRequest):Promise<any>
doRefund(request: GCRequest): Promise<any>
doTopup(request: GCRequest): Promise<any>
cancel(request: GCRequest): Promise<any>
Build
Run ng build ngx-tmc-lib to build the project. The build artifacts will be stored in the dist/ directory.
Publishing
After building your library with ng build ngx-tmc-lib, go to the dist folder cd dist/ngx-tmc-lib and run npm publish.
Running unit tests
Run ng test ngx-tmc-lib to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
