生成支付二维码的正确字符串

问题描述 投票:0回答:1

我有用于生成二维码的 PHP 库,现在我正在尝试为 PHP 二维码生成器提供正确的字符串,以便在使用智能手机银行应用程序扫描时,它可以正确地将二维码图像解密为真实且可用的结果。

我用不同的字符串做了一些测试,例如:

iban=SOME-IBAN-NUMB ER-HERE, currency=EUR, amount=100, comment="Some test string here"

...或:

iban:SOME-IBAN-NUMB ER-HERE, currency:EUR, amount:100, comment:"Some test string here"

...还有:

iban SOME-IBAN-NUMB ER-HERE, currency EUR, amount 100, comment "Some test string here"

...但这些似乎都不是正确的方法,因为银行应用程序总是告诉我代码是错误的。

因此,在我看来,它不能像你在做一些“普通”二维码时那样完成,就像让我们说:“嗨,我是Bobo。这是我的网页的链接:www.some-webpage。商业”。如果您使用普通的二维码扫描仪扫描它,它会正确地描述它,正如您在此处看到的那样。但对于支付二维码,可能需要一些命名和其他内容(只是根据我尝试使其工作时得到的结果猜测:到目前为止还没有工作)。

在我看来,当我们处理支付二维码时,需要对此类字符串进行准确的命名和格式化。

那么有谁知道生成银行转账付款二维码的正确字符串是什么,至少包含 iban、货币、金额、评论部分?

php qr-code
1个回答
0
投票

为了生成与智能手机银行应用程序兼容的银行转账二维码,格式需要遵循特定的标准。 EPC QR 码格式是一种广泛使用的标准,用于欧洲的 SEPA(单一欧元支付区)支付。这种 QR 码的正确格式如下:

BCD
001
1
SCT
BIC
IBAN
Name
Amount
Purpose
Remittance Information

以下是遵循此格式的示例:

$version = "BCD";
$serviceTag = "SCT";
$characterSet = "1";
$versionNumber = "001";
$bic = "ABNANL2A"; // Replace with the actual BIC
$iban = "NL91ABNA0417164300"; // Replace with the actual IBAN
$name = "John Doe"; // Replace with the actual recipient's name
$amount = "EUR100.00"; // Replace with the actual amount
$purpose = "INV"; // Optional, can be left empty or replaced with the actual purpose code
$remittanceInformation = "Invoice 12345"; // Optional, can be left empty or replaced with the actual remittance info

$qrString = "$version\n$versionNumber\n$characterSet\n$serviceTag\n$bic\n$iban\n$name\n$amount\n$purpose\n$remittanceInformation";

我希望这有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.