JSPM

status-converter

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q33975F
  • License ISC

converts 'failed' and 'completed' statuses to 'declined' and 'approved', replaces transaction messages with above conversions

Package Exports

  • status-converter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (status-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Netki Status Converter

https://www.npmjs.com/package/status-converter

Install

npm install --save status-converter

Information

Convert.convertStatus(status) : converts status to 'failed' or 'completed' to 'declined' or 'approved', otherwise it will return the original status.

Convert.convertTransactionMessage(message) : replaces any 'failed' or 'completed' statuses in the transaction message with 'DECLINED' or 'APPROVED'.

Example Use Cases

import Convert from 'status-converter';

Convert.convertStatus('failed') // => converts 'failed' to 'declined'

Convert.convertStatus('completed') // => converts 'completed' to 'approved'

Convert.convertTransactionMessage('transaction changed to failed status' ) // => 'transaction changed to DECLINED status'

Convert.convertTransactionMessage('transaction changed to completed status' ) // => 'transaction changed to APPROVED status'