forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payout.php
36 lines (28 loc) · 1.12 KB
/
payout.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
<?php
// check recurrent payments
if (empty($global['systemRootPath'])) {
$global['systemRootPath'] = '../../';
}
require_once $global['systemRootPath'] . 'videos/configuration.php';
_error_log("Payout Info Start");
$plugin = AVideoPlugin::loadPluginIfEnabled("YPTWallet");
$walletObject = AVideoPlugin::getObjectData("YPTWallet");
$paypal = AVideoPlugin::loadPluginIfEnabled("PayPalYPT");
if (empty($plugin)) {
forbiddenPage('Wallet Disabled');
}
if (empty($paypal)) {
forbiddenPage('PayPal Disabled');
}
if (empty($_REQUEST['payout_batch'])) {
forbiddenPage('payout_batch_id required');
}
$response = PayPalYPT::getPayoutInfo($_REQUEST['payout_batch']);
if(!is_object($response) || empty($response->result)){
forbiddenPage('Request error');
}
?>
Subject: <?php echo $response->result->batch_header->sender_batch_header->email_subject; ?><br>
Status: <?php echo $response->result->batch_header->batch_status; ?><br>
Time: <?php echo $response->result->batch_header->time_created; ?><br>
Amount: $<?php echo $response->result->batch_header->amount->value, $response->result->batch_header->amount->currency; ?><br>