1.0.2 • Published 6 years ago

bank-al-bilad-sms-parser v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Bank Al Bilad SMS Parser

npm.io npm.io

This library parses SMS messages sent from (Bank Al Bilad)https://bankalbilad.com which look like this for credit card transactions

شراء عبر نقاط البيع
بطاقة: **1234;الإئتمانية
لدى: Some merchant I paid with a credit card
دولة: السعودية
مبلغ: 12.00 SAR
رصيد: 1234.56 SAR
في: 2019-05-07 23:44

and like this for debit card transactions

مشتريات نقاط البيع
بطاقة: **4567;مدى
من: xx005
مبلغ: 34.00 SAR
لدى: Some restaurant I paid with a credit card
دولة: السعودية
في: 2019/05/07 01:29

You can use this library to parse specific parts from the message body.

Examples

// Assuming that `message` is the credit card message above.

BankAlBiladSMSParser.isDeduction(message)
// true or false

BankAlBiladSMSParser.getCardType(message)
// "credit_card", or null if not parse-able ("debit_card" for debit)

BankAlBiladSMSParser.getLast4CardDigits(message)
// "1234" or null if not parse-able

BankAlBiladSMSParser.getAmount(message)
// "12.00" or null if not parse-able

BankAlBiladSMSParser.getPayee(message)
// "Some merchant I paid with a credit card" null if not parse-able

BankAlBiladSMSParser.getDate(message)
// A JS Date object in the UTC time zone or null if not parse-able
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago