I use the PCRE (Per Compatibility Regular Expression) to validate specific payment pointer URL on PHP.
And it can call WebMonetization::validatePaymentPointer to complete above specifictaion.
I create configuration array wit PHP to define a default payment pointer URL prefix lists.
These lists are as follows:
$ilp.uphold.com/
$ilp.gatehub.net/
$pay.stronghold.co/
It can call WebMonetization::getDefaultPaymentPointerUrls method to complete above specification.
To crate completed payment pointer URL string easily, I also create a method named WebMonetization::generatePaymentPointer to complete above specification.
To create payment pointer URL with meta tag string easily, I also create a method named WebMonetization::generateMetaTag to complete this specification.
To make all of static methods verified and reliable, I also develop unit tests with PHPUnit to complete above specifications.
All of unit tests are available on WebMonetizationTest class.
To make sure all of above static methods are verified and reliable, I also integrate the GitHub Action Workflows to complete this issue about do automatic PHPUnit tests for every incoming commits.
The latest GitHub Action Workflows status is available here.
Additional Resources/Info
Here are some useful resources and info to help me to complete this simple and useful PHP packages:
The payment pointer URL specification and description is available here. And it can help me to know more details about generating payment pointer URL :).
To complete all of static methods I develop on WebMonetization class reliably, I also want to say thanks for PHPUnit to help me to complete all related static methods with unit tests.