dev-master
9999999-devGoogleWalletDigitalGoods is a PHP library that helps you to use google wallet.
MIT
The Requires
- php >=5.3.3
google wallet goods
Wallogit.com
2017 © Pedro Peláez
GoogleWalletDigitalGoods is a PHP library that helps you to use google wallet.
A PHP library for interacting with Google Wallet for Digital Goods ., (*1)
GoogleWalletDigitalGoods can be installed with Composer (http://getcomposer.org/). Add the following to your composer.json file. Composer will handle the autoloading., (*2)
{
"require": {
"kesar/googlewalletdigitalgoods": "dev-master"
}
}
use \GoogleWalletDigitalGoods\SellerInfo;
use \GoogleWalletDigitalGoods\Payload;
use \GoogleWalletDigitalGoods\JWT;
$payload = new Payload();
$payload->setIssuedAt(time());
$payload->setExpiration(time() + 3600);
$payload->addProperty("name", "Piece of Cake");
$payload->addProperty(
"description",
"Virtual chocolate cake to fill your virtual tummy"
);
$payload->addProperty("price", "10.50");
$payload->addProperty("currencyCode", "USD");
$payload->addProperty(
"sellerData",
"user_id:1224245,offer_code:3098576987,affiliate:aksdfbovu9j"
);
// Creating payload of the product.
$Token = $payload->createPayload(SellerInfo::$issuerId);
// Encoding payload into JWT format.
$jwtToken = JWT::encode($Token, SellerInfo::$secretKey);
To test the library itself, run the PHPUnit tests:, (*3)
phpunit --configuration phpunit.xml.dist
GoogleWalletDigitalGoods is a PHP library that helps you to use google wallet.
MIT
google wallet goods