diff --git a/lib/PromptPayQR.php b/lib/PromptPayQR.php index 7f9f6b8..61d55f0 100644 --- a/lib/PromptPayQR.php +++ b/lib/PromptPayQR.php @@ -23,17 +23,21 @@ public function generate($file=false) { // format [Fee][Length][Data] $data = '000201'; // Start - $data .= '010211'; // accept recycle + $data .= '010211'; // Multiple-use QR Data // merchant account information $merchantInfo = '0016A000000677010111'; // application ID // PromptPay ID - $merchantInfo .= '01'; if (strlen($this->id) == 13) { // ID card + $merchantInfo .= '01'; $merchantInfo .= '1500' . $this->id; - } else if (strlen($this->id) == 10) { + } else if (strlen($this->id) == 10) { // Mobile number + $merchantInfo .= '01'; $merchantInfo .= '130066' . substr($this->id, -9); + } else if (strlen($this->id) == 15) { // E Wallet + $merchantInfo .= '03'; + $merchantInfo .= '15' . $this->id; } else { return false; } @@ -78,4 +82,4 @@ private function crc16($data) { } return $crc; } -} \ No newline at end of file +}