File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -975,8 +975,14 @@ public function setLogoRequest($appearance_logo_request)
975975 );
976976 }
977977
978- public static function generateSignedCardId (string $ cid , string $ public_key_content ): string
978+ public static function generateSignedCardId (string $ cid , string $ public_key_content = null ): string
979979 {
980+ if (empty ($ public_key_content )) {
981+ $ public_key_content = file_get_contents (
982+ dirname (dirname (__FILE__ )) . "/../ECID_PUBLIC_KEY_2023.txt "
983+ );
984+ }
985+
980986 return TatraPayPlusService::generate_signed_card_id_from_cid ($ cid , $ public_key_content );
981987 }
982988
Original file line number Diff line number Diff line change @@ -168,13 +168,16 @@ private function getPaymentPayload(
168168 public function testGenerateSignedCardId (): void
169169 {
170170 $ public_key_content = file_get_contents (
171- dirname (dirname (__FILE__ )) . "/tests/ ECID_PUBLIC_KEY_2023.txt "
171+ dirname (dirname (__FILE__ )) . "/ECID_PUBLIC_KEY_2023.txt "
172172 );
173173 $ signed_card_id = TatraPayPlusAPIApi::generateSignedCardId (
174174 "123 " ,
175175 $ public_key_content
176176 );
177177 $ this ->assertTrue (is_string ($ signed_card_id ));
178+
179+ $ signed_card_id = TatraPayPlusAPIApi::generateSignedCardId ("123 " );
180+ $ this ->assertTrue (is_string ($ signed_card_id ));
178181 }
179182
180183 public function testLimitLength (): void
You can’t perform that action at this time.
0 commit comments