Bank Al Bilad SMS Parser
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.isDeductionmessage// true or false BankAlBiladSMSParser.getCardTypemessage// "credit_card", or null if not parse-able ("debit_card" for debit) BankAlBiladSMSParser.getLast4CardDigitsmessage// "1234" or null if not parse-able BankAlBiladSMSParser.getAmountmessage// "12.00" or null if not parse-able BankAlBiladSMSParser.getPayeemessage// "Some merchant I paid with a credit card" null if not parse-able BankAlBiladSMSParser.getDatemessage// A JS Date object in the UTC time zone or null if not parse-able