-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.php
More file actions
94 lines (75 loc) · 2.05 KB
/
api.php
File metadata and controls
94 lines (75 loc) · 2.05 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
94
<?php
class Payoneer
{
private $db;
private $payee_details;
private $payee_status=0;
private $debugging;
private $PartnerID = '<your partner ID>';
private $Username = '<your payoneer username>';
private $Password = '<your payoneer password';
private $apiURL = 'https://api.payoneer.com/payouts/HttpAPI/API.aspx?';
function __construct(&$db)
{
$this->db = &$db;
$this->debugging = 0;
}
function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
function getMemSignupLink($memid)
{
$payeeid = 'tftm'.$memid;
$url = $this->apiURL."mname=GetToken&p1=".$this->Username."&p2=".$this->Password."&p3=".$this->PartnerID."&p4=".$payeeid;
$fh = fopen($url, 'r');
$data = fread($fh, 1024);
fclose($fh);
return $data;
}
function getVendorSignupLink($memid)
{
$payeeid = 'tftv'.$memid;
$url = $this->apiURL."mname=GetToken&p1this->=".$Username."&p2=".$this->Password."&p3=".$this->PartnerID."&p4=".$payeeid;
$fh = fopen($url, 'r');
$data = fread($fh, 1024);
fclose($fh);
return $data;
}
function getPayeeDetails($payeeid)
{
$url = $this->apiURL."mname=GetPayeeDetails&p1=".$this->Username."&p2=".$this->Password."&p3=".$this->PartnerID."&p4=".$payeeid;
$fh = fopen($url, 'r');
$data = fread($fh, 1024);
fclose($fh);
$this->payee_details = $data;
$this->payee_status = 1;
}
function checkCardStatus($payeeid)
{
if($this->payee_status != 1)
{
$this->getPayeeDetails($payeeid);
}
$word1 = '<CardStatus>';
$word2 = '</CardStatus>';
$between= $this->get_string_between($this->payee_details, $word1, $word2);
return $between;
}
function checkCardActivation($payeeid)
{
if($this->payee_status != 1)
{
$this->getPayeeDetails($payeeid);
}
$word1 = '<ActivationStatus>';
$word2 = '</ActivationStatus>';
$between= $this->get_string_between($this->payee_details, $word1, $word2);
return $between;
}
}
?>