Code Monkey home page Code Monkey logo

php-sdk's Introduction

WayForPay PHP SDK Packagist PHP version

License Packagist

Latest Stable Version GitHub Release Date

Packagist PHP version Code size

GitHub stars GitHub issues

PHP SDK for payment system WayForPay.

Table Of Contents

WayForPay documentation

Installing

The recommended way to install SDK is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version:

php composer.phar require wayforpay/php-sdk

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

How to use

All examples require composer install before using after cloning from GitHub.

Wizard

Purchase Form

See purchase.php.

Run PHP built-in server

$ php -S localhost:8000

Then open http://localhost:8000/examples/purchase.php in browser.

Purchase Widget

See purchase-widget.php.

Run PHP built-in server

$ php -S localhost:8000

Then open http://localhost:8000/examples/purchase-widget.php in browser.

Transactions List

See transaction-list.php.

$ php examples/transaction-list.php 
Reason Code: 1100
2019-07-01 07:02:44     PURCHASE        Declined                9024 UAH
2019-07-01 06:48:27     PURCHASE        Expired                 50000 UAH
2019-07-01 07:04:10     PURCHASE        Declined                9024 UAH
2019-07-01 07:14:14     CHARGE          Approved                0.01 UAH
2019-07-01 07:13:31     PURCHASE        Declined                9024 UAH
2019-07-01 07:14:38     CHARGE          Approved                0.01 UAH
2019-07-01 07:13:31     PURCHASE        Declined                9024 UAH
2019-07-01 07:15:23     CHARGE          Declined                0.01 UAH
2019-07-01 07:17:39     REFUND          Refunded                0.01 UAH
2019-07-01 07:17:41     REFUND          Refunded                0.01 UAH
2019-07-01 07:17:44     CHARGE          Approved                0.01 UAH
2019-07-01 07:17:48     REFUND          Refunded                0.01 UAH
2019-07-01 07:19:14     CHARGE          Approved                0.01 UAH
2019-07-01 07:04:11     PURCHASE        Expired                 9024 UAH
2019-07-01 07:19:42     PURCHASE        Declined                9024 UAH
2019-07-01 07:23:08     CHARGE          Approved                0.01 UAH
2019-07-01 07:24:25     CHARGE          Approved                0.01 UAH
2019-07-01 07:19:41     PURCHASE        Declined                9024 UAH
2019-07-01 07:32:39     REFUND          Refunded                0.01 UAH
2019-07-01 07:32:41     REFUND          Refunded                0.01 UAH
2019-07-01 07:34:37     PURCHASE        Declined                9024 UAH
2019-07-01 07:35:46     CHARGE          WaitingAuthComplete     39 UAH
2019-07-01 07:34:38     PURCHASE        Declined                9024 UAH
2019-07-01 07:36:01     REFUND          Voided                  39 UAH
2019-07-01 07:36:41     CHARGE          WaitingAuthComplete     95 UAH
2019-07-01 07:36:42     REFUND          Refunded                0.01 UAH
2019-07-01 07:37:01     REFUND          Voided                  95 UAH
2019-07-01 07:39:52     PURCHASE        Declined                9024 UAH
2019-07-01 07:39:52     PURCHASE        Declined                9024 UAH
2019-07-01 07:40:33     REFUND          Refunded                0.01 UAH
2019-07-01 07:40:35     REFUND          Refunded                0.01 UAH
2019-07-01 07:25:52     PURCHASE        Expired                 1.99 USD
2019-07-01 07:42:58     CHARGE          Approved                0.01 UAH
2019-07-01 07:59:27     REFUND          Refunded                0.01 UAH

Response will be instance of TransactionListResponse. Transactions can be retrieved via getTransactionList method.

Charge

See charge.php.

$ php examples/charge.php 
Status: InProcessing

Response will be instance of ChargeResponse. Transaction can be retrieved via getTransaction method.

Complete 3DS

$ php examples/complete-3ds.php 
Status: Approved

Response will be instance of Complete3DSResponse. Transaction can be retrieved via getTransaction method.

Check

$ php examples/check.php 
Reason Code: 1100
Order status: Refunded

Response will be instance of CheckResponse. Order can be retrieved via getOrder method.

Refund

$ php examples/refund.php 
Reason Code: 1100
Order status: Refunded

Response will be instance of RufundResponse.

Service URL

You can set service URL in wizard via

$wizard->setServiceUrl('http://localhost:8000/examples/serviceUrl.php')

After payment processing WayForPay send payment data to specified URL. You can parse and check data like in example.

See serviceUrl.php.

⚠️⚠️⚠️ WARNING ⚠️⚠️⚠️

Service URL must be accessible via Internet. WayForPay can't send data to local machine!

Return URL

You can set service URL in wizard via

$wizard->setReturnUrl('http://localhost:8000/examples/returnUrl.php')

After payment processing WayForPay send payment data to specified URL. You can parse and check data like in example.

See returnUrl.php.

TODO

  • Methods
    • SETTLE
    • P2P_CREDIT
    • CREATE_INVOICE
    • P2_PHONE

Contributing

See contributing note

php-sdk's People

Contributors

spell6inder avatar vladdnepr 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.