forked from tpay-com/tpay-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Szkwal.php
88 lines (65 loc) · 1.86 KB
/
Szkwal.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
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/*
* Created by tpay.com
*/
namespace tpayLibs\examples;
use tpayLibs\src\_class_tpay\PaymentSzkwal;
include_once 'config.php';
include_once 'loader.php';
class SzkwalExample extends PaymentSzkwal
{
public function __construct()
{
$this->szkwalApiLogin = '';
$this->szkwalApiPass = '';
$this->szkwalApiHash = '';
$this->szkwalPartnerUniqueAddress = '';
$this->szkwalTitleFormat = '';
parent::__construct();
}
public function getSzkwalHtml()
{
/**
* Register new client
*/
$clientName = 'John Doe';
$clientEmail = '[email protected]';
$clientPhone = '126354789';
$crc = '100020003000';
$clientBankAccount = '48079682082787844636363553';
$szkwalResult = $this->registerClient($clientName, $clientEmail, $clientPhone, $crc, $clientBankAccount);
$merchantData = 'Sklep ze zdrową żywnością<br>ul. Świdnicka 26, 50-345 Wrocław';
$amount = 123.45;
$html = $this->getConfirmationBlock($szkwalResult['title'], $amount, $merchantData);
echo $html;
/**
*array(2) {
*["client_id"]=> int(658901)
*["title"]=> string(12) "KIP438010354"
*}
*/
}
public function registerClientIncomeTest()
{
/**
* Register client income in test mode.
*/
$clientTitle = 'KIP438010354';
$amount = 100;
return $this->registerIncome($clientTitle, $amount);
/*
* string(82) " correct "
*/
}
public function updateNotificationUrl()
{
/**
* Update notification URL
*/
$notificationURL = 'http://example.pl?szkwal_notification';
return $this->changeSellerData($notificationURL);
/*
* bool(true)
*/
}
}