2017 © Pedro Peláez
 

library estcard

Nets EstCard implementation

image

codehouse/estcard

Nets EstCard implementation

  • Sunday, February 25, 2018
  • by shmarkus
  • Repository
  • 1 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Usage

Initialise service, (*1)

<?php
$pathToPrivateKey = '/testkeys/private.key';
$pathToPublicKey = '/testkeys/public.key';
$postBack = 'https://'.$_SERVER['HTTP_HOST'] . '/payment';
$estCardId = '318DC77DC8';
$estCardUrl = 'https://pos.estcard.ee/test-pos/iPayServlet';
$estCard = new \CodeHouse\EstCard\EstCardImpl($pathToPrivateKey, $pathToPublicKey, $postBack, $estCardId, $estCardUrl);

When the service is initialised, create hidden HTML form to submit to service provider, (*2)

<?php 
/**
 * @var \CodeHouse\EstCard\EstCard $service
 **/ 
$amountInCents = 10000;
$service->getHtmlForm($amountInCents);

The form has ID estcard, to send the form to Nets, use jQuery $('#estcard').submit() The response can be validated using the following snippet, (*3)

<?php 
/**
 * @var \CodeHouse\EstCard\EstCard $service
 **/ 
$result = $service->validateResponse($_REQUEST);
if ($result == \CodeHouse\EstCard\EstCard::VALIDATE_OK && $response['respcode'] == \CodeHouse\EstCard\EstCard::PAYMENT_OK) {
        // success
}
// signature failed, or payment was not processed

Info

More info in https://www.nets.eu/etee/Pages/Test-keskkond.aspx, (*4)

The Versions

25/02 2018

dev-master

9999999-dev

Nets EstCard implementation

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-mbstring *
  • ext-openssl *

 

payment nets credit card estcard

25/02 2018

1.0.1

1.0.1.0

Nets EstCard implementation

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-mbstring *
  • ext-openssl *

 

payment nets credit card estcard

26/10 2017

1.0.0

1.0.0.0

Nets EstCard implementation

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-mbstring *
  • ext-openssl *

 

payment nets credit card estcard