lee / php-green-button
A Green Button Library for PHP
v0.1
2020-08-20 08:44 UTC
Requires
- php: ^7.2
- ext-simplexml: *
- ext-xmlwriter: *
- nesbot/carbon: ^2.38
- ramsey/uuid: ^4.1
Requires (Dev)
- ext-xmlreader: *
- overtrue/phplint: ^1.1
- phpstan/phpstan: *
- phpunit/phpunit: ^8
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-10-20 17:58:13 UTC
README
A Green Button Generator for PHP.
Requirements
- PHP 7.2+
Installation
composer require lee/php-green-button
Usage
Using following codes to generate a customer agreement information XML:
<?php use Carbon\Carbon; use Lee\Green\Button\CustomerDataWriter; $dateTimeString = Carbon::now(self::$timezone)->format('Y-m-d\TH:i:s\Z'); $options = [ 'title' => 'Green Button Customer Feed', 'account_id' => 'Peter', 'meter_form_number' => 'TD17234599', 'end_device_serial_number' => '99123456', ]; $customerDataWriter = new CustomerDataWriter($options); $customerDataWriter->setPublishedDateTime($dateTimeString); $customerDataWriter->setUpdatedDateTime($dateTimeString); $result = $customerDataWriter->createCustomerAccountData();
Similar libraries
License
The MIT License (MIT). Please see License File for more information.