### Docker Compose Up Source: https://github.com/lyra/rest-php-examples/blob/master/README.md Starts the Lyra REST API example containers using Docker Compose. ```Shell docker-compose up -d ``` -------------------------------- ### Run Lyra Network REST API SDK Tests with Docker Source: https://github.com/lyra/rest-php-examples/blob/master/www/vendor/lyracom/rest-php-sdk/README.md Steps to set up and run the SDK's test suite using Docker. This involves starting Docker containers, installing dependencies, and executing the PHPUnit tests. ```sh docker-compose up -d ``` ```sh docker exec -ti lyra-php-api-sdk composer install ``` ```sh docker exec -ti lyra-php-api-sdk ./vendor/bin/phpunit src/ ``` -------------------------------- ### Install Lyra Network REST API SDK via Composer CLI Source: https://github.com/lyra/rest-php-examples/blob/master/www/vendor/lyracom/rest-php-sdk/README.md Command-line instruction to install the Lyra Network REST API SDK using Composer. ```sh composer require lyracom/rest-php-sdk:4.0.* ``` -------------------------------- ### Lyra Network PHP SDK Initialization Example Source: https://github.com/lyra/rest-php-examples/blob/master/www/index.html Shows how to initialize the Lyra Network PHP SDK, which is a prerequisite for performing any operations with the SDK. ```PHP ``` -------------------------------- ### Heroku Deployment Source: https://github.com/lyra/rest-php-examples/blob/master/README.md Deploys the Lyra REST API examples to Heroku. ```Shell heroku create git subtree push --prefix www heroku master heroku ps:scale web=1 heroku open ``` -------------------------------- ### Lyra Network Token Creation Example Source: https://github.com/lyra/rest-php-examples/blob/master/www/index.html Provides an example of how to create a payment token using the Lyra Network SDK. This is particularly useful for single-page applications (SPAs) like those built with Vue.js or React, where tokens can be used for secure, client-side payment processing. ```PHP 'ORDER123', // 'amount' => 1000, // 'currency' => 'EUR' // )); // echo json_encode(['token' => $token->getSecret()]); ?> ``` -------------------------------- ### Require.js Example for Lyra SDK Source: https://github.com/lyra/rest-php-examples/blob/master/www/index.html Illustrates how to use Require.js to load the Lyra SDK library, enabling modular JavaScript development. ```JavaScript // minimalEmbeddedForm.php (Require.js) // use require.js to load the library // requirejs.config({ // paths: { // 'lyra': 'path/to/lyra-sdk/dist/lyra' // } // }); // require(['lyra'], function(Lyra) { // // Use Lyra SDK // }); ``` -------------------------------- ### Install Lyra Network REST API SDK with Composer Source: https://github.com/lyra/rest-php-examples/blob/master/www/vendor/lyracom/rest-php-sdk/README.md Instructions for adding the Lyra Network REST API SDK to your project using Composer. This is the recommended installation method. ```json "lyracom/rest-php-sdk": "4.0.*" ``` -------------------------------- ### Lyra Network PHP SDK Transaction Creation Examples Source: https://github.com/lyra/rest-php-examples/blob/master/www/index.html Demonstrates various ways to create transactions using the Lyra Network PHP SDK. Includes examples for basic embedded forms, forms with custom fields, material design themes, and pop-in modal displays. ```PHP ``` ```PHP ``` ```PHP ``` ```PHP ``` ```PHP ``` -------------------------------- ### jQuery Examples for Lyra Embedded Payment Form Source: https://github.com/lyra/rest-php-examples/blob/master/www/index.html Demonstrates how to handle events and customize behavior of the embedded payment form using jQuery. Includes examples for managing errors, focusing fields, and executing actions before form submission. ```JavaScript // minimalEmbeddedForm.onError.php (jQuery) // Manage error messages yourself // $('#payment-form').on('payment:error', function(event, error) { // console.error('Payment Error:', error); // }); ``` ```JavaScript // minimalEmbeddedForm.onFocus.php (jQuery) // do some stuff when one field of the form focus // $('#payment-form .form-field').on('focus', function() { // console.log('Field focused:', $(this).attr('name')); // }); ``` ```JavaScript // minimalEmbeddedForm.onSubmit.php (jQuery) // do some stuff before kr-post-success-url call // $('#payment-form').on('payment:submit', function(event) { // console.log('Form submission initiated...'); // // Perform custom actions before submission // }); ``` -------------------------------- ### Configure Lyra API Keys Source: https://github.com/lyra/rest-php-examples/blob/master/www/sample/README.txt This snippet shows how to configure your API keys for the Lyra REST API. All authentication information is defined in the config.php file. You can use the provided demo keys or update them with your own. ```PHP ``` -------------------------------- ### Lyra Display Options Source: https://github.com/lyra/rest-php-examples/blob/master/www/sample/README.txt Demonstrates different ways to display Lyra integration within a browser. Options include embedded display, pop-in, and smart form. ```PHP // .embedded.php // Content for embedded display ``` ```PHP // .popin.php // Content for pop-in display ``` ```PHP // .smartForm.php // Content for smart form display ``` -------------------------------- ### Heroku Updates Source: https://github.com/lyra/rest-php-examples/blob/master/README.md Updates and pushes changes to the Heroku deployment. ```Shell git commit -am"some updates" git push heroku master heroku open ``` -------------------------------- ### Robots Exclusion Protocol Source: https://github.com/lyra/rest-php-examples/blob/master/www/robots.txt This snippet defines the robots.txt content, specifying that all user agents are disallowed from accessing any part of the site. ```APIDOC User-Agent: * Disallow: / ``` -------------------------------- ### Manual SDK Inclusion in PHP Source: https://github.com/lyra/rest-php-examples/blob/master/www/vendor/lyracom/rest-php-sdk/README.md Instructions for including the SDK's autoloader file when not using Composer, typically after downloading a release from GitHub. ```php require_once('/path/to/php-sdk/autoload.php'); ``` -------------------------------- ### Include SDK Autoloader in PHP Source: https://github.com/lyra/rest-php-examples/blob/master/www/vendor/lyracom/rest-php-sdk/README.md How to include the Composer autoloader file in your PHP project to use the Lyra Network REST API SDK. ```php require_once('vendor/autoload.php'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.