GithubHelp home page GithubHelp logo

gp-webpay-ws-php-sdk's Introduction

GP Webpay WebService PHP SDK

PHP SDK for GP Webpay WebService payments.

For HTTPS API, please use GP Webpay PHP SDK.

Before implementation, please read the docs from vendor first!

!! This SDK is not full featured yet. It's tested for recurring payments only but it's simply extensible. Feel free to create pull-request if you extend it in any way.

Installation

composer require fixsoftware/webpay-ws-php dev-master

Setup

$webpayWSConfig = new FixSoftware\WebpayWS\Config([
    'merchantNumber' => $merchantNumber, // Merchant number
    'provider' => $provider, // Your paygate provider number from documentation
    'serviceUrl' => $webpayUrl, // URL of webpay WS service
    'wsdlPath' => $wsdlPath, // WSDL file path (absolute)
    'signerPrivateKeyPath' => $signerPrivateKeyPath, // Path to the private key (absolute)
    'signerPrivateKeyPassword' => $signerPrivateKeyPassword, // Password for private key
    'signerGpPublicKeyPath' => $signerGpPublicKeyPath, // Path to the public key (absolute)
    'signerLogPath' => $signerLogPath // Path to log file for logging requests and responses signed/verified by Signer
]);

How to make a call

$webpayWS = new FixSoftware\WebpayWS\Api($webpayWSConfig);

// process master payment status
try {

    // call WS for master payment status
    $response = $this->webpayWS->call(
        $webserviceMethod, // WS action name (see WS docs)
        [
            // request params (see WS docs)
        ]
    );
    $response_params = $response->getParams(); // gets response parameters

    // in case of WS error (WS error response)
    if($response->hasError()) {
        $error = $response->getError();
        // do something
    }

// in case of exception (SDK exception)
} catch(FixSoftware\WebpayWS\ApiException $e) {
    $exception = $e->getMessage();
    // do something
}

Response status constants

FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_CREATED
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_PENDING_SETTLEMENT
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_CANCELED_BY_MERCHANT
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_CANCELED_BY_ISSUER
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_CANCELED_BY_CARDHOLDER
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_EXPIRED_CARD
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_EXPIRED_NO_PAYMENT
FixSoftware\WebpayWS\Response::STATUS_MASTER_RECURRING_VALID

gp-webpay-ws-php-sdk's People

Contributors

fixsoftware avatar

Stargazers

 avatar Martin Halaj avatar Miroslav Topolář 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.