2017 © Pedro Peláez
 

library unicredit-api

image

emanueledona/unicredit-api

  • Saturday, May 13, 2017
  • by emanueledona
  • Repository
  • 2 Watchers
  • 1 Stars
  • 53 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

Unicredit Api

Unicredit API (DEVELOPMENT), (*1)

Library to connect e-commerce to Unicredit ( Italy ) payment service., (*2)

Based on PHP libs of Unicredit, converted in PSR-4 format and wrapped in., (*3)

Install

Use composer require "emanueledona/unicredit-api:dev-master" to install with composer the last version, (*4)

Unicredit testing parameters

  • serverURL : https://testeps.netswgroup.it/UNI_CG_SERVICES/services
  • kSig : "UNI_TESTKEY"

Usage

Import library with use emanueledona\unicreditApi\UnicreditApi; ., (*5)

Create object $unicredit = new UnicreditApi(); ., (*6)

Invoche INIT

$redirect = $unicredit->init($args);, (*7)

This function call the IgfsCgInit class, and perform the initialization of the authorization ( IgfsCgInit::execute() )., (*8)

The $args parameter is an array of elements :, (*9)

  • 'serverURL' => 'https://testeps.netswgroup.it/UNI_CG_SERVICES/services',
  • 'timeout' => 15000,
  • 'tid' => 'UNI_ECOM',
  • 'kSig' => 'UNI_TESTKEY',
  • 'trType' => 'AUTH',
  • 'currencyCode' => 'EUR',
  • 'langID' => 'IT',
  • 'shopUserRef' => ##CLIENT_EMAIL##,
  • 'shopID' => ##ORDER_ID##,
  • 'amount' => ##TOTAL_AMOUNT##, // this must be without decimals Ex.: 199.99 => (199.99*100) = 19999
  • 'notifyURL' => ##URL##, // URL to verify the correct execution of transaction
  • 'errorURL' => ##URL##, // URL to manage errors

The function return a URL :, (*10)

  • if all OK the URL redirect to Unicredit payment system
  • if there is a problem the URL redirect to errorURL whitin error information

Where is the paymentID ?

The paymentID is return by the function $unicredit->getPaymentID(), if there is not paymentID this function return NULL., (*11)

This value is important, this MUST BE stored in your system to ensure che payment verification and validation., (*12)

Invoche VERIFY

$response = $unicredit->verify('your_paymentID',$args);, (*13)

This function perform a validation of the payment whit the method IgfsCgVerify::execute()., (*14)

To check if a payment is correct you need the paymentID and some configuration parameters:, (*15)

  • 'serverURL' => 'https://testeps.netswgroup.it/UNI_CG_SERVICES/services',
  • 'timeout' => 15000,
  • 'tid' => 'UNI_ECOM',
  • 'kSig' => 'UNI_TESTKEY',
  • 'shopID' => ##ORDER_ID##, // This is the same used to start the payment's order

The function return an array :, (*16)

  • in case of success :, (*17)

    • 'status' => 'OK',
    • 'rc' => $IgfsCgVerify->rc,
    • 'tranID' => $IgfsCgVerify->tranID,
    • 'enrStatus' => $IgfsCgVerify->enrStatus,
    • 'authStatus' => $IgfsCgVerify->authStatus,
  • in case of errors :, (*18)

    • 'status' => 'KO',
    • 'rc' => $IgfsCgVerify->rc,
    • 'errorDesc' => $IgfsCgVerify->errorDesc,

The Versions

13/05 2017

dev-master

9999999-dev

  Sources   Download

MIT