* other currency support should work now
This commit is contained in:
parent
b8e12d9781
commit
d73a24b1d6
@ -22,7 +22,7 @@ class KoinService
|
|||||||
* 4 - currency
|
* 4 - currency
|
||||||
* 5 - pos info
|
* 5 - pos info
|
||||||
*/
|
*/
|
||||||
const OTP_SMS_PATTERN = '#([0-9]{6}) ([0-9]{1,2}:[0-9]{1,2}) K[áà]rty[áà]s v[áà]s[áà]rl[áà]s/z[áà]rol[áà]s: -([0-9.]+) ([A-Z]{2,3}); (.*?); K[áà]rtyasz[áà]m: ...[0-9]{4}; Egyenleg: \+[0-9.]+ HUF - OTPdirekt#msiu';
|
const OTP_SMS_PATTERN = '#([0-9]{6}) ([0-9]{1,2}:[0-9]{1,2}) K[áà]rty[áà]s v[áà]s[áà]rl[áà]s/z[áà]rol[áà]s: -([0-9,.]+) ([A-Z]{2,3}); (.*?); K[áà]rtyasz[áà]m: ...[0-9]{4}; Egyenleg: \+[0-9.]+ HUF - OTPdirekt#msiu';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
@ -76,7 +76,7 @@ class KoinService
|
|||||||
$datePart = implode("-", sscanf($otpMatches[1], '%2c%2c%2c'));
|
$datePart = implode("-", sscanf($otpMatches[1], '%2c%2c%2c'));
|
||||||
|
|
||||||
$this->saveTransaction(
|
$this->saveTransaction(
|
||||||
intval(str_replace(".", "", $otpMatches[3])),
|
str_replace(",", ".", str_replace(".", "", $otpMatches[3])),
|
||||||
$otpMatches[4],
|
$otpMatches[4],
|
||||||
"20${datePart}",
|
"20${datePart}",
|
||||||
$this->getExpenseCategory($otpMatches[5]),
|
$this->getExpenseCategory($otpMatches[5]),
|
||||||
@ -223,14 +223,14 @@ class KoinService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $amount
|
* @param string $amount
|
||||||
* @param string $currency
|
* @param string $currency
|
||||||
* @param string $date
|
* @param string $date
|
||||||
* @param string $category
|
* @param string $category
|
||||||
* @param array $tags
|
* @param array $tags
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function saveTransaction(int $amount,
|
public function saveTransaction(string $amount,
|
||||||
string $currency = 'HUF',
|
string $currency = 'HUF',
|
||||||
string $date,
|
string $date,
|
||||||
string $category,
|
string $category,
|
||||||
@ -323,14 +323,14 @@ class KoinService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $amount
|
* @param string $amount
|
||||||
* @param string $currency
|
* @param string $currency
|
||||||
* @param string $date
|
* @param string $date
|
||||||
* @param string $category
|
* @param string $category
|
||||||
* @param string $tags
|
* @param string $tags
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
private function postData(int $amount, string $currency = 'HUF', string $date, string $category, string $tags): int
|
private function postData(string $amount, string $currency = 'HUF', string $date, string $category, string $tags): int
|
||||||
{
|
{
|
||||||
$saveResponse = $this->httpClient
|
$saveResponse = $this->httpClient
|
||||||
->post(self::BASE_URI . "/main/save-transaction", [
|
->post(self::BASE_URI . "/main/save-transaction", [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user