forked from tomaj/omnipay-tatra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
34 lines (27 loc) · 667 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
use Omnipay\Omnipay;
require_once __DIR__ . '/vendor/autoload.php';
$tatra = Omnipay::create('Tatra');
$tatra->setMid('aoj');
$tatra->setSharedSecret('87651234');
$response = $tatra->purchase(
[
'amt' => '10.00',
'rurl' => 'http://sme.sk/',
'curr' => 978,
'cs' => '0308',
'vs' => '3232534532',
]
)->send();
// Process response
if ($response->isSuccessful()) {
// Payment was successful
print_r($response);
} elseif ($response->isRedirect()) {
// Redirect to offsite payment gateway
$response->redirect();
} else {
// Payment failed
echo $response->getMessage();
}
var_dump($tatra);