Git Product home page Git Product logo

omnipay-dotpay's Introduction

Omnipay: Dotpay

Dotpay driver for the Omnipay PHP payment processing library

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "omnipay/dotpay": "~3.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

The following gateways are provided by this package:

  • Dotpay

For general usage instructions, please see the main Omnipay repository.

Example usage:

Initialize gateway:

$gateway = Omnipay::create('Dotpay');

// Gateway specific parameters
$gateway->initialize([
    'accountId'  => 'YOUR_DOTPAY_ID',
    'pid'        => 'YOUR_SECRET_PIN',
    'type'       => '0',
    'action'     => 'https://ssl.dotpay.pl/test_payment/',
    'lang'       => 'pl',
    'apiVersion' => 'dev',
    'channel'    => '0'
]);
// Omnipay generic parameters
$params = [
    'amount' => 12.34,
    'currency' => 'PLN',
    'description' => 'Test payment',
    'returnUrl' => 'https://www.your-domain.nl/return_here',
    'notifyUrl' => 'https://www.your-domain.nl/notify_here',
    'email' => '[email protected]',
];

// You can add Dotpay-specific (not Omnipay generic) parameters here:
$params += [
    'first_name' => 'Jan',
    'last_name' => 'Kowalski',
];

$response = $gateway
    ->purchase($params)
    ->send();

if ($response->isRedirect()) {
    $response->redirect();
} else if ($response->isSuccessful()) {
    // process payment
} else {
    // process failure
}

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.