forked from tpay-com/tpay-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardGate.php
More file actions
59 lines (48 loc) · 1.35 KB
/
CardGate.php
File metadata and controls
59 lines (48 loc) · 1.35 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/*
* Created by tpay.com
*/
namespace tpayLibs\examples;
use tpayLibs\src\_class_tpay\Utilities\Lang;
use tpayLibs\src\_class_tpay\PaymentForms\PaymentCardForms;
include_once 'config.php';
include_once 'loader.php';
class CardGate extends PaymentCardForms
{
public function __construct()
{
$this->cardApiKey = '';
$this->cardApiPass = '';
$this->cardKeyRSA = '';
$this->cardVerificationCode = '';
$this->cardHashAlg = 'sha1';
parent::__construct();
}
public function getCardDirectHtml()
{
Lang::setLang('pl');
$staticFilesURL = $_SERVER['REQUEST_URI'].'/../../src/';
$handleFormURL = $_SERVER['REQUEST_URI'].'/../SecureSalePayment.php';
$cardGateHTML = $this->getOnSiteCardForm($staticFilesURL, $handleFormURL);
$exampleCardData = array(
'number' => '4532823576358083',
'csc' => '976',
'exp' => '03 / 18',
'name' => 'Jan Kowalsky',
'email' => 'kowalsky@wp.pl',
);
echo '<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Card payment</title>
<meta name="description" content="Card payment">
</head>
<body>
' . $cardGateHTML . '
<pre>' . print_r($exampleCardData, true) . '</pre>
</body>
</html>';
}
}
(new CardGate())->getCardDirectHtml();