-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
93 lines (64 loc) · 2.31 KB
/
index.php
File metadata and controls
93 lines (64 loc) · 2.31 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
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
89
90
91
92
93
<?php
require 'libs/config.php';
require 'libs/api.php';
require 'libs/classes.php';
$api = new payAPI($debugService);
// $api->setServiceUrl($serviceUrl);
$api->setPublicKey($privateKey);
$api->setPrivateKey($publicKey);
$response = null;
$request = new IsTransactionConfirmedRequest();
$request->TransactionId = 'K1FLV3M7SL3VJ60LRCUX';
$request->TransactionKey = 'TR0P895V89753ZN6Q07RT6DY5C3UUAQXT9MVX104O6I40L6MVZ';
$response = $api->IsTransactionConfirmed($request);
print_r($response);
if (!$api->checkHash($response))
{
throw new Exception('Response is malformed/manipulated.');
}
return;
$request = new CreateTransactionRequest();
$request->Amount = 1000;
$request->Currency = 'btc';
$request->PriceCurrency = 'eur';
$request->IPN = 'NO_IPN';
$request->BlockAddress = 'true';
//Add custom User Id for accounting
$request->CustomUserId = '1234';
//Add custom Order Id for accounting
$request->CustomOrderId = '24';
//Add customer mail address for accounting
$request->CustomerMail = 'me@mail.com';
//Anything else you want to link with this transaction
$request->CustomData = '186ebff2-b319-49ed-a18f-dcbb27c9e9dd';
$response = $api->CreateTransaction($request);
if (!$api->checkHash($response))
{
throw new Exception('Response is malformed/manipulated.');
}
$request = new GetTransactionDetailsRequest();
$request->TransactionId = 'K1FLV3M7SL3VJ60LRCUX';
$request->TransactionKey = 'TR0P895V89753ZN6Q07RT6DY5C3UUAQXT9MVX104O6I40L6MVZ';
//$response = $api->GetTransactionDetails($request);
if (!$api->checkHash($response))
{
throw new Exception('Response is malformed/manipulated.');
}
$request = new ReOpenTransactionRequest();
$request->TransactionId = 'K1FLV3M7SL3VJ60LRCUX';
$request->TransactionKey = 'TR0P895V89753ZN6Q07RT6DY5C3UUAQXT9MVX104O6I40L6MVZ';
//$response = $api->ReOpenTransaction($request);
if (!$api->checkHash($response))
{
throw new Exception('Response is malformed/manipulated.');
}
$request = new CancelTransactionRequest();
$request->TransactionId = 'K1FLV3M7SL3VJ60LRCUX';
$request->TransactionKey = 'TR0P895V89753ZN6Q07RT6DY5C3UUAQXT9MVX104O6I40L6MVZ';
//Note if the customer has canceled the transaction
$request->ByCustomer = 'false';
//$response = $api->CancelTransaction($request);
if (!$api->checkHash($response))
{
throw new Exception('Response is malformed/manipulated.');
}