-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bfddaaf
Showing
210 changed files
with
13,351 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Novalnet\Bundle\NovalnetBundle\Client; | ||
|
||
use Guzzle\Http\ClientInterface; | ||
|
||
/** | ||
* Handle Novalnet payport API request and response | ||
*/ | ||
class Gateway implements GatewayInterface | ||
{ | ||
/** @var ClientInterface */ | ||
protected $httpClient; | ||
|
||
/** | ||
* @param ClientInterface $httpClient | ||
*/ | ||
public function __construct(ClientInterface $httpClient) | ||
{ | ||
$this->httpClient = $httpClient; | ||
} | ||
|
||
/** {@inheritdoc} */ | ||
public function send($hostAddress = '', $config = '', array $parameters = []) | ||
{ | ||
$hostAddress = !empty($hostAddress) ? $hostAddress : 'https://paygate.novalnet.de/paygate.jsp'; | ||
|
||
$response = $this->httpClient | ||
->post($hostAddress, [], $parameters, $this->getRequestOptions($config)) | ||
->send(); | ||
|
||
return $response->getBody(true); | ||
} | ||
|
||
/** | ||
* @param object $config | ||
* @return array | ||
*/ | ||
protected function getRequestOptions($config) | ||
{ | ||
$requestOptions = [ | ||
'timeout' => (!empty($config) && $config->getGatewayTimeout()) ? $config->getGatewayTimeout() : '240', | ||
]; | ||
|
||
return $requestOptions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Novalnet\Bundle\NovalnetBundle\Client; | ||
|
||
/** | ||
* Interface for Handle Novalnet payport API request and response | ||
*/ | ||
interface GatewayInterface | ||
{ | ||
/** | ||
* @param string $hostAddress | ||
* @param object $config | ||
* @param array $parameters | ||
*/ | ||
public function send($hostAddress, $config, array $parameters = []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Novalnet\Bundle\NovalnetBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
|
||
/** | ||
* Class NovalnetExtension | ||
* @package Novalnet\Bundle\NovalnetBundle\DependencyInjection | ||
*/ | ||
class NovalnetExtension extends Extension | ||
{ | ||
const ALIAS = 'novalnet'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); | ||
$loader->load('services.yml'); | ||
$loader->load('method.yml'); | ||
$loader->load('callbacks.yml'); | ||
$loader->load('form_types.yml'); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getAlias() | ||
{ | ||
return self::ALIAS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?php | ||
|
||
namespace Novalnet\Bundle\NovalnetBundle\Entity; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* Novalnet callback script history Entity | ||
* @ORM\Table(name="nn_callback_history") | ||
* @ORM\Entity | ||
*/ | ||
class NovalnetCallbackHistory | ||
{ | ||
/** | ||
* @var int | ||
* @ORM\Id | ||
* @ORM\Column(type="integer") | ||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var int | ||
* @ORM\Column(name="date", type="datetime", nullable=true) | ||
*/ | ||
protected $date; | ||
|
||
/** | ||
* @var string | ||
* @ORM\Column(name="callback_amount", type="integer", length=11, nullable=true) | ||
*/ | ||
protected $callbackAmount; | ||
|
||
/** | ||
* @var string | ||
* @ORM\Column(name="order_no", type="string", length=30, nullable=true) | ||
*/ | ||
protected $orderNo; | ||
|
||
/** | ||
* @var int | ||
* @ORM\Column(name="org_tid", type="bigint", length=20, nullable=true) | ||
*/ | ||
protected $orgTid; | ||
|
||
/** | ||
* @var int | ||
* @ORM\Column(name="callback_tid", type="bigint", length=20, nullable=true) | ||
*/ | ||
protected $callbackTid; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getCallbackAmount() | ||
{ | ||
return $this->callbackAmount; | ||
} | ||
|
||
/** | ||
* @param int $callbackAmount | ||
* @return NovalnetCallbackHistory | ||
*/ | ||
public function setCallbackAmount($callbackAmount) | ||
{ | ||
$this->callbackAmount = (int)$callbackAmount; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getOrderNo() | ||
{ | ||
return $this->orderNo; | ||
} | ||
|
||
/** | ||
* @param string $orderNo | ||
* @return NovalnetCallbackHistory | ||
*/ | ||
public function setOrderNo($orderNo) | ||
{ | ||
$this->orderNo = $orderNo; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getOrgTid() | ||
{ | ||
return $this->orgTid; | ||
} | ||
|
||
/** | ||
* @param string $orgTid | ||
* @return NovalnetCallbackHistory | ||
*/ | ||
public function setOrgTid($orgTid) | ||
{ | ||
$this->orgTid = $orgTid; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCallbackTid() | ||
{ | ||
return $this->callbackTid; | ||
} | ||
|
||
/** | ||
* @param string $callbackTid | ||
* @return NovalnetCallbackHistory | ||
*/ | ||
public function setCallbackTid($callbackTid) | ||
{ | ||
$this->callbackTid = $callbackTid; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDate() | ||
{ | ||
return $this->date; | ||
} | ||
|
||
/** | ||
* @param \DateTime $date | ||
* @return NovalnetCallbackHistory | ||
*/ | ||
public function setDate(\DateTime $date) | ||
{ | ||
$this->date = $date; | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.