Coder Social home page Coder Social logo

abdurrahmanunia / merchant-api-sdk-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cryptonator/merchant-api-sdk-php

0.0 1.0 0.0 5 KB

Merchant API SDK for PHP

Home Page: https://www.cryptonator.com/merchant/

License: MIT License

PHP 100.00%

merchant-api-sdk-php's Introduction

PHP Cryptonator.com Merchant API SDK

Requirements

PHP 5.3 or above

Links

  1. Cryptonator MerchantAPI Help Center: Ru, En

Getting started

Installation

  1. Add "cryptonator/merchant-php-sdk": "dev-master" to composer.json of your application or clone repo to your project.
  2. If you are using composer use require_once 'vendor/autoload.php'; otherwise paste the following line
    require_once '/path/to/cloned/repo/lib/MerchantAPI.php';

Merchant API

Using Cryptonator MerchantAPI SDK requires the following steps

  1. Paste the following code. Note: constants merchant_id and secret you will find in your account settings once you have set up a merchant account with Cryptonator.

    use cryptonator\MerchantAPI;
    
    $cryptonator = new MerchantAPI(merchant_id, secret);
  2. Now you can use Cryptonator MerchantAPI.

    // start payment
    $url = $cryptonator->startPayment(array(
       'item_name'               => 'Item Name',
       //'order_id'              => 'Order ID',
       //'item_description'      => 'Item Description',
       'invoice_amount'          => 'Invoice Amount',
       'invoice_currency'        => 'Invoice Currency',
       //'success_url'           => 'Success URL',
       //'failed_url'            => 'Failed URL',
       //'language'              => 'Language',
    ));
    
    // create invoice
    $invoice = $cryptonator->createInvoice(array(
        'item_name'               => 'Item Name',
        //'order_id'              => 'Order ID',
        //'item_description'      => 'Item Description',
        'checkout_currency'       => 'Checkout Amount',
        'invoice_amount'          => 'Invoice Amount',
        'invoice_currency'        => 'Invoice Currency',
        //'success_url'           => 'Success URL',
        //'failed_url'            => 'Failed URL',
        //'language'              => 'Language',
     ));
    
    // get invoice
    $invoice = $cryptonator->getInvoice('InvoiceID');
    
    // list invoices
    $invoices = $cryptonator->listInvoices(array(
        //'invoice_status'       => 'Invoice Status',
        //'invoice_currency'     => 'Invoice Currency',
        //'checkout_currency'    => 'Checkout Currency',
    ));
    
    // check annswer
    $check_server = $cryptonator->checkAnswer($_POST);

merchant-api-sdk-php's People

Contributors

sambucho avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.