Skip to content

Commit 93d1920

Browse files
authored
Merge pull request #1 from alegraio/dev
Added gvp authorize,capture, purchase
2 parents 687a25e + b1ee79e commit 93d1920

14 files changed

+982
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Gvp (Garanti, Denizbank, TEB, ING, Şekerbank, TFKB sanal pos) gateway for Omnipay payment processing library
33

44
<a href="https://github.com/thephpleague/omnipay">Omnipay</a> is a framework agnostic, multi-gateway payment
5-
processing library for PHP 5.3+. This package implements PayU Online Payment Gateway support for Omnipay.
5+
processing library for PHP 7.3+. This package implements Gvp Online Payment Gateway support for Omnipay.
66

77
#### Installation
88

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "alegra/omnipay-gvp",
3+
"type": "library",
4+
"description": "Gvp(Garanti, Denizbank, TEB, ING, Şekerbank, TFKB sanal pos) gateway for Omnipay payment processing library",
5+
"homepage": "https://github.com/alegraio/omnipay-gvp",
6+
"license": "MIT",
7+
"autoload": {
8+
"psr-4": {
9+
"Omnipay\\Gvp\\": "src/"
10+
}
11+
},
12+
"require": {
13+
"php": "^7.3",
14+
"omnipay/common": "^3",
15+
"ext-json": "*",
16+
"ext-simplexml": "*",
17+
"ext-dom": "*"
18+
},
19+
"require-dev": {
20+
"omnipay/tests": "^3",
21+
"squizlabs/php_codesniffer": "^3"
22+
},
23+
"extra": {
24+
"branch-alias": {
25+
"dev-master": "3.0.x-dev"
26+
}
27+
},
28+
"prefer-stable": true
29+
}

src/Gateway.php

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
/**
3+
* Gvp Class using API
4+
*/
5+
6+
namespace Omnipay\Gvp;
7+
8+
use Omnipay\Common\AbstractGateway;
9+
use Omnipay\Common\Message\AbstractRequest;
10+
use Omnipay\Common\Message\RequestInterface;
11+
use Omnipay\Gvp\Messages\AuthorizeRequest;
12+
use Omnipay\Gvp\Messages\CaptureRequest;
13+
use Omnipay\Gvp\Messages\CompletePurchaseRequest;
14+
use Omnipay\Gvp\Messages\PurchaseRequest;
15+
16+
17+
/**
18+
* @method \Omnipay\Common\Message\NotificationInterface acceptNotification(array $options = array())
19+
* @method \Omnipay\Common\Message\RequestInterface completeAuthorize(array $options = array())
20+
* @method \Omnipay\Common\Message\RequestInterface refund(array $options = array())
21+
* @method \Omnipay\Common\Message\RequestInterface fetchTransaction(array $options = [])
22+
* @method \Omnipay\Common\Message\RequestInterface void(array $options = array())
23+
* @method \Omnipay\Common\Message\RequestInterface createCard(array $options = array())
24+
* @method \Omnipay\Common\Message\RequestInterface updateCard(array $options = array())
25+
* @method \Omnipay\Common\Message\RequestInterface deleteCard(array $options = array())
26+
*/
27+
class Gateway extends AbstractGateway
28+
{
29+
/**
30+
* Get gateway display name
31+
*
32+
* This can be used by carts to get the display name for each gateway.
33+
* @return string
34+
*/
35+
public function getName(): string
36+
{
37+
return 'Gvp';
38+
}
39+
40+
/**
41+
* @return string
42+
*/
43+
public function getMerchantId(): string
44+
{
45+
return $this->getParameter('merchantId');
46+
}
47+
48+
/**
49+
* @param string $value
50+
* @return Gateway
51+
*/
52+
public function setMerchantId(string $value): Gateway
53+
{
54+
return $this->setParameter('merchantId', $value);
55+
}
56+
57+
/**
58+
* @return string
59+
*/
60+
public function getTerminalId(): string
61+
{
62+
return $this->getParameter('terminalId');
63+
}
64+
65+
/**
66+
* @param string $value
67+
* @return Gateway
68+
*/
69+
public function setTerminalId(string $value): Gateway
70+
{
71+
return $this->setParameter('terminalId', $value);
72+
}
73+
74+
/**
75+
* @param array $parameters
76+
* @return AbstractRequest|RequestInterface
77+
*/
78+
public function authorize(array $parameters = []): RequestInterface
79+
{
80+
return $this->createRequest(AuthorizeRequest::class, $parameters);
81+
}
82+
83+
/**
84+
* @param array $parameters
85+
* @return AbstractRequest|RequestInterface
86+
*/
87+
public function capture(array $parameters = []): RequestInterface
88+
{
89+
return $this->createRequest(CaptureRequest::class, $parameters);
90+
}
91+
92+
/**
93+
* @param array $parameters
94+
* @return RequestInterface
95+
*/
96+
public function purchase(array $parameters = []): RequestInterface
97+
{
98+
return $this->createRequest(PurchaseRequest::class, $parameters);
99+
}
100+
101+
/**
102+
* @param array $parameters
103+
* @return RequestInterface
104+
*/
105+
public function completePurchase(array $parameters = []): RequestInterface
106+
{
107+
return $this->createRequest(CompletePurchaseRequest::class, $parameters);
108+
}
109+
}

0 commit comments

Comments
 (0)