kayzorelabs/omnipay-checkout.fi

3.0.2 2019-05-03 12:26 UTC

This package is auto-updated.

Last update: 2024-04-29 04:13:14 UTC


README

Checkout.fi driver for the Omnipay PHP payment processing library

Build Status

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Checkout.fi support for Omnipay.

Installation

TODO

Basic Usage

The following gateways are provided by this package:

  • CheckoutFi

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

Example

$gateway = Omnipay::create('CheckoutFi')

$gateway.initialize(
    array(
        'merchantId' => '375917',
        'merchantSecret' => 'SAIPPUAKAUPPIAS',
        'returnUrl' => 'https://my.ecommerce.example.com/return'
    )
);

$response = $gateway->purchase(
    array(
        'stamp' => 'YourUniqueIdentifier',
        'amount' => '1200', // Amount in cents
        'reference' => 'YourReference',
        'deliveryDate' => '20160815', // Estimated delivery date
        'firstName' => 'Paying',
        'familyName' => 'Customer',
        'address' => 'Streetaddress 123',
        'postCode' => '33100',
        'postOffice' => 'Tampere'
    )
)->send();

if ($response->isRedirect()) {
    // Redirect to checkout.fi site
    $response->redirect();
} else {
    // Request failed
    echo $response->getMessage();
}

See the checkout.fi API documentation (in Finnish) for the request parameters. Values for VERSION, CURRENCY, DEVICE, CONTENT, TYPE, and ALGORITHM are set already, although you may need to provide another value for CONTENT.

Once the purchase is completed or cancelled, checkout.fi will call you returnUrl with parameters defined in the API documentation. This you should handle with completePurchase, eg.

// CompletePurchaseRequest will read the parameters from query string
$response = $gateway->completePurchase()->send();

if ($response->isSuccessful()) {
    // TODO
} else {
    // TODO
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

Development

composer install
composer dump-autoload
composer test