sirumobile/payum-siru

Payum extension for Siru Mobile payment gateway

0.1.0 2022-11-16 09:08 UTC

This package is auto-updated.

Last update: 2024-04-16 12:53:28 UTC


README

This library allows the use of Siru Mobile payments with Payum.

Requirements

  • PHP 8.0+
  • API credentials from Siru Mobile

Installation

composer require sirumobile/payum-siru

Configuration

You need your API credentials and integration details from Siru Mobile. See EXAMPLE for more complete example of the payment flow.

<?php

use Payum\Core\GatewayFactoryInterface;
use Siru\PayumSiru\PayumSiruGatewayFactory;
use Payum\Core\PayumBuilder;
use Payum\Core\Payum;

/** @var Payum $payum */
$payum = (new PayumBuilder())
    ->addDefaultStorages()
    ->addGatewayFactory('siru_checkout', function(array $config, GatewayFactoryInterface $coreGatewayFactory) {
        return new PayumSiruGatewayFactory($config, $coreGatewayFactory);
    })
    ->addGateway('siru_checkout', [
        'factory' => 'siru_checkout',
        # These are only example values. Replace these with values you received from Siru Mobile
        'merchant_id' => 123,
        'merchant_secret' => 'yoursecret',
        'variant' => 'variant2',
        'purchase_country' => 'FI',
        'service_group' => 2,
        'tax_class' => 3,
    ])
    ->getPayum()
;