Code Monkey home page Code Monkey logo

paysrc-cli-client's Introduction

PaySrc CLI Client

Screenshot

This is a basic CLI client for PaySrc, a BCH payment platform.
Tested with PaySrc API v1 on PHP 7.0.

The idea behind this client is a quick, dependency-less (except PHP) terminal client.
Feel free to take a look at the code and adapt it to your needs.

Visit PaySrc.com for more information.

Installation & Usage

Just clone this git, go into the directory and run paysrc.
Only depends on PHP 7.0+.

git clone https://github.com/choval/paysrc-cli-client.git --depth=1
cd paysrc-cli-client
php paysrc
php paysrc --query 10022

Check the same payment at: https://paysrc.com/p/10022

Usage
php paysrc.php --address="1MH5fNnWJ4YduxW61rHqpuekoMwCmgWp2M" --amount=0.001
php paysrc.php --query <PAYMENT_ID>

Returns
Payment Request

ID:      <PAYMENT_ID>
Amount:  BCH <AMOUNT>
Address: <ADDRESS>
Created: <CREATED>
Expires: <EXPIRATION>
Status:  <PAYMENT_STATUS>
Link:    https://paysrc.com/p/<PAYMENT_ID>
----

Parameters:

  --address <address>
            A cashaddr or legacy address where the final funds will be sent.
            This address is hidden to the payer, you can use the same address multiple times.
            Legacy addresses will be converted to cashaddr format.
            !REQUIRED

  --amount <amount>
            The amount of BCH to request.
            !REQUIRED

  --from <from>
            Name and email of who is requesting the payment (beneficiary).
            Examples: --from "Name <user@domain>"
                      --from "Name"
                      --from "<user@domain>"

  --to <to>
            Name and email of the customer or person to whom the payment is being sent (payer).
            To send a notification to the payer's email, the beneficiary's email must be provided too.
            Examples: --from "Name <user@domain>"
                      --from "Name"
                      --from "<user@domain>"

  --message <message>
            An optional message/text string.
            Warning: This message is public and not logged on the blockchain.

  --confirmations <confirmations>
            A number of confirmations required for the payer's confirmation.
            If not set, the minimum number of confirmations possible is used.

  --expires <expires>
            An optional UTC date-time expiration for the payment request.
            Examples: --expires "2018-12-31 12:34:56"
                      --expires "+3 months"
                      --expires "1546225200"

  --query <payment_id>
            Returns the Payment

Settings

  --json    Outputs the result in JSON format and exits.
  --testnet Runs on testnet. Make sure your address is testnet address.
  --nowait  Print and exit, do not wait for payment completion.
  --noqr    Do not print the QR code.
  --legacy  Displays legacy addresses.

TODO

  • Notification & Redirect URIs.
  • A proper library class.

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.

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.