Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2022-08-10 (1 month ago) | | Not yet rated by the users | | Total: 53 This week: 13 | | All time: 10,279 This week: 9 |
|
Description | | Author |
This class can add a simple payment URL to monetize site pages.
It takes a payment pointer URL for a Web page and validates it to comply with the W3C Web monetization specification.
The class can generate HTML for a meta tag to include on a Web page and specify what payment system users of a site can use to pay for the producers of the page content. Innovation Award
August 2022
Nominee
Vote |
Web monetization is a specification elaborated by the W3C organization to define how each site would like to monetize the site pages to reward the creators by letting know to the users of the page how to pay for the benefits that the page provides them.
This package provides a means to add HTML tags to a page to specify a payment system that the page users can use to pay the creators of a page according to Web monetization W3C standard specification.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 3x |
|
Details
php-monetization
Introduction
-
This is a PHP for Web Monetization helper.
Features
Here are some features about Web Monetization:
-
Validate payment pointer URL.
-
Generate payment pointer URL with given arguments.
-
Generate payment pointer URL with meta tag.
-
Get default payment pointer URL.
Installation
We strongly recoomend using composer
to install this package.
The installation steps are as follows:
composer require lee/php-monetization:^1.0
Usage
It's very simple. Here are some usages:
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Lee\WebMonetization\WebMonetization;
// Generate payment pointer URL with meta tag
$paymentPointerUrl = '$ilp.uphold.com/alice';
$metaTag = WebMonetization::generateMetaTag($paymentPointerUrl);
echo $metaTag; // <meta name="monetization" content="$ilp.uphold.com/alice">
// Validate payment pointer URL
$validateResult = WebMonetization::validatePaymentPointer($paymentPointerUrl);
echo $validateResult; // true
// Generate payment pointer
$interLedger = 'ilp';
$domainName = 'uphold';
$tldName = 'com';
$userTokenName = 'alice';
$paymentPointerUrl = WebMonetization::generatePaymentPointer($interLedger, $domainName, $tldName, $userTokenName);
echo $paymentPointerUrl; // $ilp.uphold.com/alice
// Get default payment pointer urls
$webMonetization = new WebMonetization();
$paymentPointerUrls = $webMonetization->getDefaultPaymentPointerUrls();
echo $paymentPointerUrls; // [ '$ilp.uphold.com/', '$ilp.gatehub.net/', '$pay.stronghold.co/',]
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.