greencryptopay/greencryptopay-php

Greencryptopay library for PHP

v1.0.4 2024-02-21 11:21 UTC

This package is auto-updated.

Last update: 2025-01-05 13:18:41 UTC


README

Installation

Requires:

  • PHP version: ^7.3
  • PHP extensions: guzzlehttp/guzzle, phpunit/phpunit, fakerphp/faker

You can install the package via composer:

composer require greencryptopay/greencryptopay-php

Tests

vendor/bin/phpunit --testsuite="tests"

Standard API

Getting Started:

    
    require "vendor/autoload.php";

    use GcpSdk\Api;
    
    // Standard API
    $standardApi = Api::make('standard');
      
    // Standard API testnet
    $standardApi = Api::make('standard', true);
    
    // Sign up
    if (empty($merchantId) || empty($secretKey)) {
          $response = $standardApi->merchant('percent', 'https://example.com/callback');
          $merchantId = $response['merchant_id'];
          $secretKey = $response['secret_key'];
    }
    
    $standardApi->setMerchantId($merchantId);
    $standardApi->setSecretKey($secretKey);

Sign up:

Operations:

Stats:

Transfer API

Getting Started:

    
    require "vendor/autoload.php";

    use GcpSdk\Api;
    
    // Transfer API
    $transferApi = Api::make('transfer');
      
    // Transfer API testnet
    $transferApi = Api::make('transfer', true);
    
    // Sign up
    if (empty($merchantId) || empty($secretKey)) {
          $response = $transferApi->merchant('percent', 'https://example.com/callback');
          $merchantId = $response['merchant_id'];
          $secretKey = $response['secret_key'];
    }
    
    $transferApi->setMerchantId($merchantId);
    $transferApi->setSecretKey($secretKey);

Sign up:

Operations:

Stats: