Initial Commit

main
Rick Kuzik 1 year ago
parent 5813b1109f
commit 43077b57ed
  1. 2
      .gitignore
  2. 15
      .htaccess
  3. 51
      404.php
  4. 18
      _showfile.php
  5. 324
      api.php
  6. 0
      cache/index.html
  7. 1842
      class/class.browser.php
  8. 28
      class/class.client.php
  9. 279
      class/class.clientlogin.php
  10. 263
      class/class.comment.php
  11. 2277
      class/class.db.php
  12. 7
      class/class.emoji.php
  13. 47
      class/class.export.php
  14. 734
      class/class.imap.php
  15. 161
      class/class.jakbase.php
  16. 568
      class/class.jaklic.php
  17. 84
      class/class.paginator.php
  18. 2272
      class/class.payment.php
  19. 285
      class/class.rewrite.php
  20. 45
      class/class.user.php
  21. 362
      class/class.userlogin.php
  22. 480
      class/emoji/Client.php
  23. 70
      class/emoji/ClientInterface.php
  24. 116
      class/emoji/Emojione.php
  25. 4934
      class/emoji/Ruleset.php
  26. 34
      class/emoji/RulesetInterface.php
  27. 0
      class/index.html
  28. 2606
      class/mime_parser.php
  29. 21
      class/payment/2checkout/LICENSE
  30. 310
      class/payment/2checkout/README.md
  31. 54
      class/payment/2checkout/lib/Twocheckout.php
  32. 25
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutAccount.php
  33. 55
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutApi.php
  34. 14
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutError.php
  35. 24
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutPayment.php
  36. 42
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutProduct.php
  37. 96
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutSale.php
  38. 74
      class/payment/2checkout/lib/Twocheckout/Api/TwocheckoutUtil.php
  39. 69
      class/payment/2checkout/lib/Twocheckout/TwocheckoutCharge.php
  40. 13
      class/payment/2checkout/lib/Twocheckout/TwocheckoutMessage.php
  41. 20
      class/payment/2checkout/lib/Twocheckout/TwocheckoutNotification.php
  42. 21
      class/payment/2checkout/lib/Twocheckout/TwocheckoutReturn.php
  43. 12
      class/payment/authorize/.gitignore
  44. 3
      class/payment/authorize/.gitmodules
  45. 17
      class/payment/authorize/.scrutinizer.yml
  46. 37
      class/payment/authorize/.travis.yml
  47. 4754
      class/payment/authorize/AnetApiSchema.xsd
  48. 9
      class/payment/authorize/CONTRIBUTING.md
  49. 41
      class/payment/authorize/LICENSE.txt
  50. 85
      class/payment/authorize/MIGRATING.md
  51. 178
      class/payment/authorize/README.md
  52. 18
      class/payment/authorize/autoload.php
  53. 302
      class/payment/authorize/classmap.php
  54. 11
      class/payment/authorize/lib/net/authorize/api/constants/ANetEnvironment.php
  55. 182
      class/payment/authorize/lib/net/authorize/api/contract/v1/ANetApiRequestType.php
  56. 180
      class/payment/authorize/lib/net/authorize/api/contract/v1/ANetApiResponseType.php
  57. 75
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBCancelSubscriptionRequest.php
  58. 61
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBCancelSubscriptionResponse.php
  59. 75
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBCreateSubscriptionRequest.php
  60. 115
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBCreateSubscriptionResponse.php
  61. 130
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionListRequest.php
  62. 151
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionListResponse.php
  63. 153
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionListSortingType.php
  64. 102
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionRequest.php
  65. 88
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionResponse.php
  66. 75
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionStatusRequest.php
  67. 88
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBGetSubscriptionStatusResponse.php
  68. 350
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBSubscriptionMaskedType.php
  69. 369
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBSubscriptionType.php
  70. 102
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBUpdateSubscriptionRequest.php
  71. 88
      class/payment/authorize/lib/net/authorize/api/contract/v1/ARBUpdateSubscriptionResponse.php
  72. 234
      class/payment/authorize/lib/net/authorize/api/contract/v1/ArbTransactionType.php
  73. 160
      class/payment/authorize/lib/net/authorize/api/contract/v1/ArrayOfSettingType.php
  74. 126
      class/payment/authorize/lib/net/authorize/api/contract/v1/AuDeleteType.php
  75. 288
      class/payment/authorize/lib/net/authorize/api/contract/v1/AuDetailsType.php
  76. 180
      class/payment/authorize/lib/net/authorize/api/contract/v1/AuResponseType.php
  77. 153
      class/payment/authorize/lib/net/authorize/api/contract/v1/AuUpdateType.php
  78. 48
      class/payment/authorize/lib/net/authorize/api/contract/v1/AuthenticateTestRequest.php
  79. 61
      class/payment/authorize/lib/net/authorize/api/contract/v1/AuthenticateTestResponse.php
  80. 261
      class/payment/authorize/lib/net/authorize/api/contract/v1/BankAccountMaskedType.php
  81. 288
      class/payment/authorize/lib/net/authorize/api/contract/v1/BankAccountType.php
  82. 349
      class/payment/authorize/lib/net/authorize/api/contract/v1/BatchDetailsType.php
  83. 666
      class/payment/authorize/lib/net/authorize/api/contract/v1/BatchStatisticType.php
  84. 234
      class/payment/authorize/lib/net/authorize/api/contract/v1/CardArtType.php
  85. 153
      class/payment/authorize/lib/net/authorize/api/contract/v1/CcAuthenticationType.php
  86. 130
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerPaymentProfileRequest.php
  87. 142
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerPaymentProfileResponse.php
  88. 210
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerProfileFromTransactionRequest.php
  89. 102
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerProfileRequest.php
  90. 271
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerProfileResponse.php
  91. 102
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerProfileTransactionRequest.php
  92. 117
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerProfileTransactionResponse.php
  93. 129
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerShippingAddressRequest.php
  94. 115
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateCustomerShippingAddressResponse.php
  95. 275
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateProfileResponseType.php
  96. 76
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateTransactionRequest.php
  97. 118
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreateTransactionResponse.php
  98. 261
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreditCardMaskedType.php
  99. 153
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreditCardSimpleType.php
  100. 153
      class/payment/authorize/lib/net/authorize/api/contract/v1/CreditCardTrackType.php
  101. Some files were not shown because too many files have changed in this diff Show More

2
.gitignore vendored

@ -1,6 +1,8 @@
# ---> Composer
composer.phar
/vendor/
.env
/install/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file

@ -0,0 +1,15 @@
# Development security
# Protect .git, .env files
<Files "\.*">
Order deny,allow
Deny From All
</Files>
# Clouddesk URL Support
RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
ErrorDocument 404 /404/

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="<?php echo $BT_LANGUAGE;?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Live Chat Business">
<title><?php echo $jkl["g2"];?> - <?php echo JAK_TITLE;?></title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="<?php echo BASE_URL;?>css/compress.css.php" media="screen">
<!--[if lt IE 9]>
<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php if ($jkl["rtlsupport"]) { ?>
<!-- RTL Support -->
<link rel="stylesheet" href="<?php echo BASE_URL;?>css/style-rtl.css?=<?php echo JAK_UPDATED;?>" type="text/css" media="screen">
<!-- End RTL Support -->
<?php } ?>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<?php echo BASE_URL;?>img/ico/favicon.ico">
</head>
<body>
<div class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo $_SERVER['REQUEST_URI'];?>"><?php echo $jkl["g2"];?></a> - <a class="navbar-brand" href="<?php echo BASE_URL;?>"><?php echo JAK_TITLE;?></a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<p><?php echo $jkl["e5"];?>
<ul>
<li><?php echo $jkl["e6"];?></li>
<li><?php echo $jkl["e7"];?></li>
<li><?php echo $jkl["e8"];?></li>
</ul>
</p>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,18 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 1.0 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2019 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
if (!file_exists('config.php')) die('[_showfile.php] config.php not exist');
require_once 'config.php';
$thedata = explode(":#:", jak_encrypt_decrypt($_GET["i"], false));
jak_load_external_file($thedata[0], $thedata[1], $thedata[2]);
?>

@ -0,0 +1,324 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.3 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2022 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
// Check if the file is accessed only via index.php if not stop the script from running
if (!defined('JAK_PREVENT_ACCESS')) die('You cannot access this file directly.');
// All the tables we need for this plugin
$jaktable = 'clients';
$jaktable1 = 'support_tickets';
$jaktable2 = 'ticket_answers';
$jakfield = 'email';
$errors = array();
// We need to check if the call is coming thru get
if ($_SERVER["REQUEST_METHOD"] == 'GET' && $page1) {
// Get the api and sid key
$api_key = hash_hmac('md5', FULL_SITE_DOMAIN.JAK_O_NUMBER, DB_PASS_HASH);
$api_key1 = hash_hmac('md5', JAK_O_NUMBER.FULL_SITE_DOMAIN, DB_PASS_HASH);
// Rebuild the decryption because of PHP 7.2
$query = "";
$c = base64_decode(strtr($page1, '._-', '+/='));
$ivlen = openssl_cipher_iv_length($cipher="AES-128-CBC");
$iv = substr($c, 0, $ivlen);
$hmac = substr($c, $ivlen, $sha2len=32);
$ciphertext_raw = substr($c, $ivlen+$sha2len);
$original_plaintext = openssl_decrypt($ciphertext_raw, $cipher, $api_key, $options=OPENSSL_RAW_DATA, $iv);
$calcmac = hash_hmac('sha256', $ciphertext_raw, $api_key, $as_binary=true);
if (hash_equals($hmac, $calcmac))//PHP 5.6+ timing attack safe comparison
{
$query = $original_plaintext;
}
parse_str($query, $jkp);
// Set the project id
$pid = $jkp['pid'] ? $jkp['pid'] : JAK_STANDARD_SUPPORT_DEP;
if ($jkp['sid'] = $api_key1) {
switch ($jkp['action']) {
case 'new':
$row = $jakdb->get($jaktable, ["id", "opid", "chat_dep", "support_dep", "faq_cat", "paid_until"], ["email" => $jkp['email']]);
if ($row) {
if ($row["opid"] != filter_var($jkp["mainopid"], FILTER_SANITIZE_NUMBER_INT)) exit();
// Ok we update the credits
if (JAK_BILLING_MODE == 1 && isset($jkp["credits"]) && !empty($jkp["credits"]) && $jkp["credits"] != 0) {
$jakdb->update($jaktable, ["credits[+]" => $jkp["credits"]], ["id" => $row["id"]]);
}
// We update the membership access
if (JAK_BILLING_MODE == 2 && isset($jkp["valid"]) && !empty($jkp["valid"])) {
// Get the new date
if (strtotime($row["paid_until"]) > time()) {
$paidunix = strtotime($jkp["valid"], strtotime($row["paid_until"]));
} else {
$paidunix = strtotime($jkp["valid"]);
}
$paidtill = date('Y-m-d', $paidunix);
$jakdb->update($jaktable, ["paid_until" => $paidtill], ["id" => $row["id"]]);
}
// Update the password
if (isset($jkp["pass"]) && !empty($jkp["pass"])) {
$jakdb->update($jaktable, ["password" => $jkp['pass']], ["id" => $row["id"]]);
}
// Update the chat departments if set so
if (isset($jkp["chatdep"]) && !empty($jkp["chatdep"])) {
$jakdb->update($jaktable, ["chat_dep" => $jkp['chatdep']], ["id" => $row["id"]]);
}
// Update the support departments if set so
if (isset($jkp["supportdep"]) && !empty($jkp["supportdep"])) {
$jakdb->update($jaktable, ["support_dep" => $jkp['supportdep']], ["id" => $row["id"]]);
}
// Update the faq categories if set so
if (isset($jkp["faqcat"]) && !empty($jkp["faqcat"])) {
$jakdb->update($jaktable, ["faq_cat" => $jkp['faqcat']], ["id" => $row["id"]]);
}
// Finally we update the rest
$jakdb->update($jaktable, ["name" => $jkp['name'], "email" => $jkp['email']], ["id" => $row["id"]]);
} else {
if (empty($jkp['name'])) {
$errors['e'] = $jkl['e'];
}
if (JAK_EMAIL_BLOCK) {
$blockede = explode(',', JAK_EMAIL_BLOCK);
if (in_array($jkp['email'], $blockede) || in_array(strrchr($jkp['email'], "@"), $blockede)) {
$errors['e1'] = $jkl['e10'];
}
}
if ($jkp['email'] == '' || !filter_var($jkp['email'], FILTER_VALIDATE_EMAIL)) {
$errors['e2'] = $jkl['e1'];
}
if (jak_field_not_exist(strtolower($jkp['email']),$jaktable,$jakfield)) {
$errors['e3'] = $jkl['hd35'];
}
if (count($errors) == 0) {
// We have no errors we insert the user
// create new password
if ($jkp["pass"]) {
$password = $jkl['hd58'];
$passcrypt = $jkp["pass"];
} else {
$password = jak_password_creator();
$passcrypt = hash_hmac('sha256', $password, DB_PASS_HASH);
}
$result = $jakdb->insert($jaktable, [
"opid" => filter_var($jkp["mainopid"], FILTER_SANITIZE_NUMBER_INT),
"chat_dep" => ($jkp["chatdep"] ? $jkp["chatdep"] : JAK_STANDARD_CHAT_DEP),
"support_dep" => ($jkp["supportdep"] ? $jkp["supportdep"] : JAK_STANDARD_SUPPORT_DEP),
"faq_cat" => ($jkp["faqcat"] ? $jkp["faqcat"] : JAK_STANDARD_FAQ_CAT),
"name" => filter_var($jkp["name"], FILTER_SANITIZE_FULL_SPECIAL_CHARS),
"email" => filter_var($jkp["email"], FILTER_SANITIZE_EMAIL),
"password" => $passcrypt,
"credits" => ($jkp["credits"] ? $jkp["credits"] : 0),
"paid_until" => ($jkp["valid"] ? $jkp["valid"] : "1980-05-06"),
"canupload" => 1,
"access" => 1,
"time" => $jakdb->raw("NOW()")]);
$uid = $jakdb->id();
// Get the email template
$nlhtml = file_get_contents(APP_PATH.'template/'.JAK_FRONT_TEMPLATE.'/email/index.html');
if (!$result) {
// We will need to inform the operator if set so
if (JAK_TICKET_INFORM_R) {
// Change fake vars into real ones.
$cssAtt = array('{emailcontent}', '{weburl}', '{title}', '{emailtpllogo}', '{emailtplcopy}');
$cssUrl = array("There has been an error when creating following user: ".$jkp['email'], BASE_URL, JAK_TITLE, JAK_EMAILTPLLOGO, JAK_EMAILTPLCOPY);
$nlcontent = str_replace($cssAtt, $cssUrl, $nlhtml);
$body = str_ireplace("[\]", "", $nlcontent);
// We need the reply to the department
$emailreply = "";
if (isset($HD_SUPPORT_DEPARTMENTS) && is_array($HD_SUPPORT_DEPARTMENTS)) foreach ($HD_SUPPORT_DEPARTMENTS as $v) {
if ($v["id"] == $accounts["depid"]) {
if ($v["email"]) $emailreply = $v["email"];
}
}
// Ok, we send the email // email address, cc email address, reply to, subject, message, attachment
jak_send_email($semail, explode(',', JAK_EMAILCC), $emailreply, JAK_TITLE.' - API Error', $body, "");
}
} else {
$newuserpath = APP_PATH.JAK_FILES_DIRECTORY.'/clients/'.$uid;
if (!is_dir($newuserpath)) {
mkdir($newuserpath, 0755);
copy(APP_PATH.JAK_FILES_DIRECTORY."/index.html", $newuserpath."/index.html");
}
// Change fake vars into real ones.
if (!empty($HD_ANSWERS) && is_array($HD_ANSWERS)) foreach ($HD_ANSWERS as $v) {
if ($v["msgtype"] == 14 && $v["lang"] == JAK_LANG) {
$phold = array('{url}', '{title}', '{cname}', '{cemail}', '{cpassword}', '{email}');
$replace = array(BASE_URL, JAK_TITLE, $jkp['name'], $jkp['email'], $password, JAK_EMAIL);
$regtext = str_replace($phold, $replace, $v["message"]);
break;
}
}
// Change fake vars into real ones.
$cssAtt = array('{emailcontent}', '{weburl}', '{title}', '{emailtpllogo}', '{emailtplcopy}');
$cssUrl = array($regtext, BASE_URL, JAK_TITLE, JAK_EMAILTPLLOGO, JAK_EMAILTPLCOPY);
$nlcontent = str_replace($cssAtt, $cssUrl, $nlhtml);
$body = str_ireplace("[\]", "", $nlcontent);
// Ok, we send the email // email address, cc email address, reply to, subject, message, attachment
jak_send_email($jkp['email'], "", "", JAK_TITLE.' - '.$jkl['hd33'], $body, "");
}
}
}
exit();
break;
case 'update':
// Collect the information from the old email address
$row = $jakdb->get($jaktable, ["id", "opid", "chat_dep", "support_dep", "faq_cat", "paid_until"], ["email" => $jkp['oldemail']]);
if ($row) {
if ($row["opid"] != filter_var($jkp["mainopid"], FILTER_SANITIZE_NUMBER_INT)) exit();
// Ok we update the credits
if (JAK_BILLING_MODE == 1 && isset($jkp["credits"]) && !empty($jkp["credits"]) && $jkp["credits"] != 0) {
$jakdb->update($jaktable, ["credits[+]" => $jkp["credits"]], ["id" => $row["id"]]);
}
// We update the membership access
if (JAK_BILLING_MODE == 2 && isset($jkp["valid"]) && !empty($jkp["valid"])) {
// Get the new date
if (strtotime($row["paid_until"]) > time()) {
$paidunix = strtotime($jkp["valid"], strtotime($row["paid_until"]));
} else {
$paidunix = strtotime($jkp["valid"]);
}
$paidtill = date('Y-m-d', $paidunix);
$jakdb->update($jaktable, ["paid_until" => $paidtill], ["id" => $row["id"]]);
}
// Update the password
if (isset($jkp["pass"]) && !empty($jkp["pass"])) {
$jakdb->update($jaktable, ["password" => $jkp['pass']], ["id" => $row["id"]]);
}
// Update the chat departments if set so
if (isset($jkp["chatdep"]) && !empty($jkp["chatdep"])) {
$jakdb->update($jaktable, ["chat_dep" => $jkp['chatdep']], ["id" => $row["id"]]);
}
// Update the support departments if set so
if (isset($jkp["supportdep"]) && !empty($jkp["supportdep"])) {
$jakdb->update($jaktable, ["support_dep" => $jkp['supportdep']], ["id" => $row["id"]]);
}
// Update the faq categories if set so
if (isset($jkp["faqcat"]) && !empty($jkp["faqcat"])) {
$jakdb->update($jaktable, ["faq_cat" => $jkp['faqcat']], ["id" => $row["id"]]);
}
// Finally we update the rest
$jakdb->update($jaktable, ["name" => $jkp['name'], "email" => $jkp['email']], ["id" => $row["id"]]);
}
exit();
break;
case 'delete':
$row = $jakdb->get($jaktable, ["id", "opid", "chat_dep", "support_dep", "faq_cat", "paid_until"], ["email" => $jkp['email']]);
if ($row) {
if ($row["opid"] != filter_var($jkp["mainopid"], FILTER_SANITIZE_NUMBER_INT)) exit();
$jakdb->delete($jaktable, ["id" => $row["id"]]);
// Delete Avatar and folder
$targetPath = APP_PATH.JAK_FILES_DIRECTORY.'/clients/'.$row["id"].'/';
$removedouble = str_replace("//","/",$targetPath);
foreach(glob($removedouble.'*.*') as $jak_unlink) {
@unlink($jak_unlink);
@unlink($targetPath);
}
// Find tickets from this user and set to 0
$jakdb->update($jaktable1, ["clientid" => 0], ["clientid" => $row["id"]]);
$jakdb->update($jaktable2, ["clientid" => 0], ["clientid" => $row["id"]]);
}
exit();
break;
default:
// We could print an error here
exit();
}
} else {
// Wrong api key we can print an error here
}
} else {
// Some access to the api but it failed
}
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,28 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 1.1.1 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2020 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class JAK_client {
private $data;
private $lsvar = 0;
public function __construct($row) {
$this->data = $row;
}
function getVar($lsvar) {
// Setting up an alias, so we don't have to write $this->data every time:
$d = $this->data;
return (isset($d[$lsvar]) && !empty($d[$lsvar]) ? $d[$lsvar] : false);
}
}
?>

@ -0,0 +1,279 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.2 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2023 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class JAK_clientlogin {
protected $name = '', $pass = '', $time = '';
var $email; //Username given on sign-up
public function __construct() {
$this->email = '';
}
function jakChecklogged() {
/* Check if user has been remembered */
if (isset($_COOKIE['jak_lcpc_cookname']) && isset($_COOKIE['jak_lcpc_cookid'])) {
$_SESSION['jak_lcpc_email'] = $_COOKIE['jak_lcpc_cookname'];
$_SESSION['jak_lcpc_idhash'] = $_COOKIE['jak_lcpc_cookid'];
}
/* Username and idhash have been set */
if (isset($_SESSION['jak_lcpc_email']) && isset($_SESSION['jak_lcpc_idhash']) && $_SESSION['jak_lcpc_email'] != $this->email) {
/* Confirm that email and userid are valid */
if (!JAK_clientlogin::jakConfirmidhash($_SESSION['jak_lcpc_email'], $_SESSION['jak_lcpc_idhash'])) {
/* Variables are incorrect, user not logged in */
unset($_SESSION['jak_lcpc_email']);
unset($_SESSION['jak_lcpc_idhash']);
return false;
}
// Return the user data
return JAK_clientlogin::jakUserinfo($_SESSION['jak_lcpc_email']);
/* User not logged in */
} else {
return false;
}
}
function jakCheckrestlogged($userid, $hash) {
/* UserID and Hash have been set */
global $jakdb;
$datauinfo = $jakdb->get("clients", "*", ["AND" => ["id" => $userid, "idhash" => $hash]]);
if (isset($datauinfo) && !empty($datauinfo)) {
// Return the user data
return $datauinfo;
/* User not logged in */
} else {
return false;
}
}
public static function jakCheckuserdata($email, $pass) {
// The new password encrypt with hash_hmac
$passcrypt = hash_hmac('sha256', $pass, DB_PASS_HASH);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
return false;
}
global $jakdb;
$datausr = $jakdb->get("clients", "id", ["AND" => ["email" => strtolower($email), "password" => $passcrypt, "access" => 1]]);
if ($datausr) {
return true;
} else {
return false;
}
}
public static function jakLogin($email, $pass, $remember) {
// The new password encrypt with hash_hmac
$passcrypt = hash_hmac('sha256', $pass, DB_PASS_HASH);
global $jakdb;
// Get the stuff out the database
$datausr = $jakdb->get("clients", ["idhash", "logins"], ["AND" => ["email" => $email, "password" => $passcrypt]]);
if ($datausr['logins'] % 10 == 0) {
// Generate new idhash
$nidhash = JAK_clientlogin::generateRandID();
} else {
if (isset($datausr['idhash']) && !empty($datausr['idhash']) && $datausr['idhash'] != "NULL") {
// Take old idhash
$nidhash = $datausr['idhash'];
} else {
// Generate new idhash
$nidhash = JAK_clientlogin::generateRandID();
}
}
// Set session in database
$jakdb->update("clients", ["session" => session_id(), "idhash" => $nidhash, "logins[+]" => 1, "forgot" => 0, "lastactivity" => time()], ["AND" => ["email" => $email, "password" => $passcrypt, "access" => 1]]);
$_SESSION['jak_lcpc_email'] = $email;
$_SESSION['jak_lcpc_idhash'] = $nidhash;
// Check if cookies are set previous (wrongly) and delete
if (isset($_COOKIE['jak_lcpc_cookname']) || isset($_COOKIE['jak_lcpc_cookid'])) {
JAK_base::jakCookie('jak_lcpc_cookname', $email, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
JAK_base::jakCookie('jak_lcpc_cookid', $nidhash, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
}
// Now check if remember is selected and set cookies new...
if ($remember) {
JAK_base::jakCookie('jak_lcpc_cookname', $email, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
JAK_base::jakCookie('jak_lcpc_cookid', $nidhash, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
}
}
public static function jakConfirmidhash($email, $idhash) {
global $jakdb;
if (isset($email) && !empty($email)) {
$datausr = $jakdb->get("clients", "idhash", ["AND" => ["email" => $email, "access" => 1]]);
if ($datausr) {
$datausr = stripslashes($datausr);
$idhash = stripslashes($idhash);
/* Validate that userid is correct */
if(!is_null($datausr) && $idhash == $datausr) {
return true; //Success! Username and idhash confirmed
}
}
}
return false;
}
public static function jakUserinfo($email) {
global $jakdb;
$datauinfo = $jakdb->get("clients", "*", ["AND" => ["email" => $email, "access" => 1]]);
if ($datauinfo) {
return $datauinfo;
} else {
return false;
}
}
public static function jakUpdatelastactivity($clientid) {
global $jakdb;
if (is_numeric($clientid)) $jakdb->update("clients", ["lastactivity" => time()], ["id" => $clientid]);
}
public static function jakForgotpassword($email, $time) {
global $jakdb;
if ($jakdb->has("clients", ["AND" => ["email" => $email, "access" => 1]])) {
if ($time != 0) $jakdb->update("clients", ["forgot" => $time], ["email" => $email]);
return true;
} else {
return false;
}
}
public static function jakForgotactive($forgotid) {
global $jakdb;
if ($jakdb->has("clients", ["AND" => ["forgot" => $forgotid, "access" => 1]])) {
return true;
} else
return false;
}
public static function jakForgotcheckuser($email, $forgotid) {
global $jakdb;
if ($jakdb->has("clients", ["AND" => ["email" => $email, "forgot" => $forgotid, "access" => 1]])) {
return true;
} else
return false;
}
public static function jakWriteloginlog($email, $url, $ip, $agent, $success) {
global $jakdb;
if ($success == 1) {
$jakdb->update("loginlog", ["access" => 1], ["AND" => ["ip" => $ip, "time" => $jakdb->raw("NOW()")]]);
} else {
$jakdb->insert("loginlog", ["name" => $email, "fromwhere" => $url, "usragent" => $agent, "ip" => $ip, "time" => $jakdb->raw("NOW()"), "access" => 0]);
}
}
public static function jakLogout($userid) {
global $jakdb;
// Delete cookies from this page
JAK_base::jakCookie('jak_lcpc_cookname', '', -JAK_COOKIE_TIME, JAK_COOKIE_PATH);
JAK_base::jakCookie('jak_lcpc_cookid', '', -JAK_COOKIE_TIME, JAK_COOKIE_PATH);
// Update Database to session NULL
$jakdb->update("clients", ["session" => $jakdb->raw("NULL"), "idhash" => $jakdb->raw("NULL")], ["id" => $userid]);
// Unset the main sessions
unset($_SESSION['jak_lcpc_email']);
unset($_SESSION['jak_lcpc_idhash']);
unset($_SESSION['jak_lcpc_lang']);
// Destroy session and generate new one for that user
session_destroy();
// Start new session
session_start();
session_regenerate_id();
}
public static function jakLogoutRest($userid) {
global $jakdb;
// Update Database to session NULL
$jakdb->update("clients", ["session" => $jakdb->raw("NULL"), "idhash" => $jakdb->raw("NULL")], ["id" => $userid]);
}
public static function generateRandStr($length) {
$randstr = "";
for($i=0; $i<$length; $i++){
$randnum = mt_rand(0,61);
if($randnum < 10){
$randstr .= chr($randnum+48);
}else if($randnum < 36){
$randstr .= chr($randnum+55);
}else{
$randstr .= chr($randnum+61);
}
}
return $randstr;
}
private static function generateRandID() {
return md5(JAK_clientlogin::generateRandStr(16));
}
}
?>

@ -0,0 +1,263 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 1.0.1 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2019 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class JAK_comment
{
private $data = array();
// Get the lang into the class
public function __construct($id, $field, $var, $ptime, $pdate, $admin, $nested = true) {
/*
/ The constructor
*/
global $jakdb;
$getID = $jakdata = array();
if ($admin) {
$result = $jakdb->select("blogcomments", ["[>]user" => ["operatorid" => "id"], "[>]clients" => ["clientid" => "id"]], ["blogcomments.id", "blogcomments.commentid", "blogcomments.message", "blogcomments.votes", "blogcomments.approve", "blogcomments.time", "blogcomments.session", "user.id(oid)", "user.name(oname)", "user.picture(opicture)", "clients.id(cid)", "clients.name(cname)", "clients.picture(cpicture)"], ["blogcomments.".$field => $id]);
} else {
$result = $jakdb->select("blogcomments", ["[>]user" => ["operatorid" => "id"], "[>]clients" => ["clientid" => "id"]], ["blogcomments.id", "blogcomments.commentid", "blogcomments.message", "blogcomments.votes", "blogcomments.approve", "blogcomments.time", "blogcomments.session", "user.id(oid)", "user.name(oname)", "user.picture(opicture)", "clients.id(cid)", "clients.name(cname)", "clients.picture(cpicture)"], ["AND" => ["OR" => ["blogcomments.session" => session_id(), "blogcomments.approve" => 1], "blogcomments.".$field => $id]]);
}
if (isset($result) && !empty($result)) foreach ($result as $row) {
if ($row['oid'] && $row['opicture'] && $row['opicture'] != "/standard.jpg") {
$row['avatar'] = BASE_URL.JAK_FILES_DIRECTORY.$row['opicture'];
} elseif ($row['cid'] && $row['cpicture'] && $row['cpicture'] != "/standard.jpg") {
$row['avatar'] = BASE_URL.JAK_FILES_DIRECTORY.'/'.$row['cpicture'];
} else {
$row['avatar'] = BASE_URL.JAK_FILES_DIRECTORY.'/standard.jpg';
}
$row['username'] = ($row['oname'] ? $row['oname'] : $row['cname']);
$row['created'] = JAK_base::jakTimesince($row['time'], $ptime, $pdate);
// Sanitize the message
$row["message"] = jak_secure_site($row['message']);
// There should be always a varname in categories and check if seo is valid
$row["parseurl1"] = JAK_rewrite::jakParseurl($var, 'del', $row['id']);
$row["parseurl2"] = JAK_rewrite::jakParseurl($var, 'report', $row['id']);
// collect each record into $jakdata
$jakdata[] = $row;
// Do we have nested comments
if ($nested) $getID = $row["id"];
}
// now we go nested because we have a reply
if ($nested && !empty($getID)) {
if ($admin) {
$resnes = $jakdb->select("blogcomments", ["[>]user" => ["operatorid" => "id"], "[>]clients" => ["clientid" => "id"]], ["blogcomments.id", "blogcomments.commentid", "blogcomments.message", "blogcomments.votes", "blogcomments.approve", "blogcomments.time", "blogcomments.session", "user.id(oid)", "user.name(oname)", "user.picture(opicture)", "clients.id(cid)", "clients.name(cname)", "clients.picture(cpicture)"], ["blogcomments.commentid" => [$getID]]);
} else {
$resnes = $jakdb->select("blogcomments", ["[>]user" => ["operatorid" => "id"], "[>]clients" => ["clientid" => "id"]], ["blogcomments.id", "blogcomments.commentid", "blogcomments.message", "blogcomments.votes", "blogcomments.approve", "blogcomments.time", "blogcomments.session", "user.id(oid)", "user.name(oname)", "user.picture(opicture)", "clients.id(cid)", "clients.name(cname)", "clients.picture(cpicture)"], ["AND" => ["OR" => ["blogcomments.session" => session_id(), "blogcomments.approve" => 1], "blogcomments.commentid" => [$getID]]]);
}
if (isset($resnes) && !empty($resnes)) foreach ($resnes as $nes) {
if ($nes['oid'] && $nes['opicture'] && $nes['opicture'] != "/standard.jpg") {
$nes['avatar'] = BASE_URL.JAK_FILES_DIRECTORY.$nes['opicture'];
} elseif ($row['cid'] && $nes['cpicture'] && $nes['cpicture'] != "/standard.jpg") {
$nes['avatar'] = BASE_URL.JAK_FILES_DIRECTORY.'/'.$nes['cpicture'];
} else {
$nes['avatar'] = BASE_URL.JAK_FILES_DIRECTORY.'/standard.jpg';
}
$nes['username'] = ($nes['oname'] ? $nes['oname'] : $nes['cname']);
$nes['created'] = JAK_base::jakTimesince($nes['time'], $ptime, $pdate, $timeago);
// Sanitize the message
$nes["message"] = jak_secure_site($nes['message']);
// There should be always a varname in categories and check if seo is valid
$nes["parseurl1"] = JAK_rewrite::jakParseurl($var, 'del', $nes['id']);
$nes["parseurl2"] = JAK_rewrite::jakParseurl($var, 'report', $nes['id']);
// collect each record into $jakdata
$jakdata[] = $nes;
}
}
$this->data = $jakdata;
}
public function get_comments()
{
// Setting up an alias, so we don't have to write $this->data every time:
$d = &$this->data;
return $d;
}
public function get_commentajax($lang) {
foreach($this->data as $d) {
if ($d['oid'] && $d['opicture'] && $d['opicture'] != '/standard.jpg') {
$avatar = '<img src="'.str_replace("class/", "", BASE_URL).JAK_FILES_DIRECTORY.$d['opicture'].'" alt="avatar">';
} elseif ($d['cid'] && $d['cpicture'] && $d['cpicture'] != '/standard.jpg') {
$avatar = '<img src="'.str_replace("class/", "", BASE_URL).JAK_FILES_DIRECTORY.'/'.$d['cpicture'].'" alt="avatar">';
} else {
$avatar = '<img src="'.str_replace("class/", "", BASE_URL).JAK_FILES_DIRECTORY.'/standard.jpg" alt="avatar">';
}
$approve = "";
if ($d['approve'] == 0) {
$approve = '<div class="alert alert-info">'.$lang.'</div>';
}
return '<div class="comment-wrapper">
<div class="comment-author">'.$avatar.' <span class="comment-user">'.($d['cname'] ? $d['cname'] : $d['oname']).'</span> <span class="comment-date">'.$d['created'].'</span></div>
<div class="com">'.stripslashes($d['message']).$approve.'</div>
</div>';
}
}
public function get_commentajax_modern($lang) {
foreach($this->data as $d) {
if ($d['oid'] && $d['opicture'] && $d['opicture'] != '/standard.jpg') {
$avatar = str_replace("class/", "", BASE_URL).JAK_FILES_DIRECTORY.'/operator/'.$d['opicture'];
} elseif ($d['cid'] && $d['cpicture'] && $d['cpicture'] != '/standard.jpg') {
$avatar = str_replace("class/", "", BASE_URL).JAK_FILES_DIRECTORY.'/'.$d['cpicture'];
} else {
$avatar = str_replace("class/", "", BASE_URL).JAK_FILES_DIRECTORY.'/standard.jpg';
}
$approve = "";
if ($d['approve'] == 0) {
$approve = '<div class="alert alert-info">'.$lang.'</div>';
}
return '<div class="media">
<a class="float-left" href="javascript:void(0)">
<div class="avatar">
<img class="media-object" src="'.$avatar.'" alt="'.($d['cname'] ? $d['cname'] : $d['oname']).'">
</div>
</a>
<div class="media-body">
<h4 class="media-heading">'.($d['cname'] ? $d['cname'] : $d['oname']).'
<small>'.$d['created'].'</small>
</h4>
<h6 class="text-muted"></h6>
'.stripslashes($d['message']).$approve.'
</div>
</div>';
}
}
public function get_total() {
// Setting up an alias, so we don't have to write $this->data every time:
$d = $this->data;
if ($d) {
foreach($d as $t) {
$total[] = $t['id'];
}
// get the total user in one var.
$total = count($total, COUNT_RECURSIVE);
} else {
$total = 0;
}
return $total;
}
public static function validate_form(&$arr, $maxpost, $epost, $maxtxt) {
/*
/ This method is used to validate the data sent via AJAX.
/
/ It return true/false depending on whether the data is valid, and populates
/ the $arr array passed as a paremter (notice the ampersand above) with
/ either the valid input data, or the error messages.
*/
global $jkv;
$errors = array();
$data = array();
// Using the filter with a custom callback function:
if (!($data['bmessage'] = filter_input(INPUT_POST, 'bmessage', FILTER_CALLBACK, array('options'=>'JAK_comment::validate_text')))) {
$errors['bmesssage'] = $epost;
}
// Subcomments
if (filter_input(INPUT_POST , 'comanswerid')) {
$data['comanswerid'] = filter_input(INPUT_POST , 'comanswerid');
}
// Subcomments
if (filter_input(INPUT_POST , 'editpostid')) {
$data['editpostid'] = filter_input(INPUT_POST , 'editpostid');
}
// Count comment charactars
if (!empty($maxpost)) {
$countI = strlen($data['bmessage']);
if ($countI > $maxpost) {
$errors['bmessage'] = $emaxpost.$maxpost.' '.sprintf($maxtxt,$countI);
}
}
if (!empty($errors)) {
// If there are errors, copy the $errors array to $arr:
$arr = $errors;
return false;
}
// If the data is valid, sanitize all the data and copy it to $arr:
foreach($data as $k=>$v) {
$arr[$k] = $v;
}
return true;
}
private static function validate_text($str)
{
/*
/ This method is used internally as a FILTER_CALLBACK
*/
if (mb_strlen($str, 'utf8') < 1) return false;
$str = htmlspecialchars($str);
// Remove the new line characters that are left
$str = str_replace(array(chr(10), chr(13)), '', $str);
return $str;
}
}
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,7 @@
<?php
require_once(__DIR__ . '/emoji/RulesetInterface.php');
require_once(__DIR__ . '/emoji/ClientInterface.php');
require_once(__DIR__ . '/emoji/Client.php');
require_once(__DIR__ . '/emoji/Ruleset.php');
require_once(__DIR__ . '/emoji/Emojione.php');
?>

@ -0,0 +1,47 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH # ||
|| # ----------------------------------------- # ||
|| # Copyright 2019 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class emailExport {
public static function createFile($arrays, $filename = 'chat_emails.csv') {
$string = '';
$b = 0;
foreach($arrays as $array) {
$val_array = array();
$key_array = array();
foreach($array as $key => $val) {
$key_array[] = $key;
$val = str_replace('"', '""', $val);
$val_array[] = "\"$val\"";
}
if($b == 0) {
$string .= implode(",", $key_array)."\n";
}
$string .= implode(",", $val_array)."\n";
$b++;
}
emailExport::downloadFile($string, $filename);
}
private static function downloadFile($string, $filename) {
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: private");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=$filename");
header("Accept-Ranges: bytes");
echo $string;
exit;
}
}
?>

@ -0,0 +1,734 @@
<?php
/**
* Helper class for imap access
*
* @package protocols
* @copyright Copyright (c) Tobias Zeising (http://www.aditu.de)
* @license GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html)
* @author Tobias Zeising <tobias.zeising@aditu.de>
* @modified JAKWEB / Version 1.2
*/
class Imap {
/**
* imap connection
*/
protected $imap = false;
/**
* mailbox url string
*/
protected $mailbox = "";
/**
* currentfolder
*/
protected $folder = "Inbox";
/**
* initialize imap helper
*
* @return void
* @param $mailbox imap_open string
* @param $username
* @param $password
* @param $encryption ssl or tls
*/
public function __construct($mailbox, $username, $password, $encryption = false) {
$enc = '';
if($encryption!=null && isset($encryption) && $encryption=='ssl')
$enc = '/imap/ssl/novalidate-cert';
else if($encryption!=null && isset($encryption) && $encryption=='tls')
$enc = '/imap/tls/novalidate-cert';
$this->mailbox = "{" . $mailbox . $enc . "}";
$this->imap = @imap_open($this->mailbox, $username, $password);
}
/**
* close connection
*/
function __destruct() {
if($this->imap !== false) imap_close($this->imap);
}
/**
* returns true after successfull connection
*
* @return bool true on success
*/
public function isConnected() {
return $this->imap !== false;
}
/**
* returns last imap error
*
* @return string error message
*/
public function getError() {
return imap_last_error();
}
/**
* select given folder
*
* @return bool successfull opened folder
* @param $folder name
*/
public function selectFolder($folder) {
$result = imap_reopen($this->imap, $this->mailbox . $folder);
if($result === true)
$this->folder = $folder;
return $result;
}
/**
* returns all available folders
*
* @return array with foldernames
*/
public function getFolders() {
$folders = imap_list($this->imap, $this->mailbox, "*");
return str_replace($this->mailbox, "", $folders);
}
/**
* returns the number of messages in the current folder
*
* @return int message count
*/
public function countMessages() {
return imap_num_msg($this->imap);
}
/**
* returns the number of unread messages in the current folder
*
* @return int message count
*/
public function countUnreadMessages() {
$result = imap_search($this->imap, 'UNSEEN');
if($result===false)
return 0;
return count($result);
}
/**
* returns unseen emails in the current folder
*
* @return array messages
* @param $withbody without body
*/
public function getUnreadMessages($withbody=true){
$emails = array();
$result = imap_search($this->imap, 'UNSEEN');
if($result){
foreach($result as $k=>$i){
$emails[]= $this->formatMessage($i, $withbody);
}
}
return $emails;
}
/**
* returns all emails in the current folder
*
* @return array messages
* @param $withbody without body
*/
public function getMessages($withbody = true) {
$count = $this->countMessages();
$emails = array();
for($i=1;$i<=$count;$i++) {
$emails[]= $this->formatMessage($i, $withbody);
}
// sort emails descending by date
// usort($emails, function($a, $b) {
// try {
// $datea = new \DateTime($a['date']);
// $dateb = new \DateTime($b['date']);
// } catch(\Exception $e) {
// return 0;
// }
// if ($datea == $dateb)
// return 0;
// return $datea < $dateb ? 1 : -1;
// });
return $emails;
}
/**
* returns email by given id
*
* @return array messages
* @param $id
* @param $withbody without body
*/
public function getMessage($id, $withbody = true) {
return $this->formatMessage($id, $withbody);
}
/**
* @param $id
* @param bool $withbody
* @return array
*/
protected function formatMessage($id, $withbody=true){
$header = imap_headerinfo($this->imap, $id);
// fetch unique uid
$uid = imap_uid($this->imap, $id);
// Get the header from simply
$fromname = $fromaddress = '';
foreach ($header->from as $id => $object) {
$fromname = $object->personal;
$fromaddress = $object->mailbox . "@" . $object->host;
}
// get email data
$subject = '';
if ( isset($header->subject) && strlen($header->subject) > 0 ) {
foreach(imap_mime_header_decode($header->subject) as $obj){
$subject .= $obj->text;
}
}
$subject = $this->convertToUtf8($subject);
$email = array(
'to' => isset($header->to) ? $this->arrayToAddress($header->to) : '',
'from' => $this->convertToUtf8($fromaddress),
'fromname' => $this->convertToUtf8($fromname),
'date' => $header->date,
'subject' => $subject,
'uid' => $uid,
'unread' => strlen(trim($header->Unseen))>0,
'answered' => strlen(trim($header->Answered))>0,
'deleted' => strlen(trim($header->Deleted))>0
);
if(isset($header->cc))
$email['cc'] = $this->arrayToAddress($header->cc);
// get email body
if($withbody===true) {
$body = $this->getBody($uid);
$email['body'] = $body['body'];
$email['html'] = $body['html'];
}
return $email;
}
/**
* delete given message
*
* @return bool success or not
* @param $id of the message
*/
public function deleteMessage($id) {
return $this->deleteMessages(array($id));
}
/**
* delete messages
*
* @return bool success or not
* @param $ids array of ids
*/
public function deleteMessages($ids) {
if( imap_mail_move($this->imap, implode(",", $ids), $this->getTrash(), CP_UID) == false)
return false;
return imap_expunge($this->imap);
}
/**
* move given message in new folder
*
* @return bool success or not
* @param $id of the message
* @param $target new folder
*/
public function moveMessage($id, $target) {
return $this->moveMessages(array($id), $target);
}
/**
* move given message in new folder
*
* @return bool success or not
* @param $ids array of message ids
* @param $target new folder
*/
public function moveMessages($ids, $target) {
if(imap_mail_move($this->imap, implode(",", $ids), $target, CP_UID)===false)
return false;
return imap_expunge($this->imap);
}
/**
* mark message as read
*
* @return bool success or not
* @param $id of the message
* @param $seen true = message is read, false = message is unread
*/
public function setUnseenMessage($id, $seen = true) {
$header = $this->getMessageHeader($id);
if($header==false)
return false;
$flags = "";
$flags .= (strlen(trim($header->Answered))>0 ? "\\Answered " : '');
$flags .= (strlen(trim($header->Flagged))>0 ? "\\Flagged " : '');
$flags .= (strlen(trim($header->Deleted))>0 ? "\\Deleted " : '');
$flags .= (strlen(trim($header->Draft))>0 ? "\\Draft " : '');
$flags .= (($seen == true) ? '\\Seen ' : ' ');
//echo "\n<br />".$id.": ".$flags;
imap_clearflag_full($this->imap, $id, '\\Seen', ST_UID);
return imap_setflag_full($this->imap, $id, trim($flags), ST_UID);
}
/**
* return content of messages attachment
*
* @return binary attachment
* @param $id of the message
* @param $index of the attachment (default: first attachment)
*/
public function getAttachment($id, $structureToExplore = null) {
$messageIndex = imap_msgno($this->imap, $id);
if ($structureToExplore != null) {
$structure = $structureToExplore;
} else {
$structure = imap_fetchstructure($this->imap, $messageIndex);
}
$attachments = array();
if (isset($structure->parts) && count($structure->parts)) {
for($i = 0; $i < count($structure->parts); $i++) {
if ($structure->parts && is_array($structure->parts[$i]) && count($structure->parts[$i])>0) {
$toAdd = $this->getAttachment($id, $structure->parts[$i]);
if (count($toAdd)>0) {
foreach ($toAdd as $att) array_push($attachments, $att);
}
}
$attachment = array(
'is_attachment' => false,
'filename' => '',
'name' => '',
'attachment' => ''
);
if ($structure->parts[$i]->ifdparameters) {
foreach($structure->parts[$i]->dparameters as $object) {
if(strtolower($object->attribute) == 'filename') {
$attachment['is_attachment'] = true;
$attachment['filename'] = $object->value;
}
}
}
if ($structure->parts[$i]->ifparameters) {
foreach($structure->parts[$i]->parameters as $object) {
if(strtolower($object->attribute) == 'name') {
$attachment['is_attachment'] = true;
$attachment['name'] = $object->value;
}
}
}
if ($attachment['is_attachment']) {
// get attachment body
// First we try the html body
$message = imap_fetchbody($this->imap, $messageIndex, $i+1.2);
if (empty($message)) {
// Then we try the text body
$message = imap_fetchbody($this->imap, $messageIndex, $i+1.1);
}
if (empty($message)) {
// Then we try the text body
$message = imap_fetchbody($this->imap, $messageIndex, $i+1);
}
switch ($structure->parts[$i]->encoding) {
case 0:
case 1:
$message = imap_8bit($message);
break;
case 2:
$message = imap_binary($message);
break;
case 3:
$message = base64_decode($message);
break;
case 4:
$message = quoted_printable_decode($message);
break;
case 5:
$message = imap_base64($message);
break;
}
$attachment['attachment'] = $message;
}
array_push($attachments,$attachment);
}
}
return $attachments;
}
/**
* add new folder
*
* @return bool success or not
* @param $name of the folder
* @param $subscribe immediately subscribe to folder
*/
public function addFolder($name, $subscribe = false) {
$success = imap_createmailbox($this->imap, $this->mailbox . $name);
if ($success && $subscribe) {
$success = imap_subscribe($this->imap, $this->mailbox . $name);
}
return $success;
}
/**
* remove folder
*
* @return bool success or not
* @param $name of the folder
*/
public function removeFolder($name) {
return imap_deletemailbox($this->imap, $this->mailbox . $name);
}
/**
* rename folder
*
* @return bool success or not
* @param $name of the folder
* @param $newname of the folder
*/
public function renameFolder($name, $newname) {
return imap_renamemailbox($this->imap, $this->mailbox . $name, $this->mailbox . $newname);
}
/**
* clean folder content of selected folder
*
* @return bool success or not
*/
public function purge() {
// delete trash and spam
if($this->folder==$this->getTrash() || strtolower($this->folder)=="spam") {
if(imap_delete($this->imap,'1:*')===false) {
return false;
}
return imap_expunge($this->imap);
// move others to trash
} else {
if( imap_mail_move($this->imap,'1:*', $this->getTrash()) == false)
return false;
return imap_expunge($this->imap);
}
}
/**
* returns all email addresses
*
* @return array with all email addresses or false on error
*/
public function getAllEmailAddresses() {
$saveCurrentFolder = $this->folder;
$emails = array();
foreach($this->getFolders() as $folder) {
$this->selectFolder($folder);
foreach($this->getMessages(false) as $message) {
$emails[] = $message['from'];
$emails = array_merge($emails, $message['to']);
if(isset($message['cc']))
$emails = array_merge($emails, $message['cc']);
}
}
$this->selectFolder($saveCurrentFolder);
return array_unique($emails);
}
/**
* save email in sent
*
* @return void
* @param $header
* @param $body
*/
public function saveMessageInSent($header, $body) {
return imap_append($this->imap, $this->mailbox . $this->getSent(), $header . "\r\n" . $body . "\r\n", "\\Seen");
}
/**
* explicitly close imap connection
*/
public function close() {
if($this->imap!==false)
imap_close($this->imap);
}
// protected helpers
/**
* get trash folder name or create new trash folder
*
* @return trash folder name
*/
protected function getTrash() {
foreach($this->getFolders() as $folder) {
if(strtolower($folder)==="trash" || strtolower($folder)==="papierkorb")
return $folder;
}
// no trash folder found? create one
$this->addFolder('Trash');
return 'Trash';
}
/**
* get sent folder name or create new sent folder
*
* @return sent folder name
*/
protected function getSent() {
foreach($this->getFolders() as $folder) {
if(strtolower($folder)==="sent" || strtolower($folder)==="gesendet")
return $folder;
}
// no sent folder found? create one
$this->addFolder('Sent');
return 'Sent';
}
/**
* fetch message by id
*
* @return header
* @param $id of the message
*/
protected function getMessageHeader($id) {
$count = $this->countMessages();
for($i=1;$i<=$count;$i++) {
$uid = imap_uid($this->imap, $i);
if($uid==$id) {
$header = imap_headerinfo($this->imap, $i);
return $header;
}
}
return false;
}
/**
* convert imap given address in string
*
* @return string in format "Name <email@bla.de>"
* @param $headerinfos the infos given by imap
*/
protected function toAddress($headerinfos) {
$email = "";
$name = "";
if(isset($headerinfos->mailbox) && isset($headerinfos->host)) {
$email = $headerinfos->mailbox . "@" . $headerinfos->host;
}
if(!empty($headerinfos->personal)) {
$name = imap_mime_header_decode($headerinfos->personal);
$name = $name[0]->text;
} else {
$name = $email;
}
$name = $this->convertToUtf8($name);
return $name . " <" . $email . ">";
}
/**
* converts imap given array of addresses in strings
*
* @return array with strings (e.g. ["Name <email@bla.de>", "Name2 <email2@bla.de>"]
* @param $addresses imap given addresses as array
*/
protected function arrayToAddress($addresses) {
$addressesAsString = array();
foreach($addresses as $address) {
$addressesAsString[] = $this->toAddress($address);
}
return $addressesAsString;
}
/**
* returns body of the email. First search for html version of the email, then the plain part.
*
* @return string email body
* @param $uid message id
*/
protected function getBody($uid) {
$body = $this->get_part($this->imap, $uid, "TEXT/PLAIN");
$html = false;
// if text body is empty, try getting text body
if ($body == "") {
$body = $this->get_part($this->imap, $uid, "TEXT/HTML");
$html = true;
}
$body = $this->convertToUtf8($body);
return array( 'body' => $body, 'html' => $html);
}
/**
* convert to utf8 if necessary.
*
* @return true or false
* @param $string utf8 encoded string
*/
protected function convertToUtf8($string) {
$newString = '';
$elements = imap_mime_header_decode($string);
for($i = 0; $i < count($elements); $i++) {
$newString .= $this->convertStringEncoding($elements[$i]->text);
}
return $newString;
}
/**
* Converts a string from one encoding to another.
* @param string $string
* @return string Converted string if conversion was successful, or the original string if not
*/
protected function convertStringEncoding($string) {
if (extension_loaded('mbstring') && mb_detect_encoding($string, "UTF-8, ISO-8859-1, GBK")!="UTF-8") {
$string = utf8_encode($string);
}
$string = iconv('UTF-8', 'UTF-8//IGNORE', $string);
return $string;
}
/**
* returns a part with a given mimetype
* taken from http://www.sitepoint.com/exploring-phps-imap-library-2/
*
* @return string email body
* @param $imap imap stream
* @param $uid message id
* @param $mimetype
*/
protected function get_part($imap, $uid, $mimetype, $structure = false, $partNumber = false) {
if (!$structure) {
$structure = imap_fetchstructure($imap, $uid, FT_UID);
}
if ($structure) {
if ($mimetype == $this->get_mime_type($structure)) {
if (!$partNumber) {
$partNumber = 1;
}
$text = imap_fetchbody($imap, $uid, $partNumber, FT_UID | FT_PEEK);
switch ($structure->encoding) {
case 3: return imap_base64($text);
case 4: return imap_qprint($text);
default: return $text;
}
}
// multipart
if ($structure->type == 1) {
foreach ($structure->parts as $index => $subStruct) {
$prefix = "";
if ($partNumber) {
$prefix = $partNumber . ".";
}
$data = $this->get_part($imap, $uid, $mimetype, $subStruct, $prefix . ($index + 1));
if ($data) {
return $data;
}
}
}
}
return false;
}
/**
* extract mimetype
* taken from http://www.sitepoint.com/exploring-phps-imap-library-2/
*
* @return string mimetype
* @param $structure
*/
protected function get_mime_type($structure) {
$primaryMimetype = array("TEXT", "MULTIPART", "MESSAGE", "APPLICATION", "AUDIO", "IMAGE", "VIDEO", "OTHER");
if ($structure->subtype) {
return $primaryMimetype[(int)$structure->type] . "/" . $structure->subtype;
}
return "TEXT/PLAIN";
}
/**
* Return general mailbox statistics
*
* @return bool | StdClass object
*/
public function getMailboxStatistics() {
return $this->isConnected() ? imap_mailboxmsginfo($this->imap) : false ;
}
}
?>

@ -0,0 +1,161 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.1 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2023 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
include_once 'class.rewrite.php';
class JAK_base
{
private $data = array();
private $usraccesspl = array();
private $case;
private $lsvar;
private $lsvar1;
protected $table = '', $itemid = '', $select = '', $where = '', $dseo = '';
// This constructor can be used for all classes:
public function __construct(array $options){
foreach($options as $k=>$v){
if(isset($this->$k)){
$this->$k = $v;
}
}
}
public static function pluralize($count, $text, $plural) {
return $count . ( ( $count == 1 ) ? ( " $text" ) : ( " {$plural}" ) );
}
public static function jakTimesince($mysqlstamp, $date, $time) {
$today = time(); /* Current unix time */
if (is_numeric($mysqlstamp)) {
$unixtime = $mysqlstamp;
//$mysqlstamp = date('Y-m-d H:i:s', $mysqlstamp);
} else {
$unixtime = strtotime($mysqlstamp);
}
// Return date time
return date(($date && $time ? $date.' ' : $date).$time, (int)$unixtime);
}
public static function jakCheckSession($convid, $restoreid)
{
global $jakdb;
if ($jakdb->has("sessions", ["id" => $convid, "uniqueid" => $restoreid, "status" => 1])) {
return true;
}
}
public static function jakWriteinCache($file, $content, $extra) {
if ($file && $content) {
if (isset($extra)) {
file_put_contents($file, $content, FILE_APPEND | LOCK_EX);
} else {
file_put_contents($file, $content, LOCK_EX);
}
return true;
}
}
public static function jakAvailableHours($hours,$available) {
$ohours = "";
if (isset($hours) && !empty($hours)) $ohours = json_decode($hours, true);
// get the php str
$dtime = new DateTime($available);
// Days of the week
$daysaweekid = array(0 => "Mon", 1 => "Tue", 2 => "Wed", 3 => "Thu", 4 => "Fri", 5 => "Sat", 6 => "Sun");
// Return the correct day
$day = array_search($dtime->format('D'), $daysaweekid);
$nobh = false;
// Check if the day is active and proceed
if (isset($ohours[$day]["isActive"]) && !empty($ohours[$day]["isActive"])) {
// Now we need to check the time
if (!empty($ohours[$day]["timeFrom"]) && !empty($ohours[$day]["timeTill"])) {
if ($ohours[$day]["timeTill"] == "24:00") $ohours[$day]["timeTill"] = "23.59";
if (($ohours[$day]["timeFrom"] <= $dtime->format('H:i')) && ($ohours[$day]["timeTill"] >= $dtime->format('H:i'))) $nobh = true;
}
if (!$nobh && !empty($ohours[$day]["timeFroma"]) && !empty($ohours[$day]["timeTilla"])) {
if ($ohours[$day]["timeTilla"] == "24:00") $ohours[$day]["timeTilla"] = "23.59";
if (($ohours[$day]["timeFroma"] <= $dtime->format('H:i')) && ($ohours[$day]["timeTilla"] >= $dtime->format('H:i'))) $nobh = true;
}
return $nobh;
} else {
return false;
}
}
public static function jakWhatslog($guestid, $opcache, $opid, $clientid, $whatsid, $itemid, $location, $email, $url, $ip, $agent) {
global $jakdb;
// We are calling the geo
if (isset($location) && !empty($location)) {
list($city, $country_name, $country_code, $country_lat, $country_lng) = explode('|', strip_tags(base64_decode($location)));
} else {
// Country Stuff
$country_name = 'Disabled';
$country_code = 'xx';
$city = 'Disabled';
$country_lng = $country_lat = '';
}
if ($whatsid == 2 || $whatsid == 5) {
$jakdb->update("whatslog", ["opid" => $opcache, "operatorid" => $opid, "clientid" => $clientid, "whatsid" => $whatsid], ["AND" => ["ip" => $ip, "name" => $email, "time" => $jakdb->raw("NOW()")]]);
} else {
$jakdb->insert("whatslog", ["guestid" => $guestid, "opid" => $opcache, "operatorid" => $opid, "clientid" => $clientid, "whatsid" => $whatsid, "itemid" => $itemid, "country" => $country_name, "city" => $city, "countrycode" => $country_code, "latitude" => $country_lat, "longitude" => $country_lng, "name" => $email, "fromwhere" => $url, "usragent" => $agent, "ip" => $ip, "time" => $jakdb->raw("NOW()")]);
}
return true;
}
public static function jakCookie($cookiename, $value, $expires, $path) {
if (version_compare(PHP_VERSION, '7.3', '>=')) {
setcookie($cookiename, $value, [
'expires' => time() + $expires,
'path' => $path,
'httponly' => true,
'samesite' => 'None',
'secure' => true]);
} else {
setcookie($cookiename, $value, time() + $expires, $path.'; SameSite=None; Secure');
}
}
}
?>

@ -0,0 +1,568 @@
<?php if(count(get_included_files()) == 1) exit("No direct script access allowed");
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.1 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2023 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
define("LB_API_DEBUG", false);
define("LB_SHOW_UPDATE_PROGRESS", true);
define("LB_TEXT_CONNECTION_FAILED", 'License Server is unavailable at the moment, please try again.');
define("LB_TEXT_INVALID_RESPONSE", 'Invalid license, please register bellow or contact <a href="https://jakweb.ch">support</a>.');
define("LB_TEXT_VERIFIED_RESPONSE", 'Verified! Thanks for purchasing Cloud Desk 3.');
define("LB_TEXT_PREPARING_MAIN_DOWNLOAD", 'Preparing to download main update...');
define("LB_TEXT_MAIN_UPDATE_SIZE", 'Main Update size:');
define("LB_TEXT_DONT_REFRESH", '(Please do not refresh the page).');
define("LB_TEXT_DOWNLOADING_MAIN", 'Downloading main update...');
define("LB_TEXT_UPDATE_PERIOD_EXPIRED", 'Your update period has ended or your license is invalid, please contact support.');
define("LB_TEXT_UPDATE_PATH_ERROR", 'Folder does not have write permission or the update file path could not be resolved, please contact support.');
define("LB_TEXT_MAIN_UPDATE_DONE", 'Main update files downloaded, extracted and installed.');
define("LB_TEXT_UPDATE_EXTRACTION_ERROR", 'Update zip extraction failed.');
define("LB_TEXT_PREPARING_SQL_DOWNLOAD", 'Preparing to download database update...');
define("LB_TEXT_SQL_UPDATE_SIZE", 'Database update size:');
define("LB_TEXT_DOWNLOADING_SQL", 'Downloading database update...');
define("LB_TEXT_SQL_UPDATE_DONE", 'Database update file downloaded.');
define("LB_TEXT_UPDATE_WITH_SQL_DONE", 'Update successful, files and database have been updated.');
define("LB_TEXT_UPDATE_WITHOUT_SQL_DONE", 'Update successful, files have been updated there were no database updates.');
if(!LB_API_DEBUG){
@ini_set('display_errors', 0);
}
if((@ini_get('max_execution_time')!=='0')&&(@ini_get('max_execution_time'))<600){
@ini_set('max_execution_time', 600);
}
@ini_set('memory_limit', '256M');
class JAKLicenseAPI{
private $product_id;
private $api_url;
private $api_key;
private $api_language;
private $current_version;
private $verify_type;
private $verification_period;
private $root_path;
private $license_file;
public function __construct(){
$this->product_id = 'CD3_CA82F2FF';
$this->api_url = 'https://license.jakweb.ch/';
$this->api_key = 'B505125128CDA848466F';
$this->api_language = 'english';
$this->current_version = 'v'.(defined('JAK_VERSION') ? JAK_VERSION : '');
$this->verify_type = 'envato';
$this->verification_period = 30;
$this->root_path = APP_PATH.JAK_FILES_DIRECTORY.'/updates/';
$this->license_file = APP_PATH.JAK_FILES_DIRECTORY.'/updates/.lic';
}
public function check_local_license_exist(){
return is_file($this->license_file);
}
public function get_current_version(){
return $this->current_version;
}
private function call_api($method, $url, $data){
$curl = curl_init();
switch ($method){
case "POST":
curl_setopt($curl, CURLOPT_POST, 1);
if($data)
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
break;
case "PUT":
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
if($data)
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
break;
default:
if($data)
$url = sprintf("%s?%s", $url, http_build_query($data));
}
$this_server_name = getenv('SERVER_NAME')?:
$_SERVER['SERVER_NAME']?:
getenv('HTTP_HOST')?:
$_SERVER['HTTP_HOST'];
$this_http_or_https = ((
(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS']=="on"))or
(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])and
$_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
)?'https://':'http://');
$this_url = $this_http_or_https.$this_server_name.$_SERVER['REQUEST_URI'];
$this_ip = getenv('SERVER_ADDR')?:
$_SERVER['SERVER_ADDR']?:
$this->get_ip_from_third_party()?:
gethostbyname(gethostname());
curl_setopt($curl, CURLOPT_HTTPHEADER,
array('Content-Type: application/json',
'LB-API-KEY: '.$this->api_key,
'LB-URL: '.$this_url,
'LB-IP: '.$this_ip,
'LB-LANG: '.$this->api_language)
);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$result = curl_exec($curl);
if(!$result&&!LB_API_DEBUG){
$rs = array(
'status' => FALSE,
'message' => LB_TEXT_CONNECTION_FAILED
);
return json_encode($rs);
}
$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if($http_status != 200){
if(LB_API_DEBUG){
$temp_decode = json_decode($result, true);
$rs = array(
'status' => FALSE,
'message' => ((!empty($temp_decode['error']))?
$temp_decode['error']:
$temp_decode['message'])
);
return json_encode($rs);
}else{
$rs = array(
'status' => FALSE,
'message' => LB_TEXT_INVALID_RESPONSE
);
return json_encode($rs);
}
}
curl_close($curl);
return $result;
}
public function check_connection(){
$data_array = array();
$get_data = $this->call_api(
'POST',
$this->api_url.'api/check_connection_ext',
json_encode($data_array)
);
$response = json_decode($get_data, true);
return $response;
}
public function get_latest_version(){
$data_array = array(
"product_id" => $this->product_id
);
$get_data = $this->call_api(
'POST',
$this->api_url.'api/latest_version',
json_encode($data_array)
);
$response = json_decode($get_data, true);
return $response;
}
public function activate_license($license, $client, $create_lic = true){
$data_array = array(
"product_id" => $this->product_id,
"license_code" => $license,
"client_name" => $client,
"verify_type" => $this->verify_type
);
$get_data = $this->call_api(
'POST',
$this->api_url.'api/activate_license',
json_encode($data_array)
);
$response = json_decode($get_data, true);
if(!empty($create_lic)){
if($response['status']){
$licfile = trim($response['lic_response']);
file_put_contents($this->license_file, $licfile, LOCK_EX);
}else{
@chmod($this->license_file, 0777);
if(is_writeable($this->license_file)){
unlink($this->license_file);
}
}
}
return $response;
}
public function verify_license($time_based_check = false, $license = false, $client = false){
if(!empty($license)&&!empty($client)){
$data_array = array(
"product_id" => $this->product_id,
"license_file" => null,
"license_code" => $license,
"client_name" => $client
);
}else{
if(is_file($this->license_file)){
$data_array = array(
"product_id" => $this->product_id,
"license_file" => file_get_contents($this->license_file),
"license_code" => null,
"client_name" => null
);
}else{
$data_array = array();
}
}
$res = array('status' => TRUE, 'message' => LB_TEXT_VERIFIED_RESPONSE);
if($time_based_check && $this->verification_period > 0){
ob_start();
if(session_status() == PHP_SESSION_NONE){
session_start();
}
$type = (int) $this->verification_period;
$today = date('d-m-Y');
if(empty($_SESSION["c7f9c6b8b03214d"])){
$_SESSION["c7f9c6b8b03214d"] = '00-00-0000';
}
if($type == 1){
$type_text = '1 day';
}elseif($type == 3){
$type_text = '3 days';
}elseif($type == 7){
$type_text = '1 week';
}elseif($type == 30){
$type_text = '1 month';
}elseif($type == 90){
$type_text = '3 months';
}elseif($type == 365) {
$type_text = '1 year';
}else{
$type_text = $type.' days';
}
if(strtotime($today) >= strtotime($_SESSION["c7f9c6b8b03214d"])){
$get_data = $this->call_api(
'POST',
$this->api_url.'api/verify_license',
json_encode($data_array)
);
$res = json_decode($get_data, true);
if($res['status']==true){
$tomo = date('d-m-Y', strtotime($today. ' + '.$type_text));
$_SESSION["c7f9c6b8b03214d"] = $tomo;
}
}
ob_end_clean();
}else{
$get_data = $this->call_api(
'POST',
$this->api_url.'api/verify_license',
json_encode($data_array)
);
$res = json_decode($get_data, true);
}
return $res;
}
public function deactivate_license($license = false, $client = false){
if(!empty($license)&&!empty($client)){
$data_array = array(
"product_id" => $this->product_id,
"license_file" => null,
"license_code" => $license,
"client_name" => $client
);
}else{
if(is_file($this->license_file)){
$data_array = array(
"product_id" => $this->product_id,
"license_file" => file_get_contents($this->license_file),
"license_code" => null,
"client_name" => null
);
}else{
$data_array = array();
}
}
$get_data = $this->call_api(
'POST',
$this->api_url.'api/deactivate_license',
json_encode($data_array)
);
$response = json_decode($get_data, true);
if($response['status']){
@chmod($this->license_file, 0777);
if(is_writeable($this->license_file)){
unlink($this->license_file);
}
}
return $response;
}
public function check_update(){
$data_array = array(
"product_id" => $this->product_id,
"current_version" => $this->current_version
);
$get_data = $this->call_api(
'POST',
$this->api_url.'api/check_update',
json_encode($data_array)
);
$response = json_decode($get_data, true);
return $response;
}
public function download_update($update_id, $type, $version, $license = false, $client = false){
if(!empty($license)&&!empty($client)){
$data_array = array(
"license_file" => null,
"license_code" => $license,
"client_name" => $client
);
}else{
if(is_file($this->license_file)){
$data_array = array(
"license_file" => file_get_contents($this->license_file),
"license_code" => null,
"client_name" => null
);
}else{
$data_array = array();
}
}
ob_end_flush();
ob_implicit_flush(true);
$version = str_replace(".", "_", $version);
ob_start();
$source_size = $this->api_url."api/get_update_size/main/".$update_id;
echo LB_TEXT_PREPARING_MAIN_DOWNLOAD."<br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "1%";document.getElementById("updprogval").textContent="1%";</script>';}
ob_flush();
echo LB_TEXT_MAIN_UPDATE_SIZE." ".$this->get_remote_filesize($source_size)." ".LB_TEXT_DONT_REFRESH."<br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "5%";document.getElementById("updprogval").textContent="5%";</script>';}
ob_flush();
$temp_progress = '';
$ch = curl_init();
$source = $this->api_url."api/download_update/main/".$update_id;
curl_setopt($ch, CURLOPT_URL, $source);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_array);
$this_server_name = getenv('SERVER_NAME')?:
$_SERVER['SERVER_NAME']?:
getenv('HTTP_HOST')?:
$_SERVER['HTTP_HOST'];
$this_http_or_https = ((
(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS']=="on"))or
(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])and
$_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
)?'https://':'http://');
$this_url = $this_http_or_https.$this_server_name.$_SERVER['REQUEST_URI'];
$this_ip = getenv('SERVER_ADDR')?:
$_SERVER['SERVER_ADDR']?:
$this->get_ip_from_third_party()?:
gethostbyname(gethostname());
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'LB-API-KEY: '.$this->api_key,
'LB-URL: '.$this_url,
'LB-IP: '.$this_ip,
'LB-LANG: '.$this->api_language)
);
if(LB_SHOW_UPDATE_PROGRESS){curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this, 'progress'));}
if(LB_SHOW_UPDATE_PROGRESS){curl_setopt($ch, CURLOPT_NOPROGRESS, false);}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
echo LB_TEXT_DOWNLOADING_MAIN."<br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "10%";document.getElementById("updprogval").textContent="10%";</script>';}
ob_flush();
$data = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($http_status != 200){
if($http_status == 401){
curl_close($ch);
exit("<br>".LB_TEXT_UPDATE_PERIOD_EXPIRED);
}else{
curl_close($ch);
exit("<br>".LB_TEXT_INVALID_RESPONSE);
}
}
curl_close($ch);
$destination = $this->root_path."/update_main_".$version.".zip";
$file = fopen($destination, "w+");
if(!$file){
exit("<br>".LB_TEXT_UPDATE_PATH_ERROR);
}
fputs($file, $data);
fclose($file);
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "65%";document.getElementById("updprogval").textContent="65%";</script>';}
ob_flush();
$zip = new ZipArchive;
$res = $zip->open($destination);
if($res === TRUE){
$zip->extractTo(APP_PATH);
$zip->close();
unlink($destination);
echo LB_TEXT_MAIN_UPDATE_DONE."<br><br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "75%";document.getElementById("updprogval").textContent="75%";</script>';}
ob_flush();
}else{
echo LB_TEXT_UPDATE_EXTRACTION_ERROR."<br><br>";
ob_flush();
}
if($type == true){
$source_size = $this->api_url."api/get_update_size/sql/".$update_id;
echo LB_TEXT_PREPARING_SQL_DOWNLOAD."<br>";
ob_flush();
echo LB_TEXT_SQL_UPDATE_SIZE." ".$this->get_remote_filesize($source_size)." ".LB_TEXT_DONT_REFRESH."<br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "85%";document.getElementById("updprogval").textContent="85%";</script>';}
ob_flush();
$temp_progress = '';
$ch = curl_init();
$source = $this->api_url."api/download_update/sql/".$update_id;
curl_setopt($ch, CURLOPT_URL, $source);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_array);
$this_server_name = getenv('SERVER_NAME')?:
$_SERVER['SERVER_NAME']?:
getenv('HTTP_HOST')?:
$_SERVER['HTTP_HOST'];
$this_http_or_https = ((
(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS']=="on"))or
(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])and
$_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
)?'https://':'http://');
$this_url = $this_http_or_https.$this_server_name.$_SERVER['REQUEST_URI'];
$this_ip = getenv('SERVER_ADDR')?:
$_SERVER['SERVER_ADDR']?:
$this->get_ip_from_third_party()?:
gethostbyname(gethostname());
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'LB-API-KEY: '.$this->api_key,
'LB-URL: '.$this_url,
'LB-IP: '.$this_ip,
'LB-LANG: '.$this->api_language)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
echo LB_TEXT_DOWNLOADING_SQL."<br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "90%";document.getElementById("updprogval").textContent="90%";</script>';}
ob_flush();
$data = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($http_status!=200){
curl_close($ch);
exit(LB_TEXT_INVALID_RESPONSE);
}
curl_close($ch);
$destination = $this->root_path."/update_sql_".$version.".sql";
$file = fopen($destination, "w+");
if(!$file){
exit(LB_TEXT_UPDATE_PATH_ERROR);
}
fputs($file, $data);
fclose($file);
// We run the real database update file
$dbupdatefile = APP_PATH.'update.php';
if (file_exists($dbupdatefile)) {
global $jakdb;
include($dbupdatefile);
unlink($dbupdatefile);
}
echo LB_TEXT_SQL_UPDATE_DONE."<br><br>";
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "100%";document.getElementById("updprogval").textContent="100%";</script>';}
echo LB_TEXT_UPDATE_WITH_SQL_DONE;
ob_flush();
}else{
if(LB_SHOW_UPDATE_PROGRESS){echo '<script>document.getElementById("updprog").style.width = "100%";document.getElementById("updprogval").textContent="100%";</script>';}
echo LB_TEXT_UPDATE_WITHOUT_SQL_DONE;
ob_flush();
}
ob_end_flush();
}
private function progress($resource, $download_size, $downloaded, $upload_size, $uploaded){
static $prev = 0;
if($download_size == 0){
$progress = 0;
}else{
$progress = round( $downloaded * 100 / $download_size );
}
if(($progress!=$prev) && ($progress == 25)){
$prev = $progress;
echo '<script>document.getElementById("updprog").style.width = "25%";document.getElementById("updprogval").textContent="25%";</script>';
ob_flush();
}
if(($progress!=$prev) && ($progress == 50)){
$prev=$progress;
echo '<script>document.getElementById("updprog").style.width = "50%";document.getElementById("updprogval").textContent="50%";</script>';
ob_flush();
}
if(($progress!=$prev) && ($progress == 75)){
$prev=$progress;
echo '<script>document.getElementById("updprog").style.width = "75%";document.getElementById("updprogval").textContent="75%";</script>';
ob_flush();
}
if(($progress!=$prev) && ($progress == 100)){
$prev=$progress;
echo '<script>document.getElementById("updprog").style.width = "100%";document.getElementById("updprogval").textContent="100%";</script>';
ob_flush();
}
}
private function get_ip_from_third_party(){
$curl = curl_init ();
curl_setopt($curl, CURLOPT_URL, "http://ipecho.net/plain");
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
private function get_remote_filesize($url){
$curl = curl_init();
curl_setopt($curl, CURLOPT_HEADER, TRUE);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_NOBODY, TRUE);
$this_server_name = getenv('SERVER_NAME')?:
$_SERVER['SERVER_NAME']?:
getenv('HTTP_HOST')?:
$_SERVER['HTTP_HOST'];
$this_http_or_https = ((
(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS']=="on"))or
(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])and
$_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
)?'https://':'http://');
$this_url = $this_http_or_https.$this_server_name.$_SERVER['REQUEST_URI'];
$this_ip = getenv('SERVER_ADDR')?:
$_SERVER['SERVER_ADDR']?:
$this->get_ip_from_third_party()?:
gethostbyname(gethostname());
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'LB-API-KEY: '.$this->api_key,
'LB-URL: '.$this_url,
'LB-IP: '.$this_ip,
'LB-LANG: '.$this->api_language)
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
$result = curl_exec($curl);
$filesize = curl_getinfo($curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
if ($filesize){
switch ($filesize){
case $filesize < 1024:
$size = $filesize .' B'; break;
case $filesize < 1048576:
$size = round($filesize / 1024, 2) .' KB'; break;
case $filesize < 1073741824:
$size = round($filesize / 1048576, 2) . ' MB'; break;
case $filesize < 1099511627776:
$size = round($filesize / 1073741824, 2) . ' GB'; break;
}
return $size;
}
}
}
?>

@ -0,0 +1,84 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.2 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2023 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
#[AllowDynamicProperties]
class JAK_Paginator{
var $items_total;
var $current_page;
var $num_pages;
var $mid_range;
var $low;
var $high;
var $limit;
var $return;
var $items_per_page;
var $jak_get_page;
var $jak_where;
var $jak_prevstyle = 'prev-button';
var $jak_nextstyle = 'next-button';
var $jak_prevtext = '&laquo;';
var $jak_nexttext = '&raquo;';
public function __construct()
{
$this->current_page = 1;
$this->mid_range = 3;
}
public function paginate()
{
$this->num_pages = ceil($this->items_total/$this->items_per_page);
$this->current_page = (int) $this->jak_get_page; // must be numeric > 0
if($this->current_page < 1 Or !is_numeric($this->current_page)) $this->current_page = 1;
if($this->current_page > $this->num_pages) $this->current_page = $this->num_pages;
$prev_page = $this->current_page-1;
$next_page = $this->current_page+1;
if($this->num_pages > 1) {
$this->return = ($this->current_page != 1 And $this->items_total >= 2) ? ' <nav aria-label="Page navigation"><ul class="pagination"><li class="page-item"><a class="page-link '.$this->jak_prevstyle.'" href="'.$this->jak_where.JAK_rewrite::jakParseurlpaginate($prev_page).'">'.$this->jak_prevtext.'</a></li>' : '<nav aria-label="Page navigation"><ul class="pagination">';
$this->start_range = $this->current_page - floor($this->mid_range/2);
$this->end_range = $this->current_page + floor($this->mid_range/2);
if($this->start_range <= 0)
{
$this->end_range += abs($this->start_range)+1;
$this->start_range = 1;
}
if($this->end_range > $this->num_pages)
{
$this->start_range -= $this->end_range-$this->num_pages;
$this->end_range = $this->num_pages;
}
$this->range = range($this->start_range,$this->end_range);
for($i=1;$i<=$this->num_pages;$i++)
{
// loop through all pages. if first, last, or in range, display
if($i==1 Or $i==$this->num_pages Or in_array($i,$this->range))
{
$this->return .= ($i == $this->current_page) ? '<li class="page-item active"><a class="page-link" title="Go to page '.$i.' of '.$this->num_pages.'" href="'.$this->jak_where.JAK_rewrite::jakParseurlpaginate($i).'">'.$i.'</a></li>' : '<li class="page-item"><a class="page-link" title="Go to page '.$i.' of '.$this->num_pages.'" href="'.$this->jak_where.JAK_rewrite::jakParseurlpaginate($i).'">'.$i.'</a></li>';
}
}
$this->return .= ($this->current_page != $this->num_pages And $this->items_total >= 2) ? '<li class="page-item"><a href="'.$this->jak_where.JAK_rewrite::jakParseurlpaginate($next_page).'" class="page-link">'.$this->jak_nexttext.'</a></li></ul></nav>' : '</ul></nav>';
}
$this->low = ($this->current_page-1) * $this->items_per_page;
$this->high = ($this->current_page * $this->items_per_page)-1;
$this->limit = [$this->low,$this->items_per_page];
}
public function display_pages()
{
return $this->return;
}
}
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,285 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.1 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2023 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class JAK_rewrite {
private $url_seg;
private $data = array();
// This constructor can be used for all classes:
public function __construct(
public string $url
) {}
function jakGetseg($var) {
if (isset($var)) {
if (JAK_USE_APACHE) {
$url = (defined('_APP_MAIN_DIR') ? str_replace(_APP_MAIN_DIR, '', $this->url) : str_replace(SITE_SUBFOLDER, '', $this->url));
$_tmp = explode('?', $url);
$url = $_tmp[0];
if ($url = explode('/', $url)) {
foreach ($url as $d) {
if ($d) {
$data[] = $d;
}
}
}
if (!empty($data[$var])) $url_seg = $data[$var];
} else {
// get the url and parse it
$parseurl = parse_url($this->url);
if (!empty($parseurl["query"])) {
// get only the query
$parameters = $parseurl["query"];
parse_str($parameters, $data);
// Now we have to set the array to basic keys
if (!empty($data)) foreach($data as $d) {
$data[] = $d;
}
if (!empty($data[$var])) $url_seg = $data[$var];
}
}
if (!empty($url_seg)) return $url_seg;
}
}
public static function jakCleanurl($str, $options = array()) {
$defaults = array(
'delimiter' => '-',
'limit' => null,
'lowercase' => true,
'replacements' => array(),
'transliterate' => true,
);
// Merge options
$options = array_merge($defaults, $options);
$char_map = array(
// Latin
'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C',
'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I',
'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ő' => 'O',
'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', 'Ý' => 'Y', 'Þ' => 'TH',
'ß' => 'ss',
'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'ae', 'ç' => 'c',
'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i',
'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ő' => 'o',
'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u', 'ű' => 'u', 'ý' => 'y', 'þ' => 'th',
'ÿ' => 'y',
// Latin symbols
'©' => '(c)',
// Greek
'Α' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Ζ' => 'Z', 'Η' => 'H', 'Θ' => '8',
'Ι' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => '3', 'Ο' => 'O', 'Π' => 'P',
'Ρ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'PS', 'Ω' => 'W',
'Ά' => 'A', 'Έ' => 'E', 'Ί' => 'I', 'Ό' => 'O', 'Ύ' => 'Y', 'Ή' => 'H', 'Ώ' => 'W', 'Ϊ' => 'I',
'Ϋ' => 'Y',
'α' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'ζ' => 'z', 'η' => 'h', 'θ' => '8',
'ι' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => '3', 'ο' => 'o', 'π' => 'p',
'ρ' => 'r', 'σ' => 's', 'τ' => 't', 'υ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'ps', 'ω' => 'w',
'ά' => 'a', 'έ' => 'e', 'ί' => 'i', 'ό' => 'o', 'ύ' => 'y', 'ή' => 'h', 'ώ' => 'w', 'ς' => 's',
'ϊ' => 'i', 'ΰ' => 'y', 'ϋ' => 'y', 'ΐ' => 'i',
// Turkish
'Ş' => 'S', 'İ' => 'I', 'Ç' => 'C', 'Ü' => 'U', 'Ö' => 'O', 'Ğ' => 'G',
'ş' => 's', 'ı' => 'i', 'ç' => 'c', 'ü' => 'u', 'ö' => 'o', 'ğ' => 'g',
// Russian
'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'Zh',
'З' => 'Z', 'И' => 'I', 'Й' => 'J', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O',
'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C',
'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sh', 'Ъ' => '', 'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu',
'Я' => 'Ya',
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh',
'з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o',
'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c',
'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu',
'я' => 'ya',
// Ukrainian
'Є' => 'Ye', 'І' => 'I', 'Ї' => 'Yi', 'Ґ' => 'G',
'є' => 'ye', 'і' => 'i', 'ї' => 'yi', 'ґ' => 'g',
// Czech
'Č' => 'C', 'Ď' => 'D', 'Ě' => 'E', 'Ň' => 'N', 'Ř' => 'R', 'Š' => 'S', 'Ť' => 'T', 'Ů' => 'U',
'Ž' => 'Z',
'č' => 'c', 'ď' => 'd', 'ě' => 'e', 'ň' => 'n', 'ř' => 'r', 'š' => 's', 'ť' => 't', 'ů' => 'u',
'ž' => 'z',
// Polish
'Ą' => 'A', 'Ć' => 'C', 'Ę' => 'e', 'Ł' => 'L', 'Ń' => 'N', 'Ó' => 'o', 'Ś' => 'S', 'Ź' => 'Z',
'Ż' => 'Z',
'ą' => 'a', 'ć' => 'c', 'ę' => 'e', 'ł' => 'l', 'ń' => 'n', 'ó' => 'o', 'ś' => 's', 'ź' => 'z',
'ż' => 'z',
// Latvian
'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N',
'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',
'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n',
'š' => 's', 'ū' => 'u', 'ž' => 'z'
);
// Make custom replacements
if (!empty($options['replacements'])) {
$str = preg_replace(array_keys($options['replacements']), $options['replacements'], $str);
}
// Transliterate characters to ASCII
if ($options['transliterate']) {
$str = str_replace(array_keys($char_map), $char_map, $str);
}
// Replace non-alphanumeric characters with our delimiter
$str = preg_replace('/[^\p{L}\p{Nd}]+/u', $options['delimiter'], $str);
// Remove duplicate delimiters
$str = preg_replace('/(' . preg_quote($options['delimiter'], '/') . '){2,}/', '$1', $str);
// Truncate slug to max. characters
$str = mb_substr($str, 0, ($options['limit'] ? $options['limit'] : mb_strlen($str, 'UTF-8')), 'UTF-8');
// Remove delimiter from ends
$str = trim($str, $options['delimiter']);
return $options['lowercase'] ? mb_strtolower($str, 'UTF-8') : $str;
}
public static function jakParseurl($var, $var1 = '', $var2 = '', $var3 = '', $var4 = '', $var5 = '', $var6 = '', $var7 = '')
{
// Global
global $BASE_URL;
// Set v to zero
$v = $v1 = $v2 = $v3 = $v4 = $v5 = $v6 = $v7 = $varname = '';
// Check if is/not apache and create url
if (!JAK_USE_APACHE) {
if ($var1) {
$v = '&amp;sp='.htmlspecialchars($var1);
}
if ($var2) {
$v1 = '&amp;ssp='.htmlspecialchars($var2);
}
if ($var3) {
$v2 = '&amp;sssp='.htmlspecialchars($var3);
}
if ($var4) {
$v3 = '&amp;ssssp='.htmlspecialchars($var4);
}
if ($var5) {
$v4 = '&amp;sssssp='.htmlspecialchars($var5);
}
if ($var6) {
$v5 = '&amp;sssssp='.htmlspecialchars($var6);
}
if ($var7) {
$v6 = '&amp;sssssp='.htmlspecialchars($var7);
}
// if not apache add some stuff to the url
if ($var) {
if ($var == JAK_OPERATOR_LOC) {
$var = JAK_OPERATOR_LOC.'/index.php?p='.htmlspecialchars($var1);
$varname = (defined('BASE_URL') ? BASE_URL : $BASE_URL).html_entity_decode($var.$v1.$v2.$v3.$v4.$v5.$v6);
} else {
$var = 'index.php?p='.htmlspecialchars($var);
$varname = (defined('BASE_URL') ? BASE_URL : $BASE_URL).html_entity_decode($var.$v.$v1.$v2.$v3.$v4.$v5.$v6);
}
} else {
$var = '/';
$varname = (defined('BASE_URL') ? BASE_URL : $BASE_URL).html_entity_decode($var.$v.$v1.$v2.$v3.$v4.$v5.$v6);
}
} else {
if ($var1) {
$v = '/'.htmlspecialchars($var1);
}
if ($var2) {
$v1 = '/'.htmlspecialchars($var2);
}
if ($var3) {
$v2 = '/'.htmlspecialchars($var3);
}
if ($var4) {
$v3 = '/'.htmlspecialchars($var4);
}
if ($var5) {
$v4 = '/'.htmlspecialchars($var5);
}
if ($var6) {
$v5 = '/'.htmlspecialchars($var6);
}
if ($var7) {
$v6 = '/'.htmlspecialchars($var7);
}
// page is always the same
$var = htmlspecialchars($var);
// Now se the var for apache
$varname = (defined('BASE_URL') ? BASE_URL : $BASE_URL).$var.$v.$v1.$v2.$v3.$v4.$v5.$v6;
}
if (!empty($varname)) return $varname;
}
public static function jakParseurlpaginate($var) {
$varname = '';
if ($var != 1) {
// Check if is/not apache and create url
if (!JAK_USE_APACHE && $var) {
// Now se the var for none apache
$varname = '&amp;page='.$var;
} else {
// Now se the var for seo apache
$varname = '/'.$var;
}
}
return $varname;
}
public function jakRealrequest()
{
return str_replace(_APP_MAIN_DIR, '', $this->url);
}
}
?>

@ -0,0 +1,45 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 1.1 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2020 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class JAK_user
{
private $data;
private $lsvar = 0;
private $username = '';
public function __construct($row) {
$this->data = $row;
}
function jakSuperadminaccess($lsvar) {
$useridarray = explode(',', JAK_SUPERADMIN);
// check if userid exist in db.php
if (in_array($lsvar, $useridarray)) {
return true;
} else {
return false;
}
}
function getVar($lsvar) {
// Setting up an alias, so we don't have to write $this->data every time:
$d = $this->data;
if (isset($d[$lsvar])) {
return $d[$lsvar];
} else {
return false;
}
}
}
?>

@ -0,0 +1,362 @@
<?php
/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 2.1.2 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2023 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/
class JAK_userlogin {
protected $name = '', $email = '', $pass = '', $time = '';
var $username; //Username given on sign-up
public function __construct() {
$this->username = '';
}
function jakChecklogged() {
/* Check if user has been remembered */
if (isset($_COOKIE['jak_lcp_cookname']) && isset($_COOKIE['jak_lcp_cookid'])) {
$_SESSION['jak_lcp_username'] = $_COOKIE['jak_lcp_cookname'];
$_SESSION['jak_lcp_idhash'] = $_COOKIE['jak_lcp_cookid'];
}
/* Username and idhash have been set */
if (isset($_SESSION['jak_lcp_username']) && isset($_SESSION['jak_lcp_idhash']) && $_SESSION['jak_lcp_username'] != $this->username) {
/* Confirm that username and userid are valid */
if (!JAK_userlogin::jakConfirmidhash($_SESSION['jak_lcp_username'], $_SESSION['jak_lcp_idhash'])) {
/* Variables are incorrect, user not logged in */
unset($_SESSION['jak_lcp_username']);
unset($_SESSION['jak_lcp_idhash']);
return false;
}
// Return the user data
return JAK_userlogin::jakUserinfo($_SESSION['jak_lcp_username']);
/* User not logged in */
} else {
return false;
}
}
function jakCheckrestlogged($userid, $hash) {
/* UserID and Hash have been set */
global $jakdb;
$datauinfo = $jakdb->get("user", "*", ["AND" => ["id" => $userid, "idhash" => $hash]]);
if (isset($datauinfo) && !empty($datauinfo)) {
// Return the user data
return $datauinfo;
/* User not logged in */
} else {
return false;
}
}
public static function jakCheckuserdata($username, $pass) {
// The new password encrypt with hash_hmac
$passcrypt = hash_hmac('sha256', $pass, DB_PASS_HASH);
if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
if (!preg_match('/^([a-zA-Z0-9\-_])+$/', $username)) {
return false;
}
}
global $jakdb;
$datausr = $jakdb->get("user", ["id", "username"], ["AND" => ["OR" => ["username" => strtolower($username), "email" => strtolower($username)], "password" => $passcrypt, "access" => 1]]);
if ($datausr) {
return $datausr;
} else {
return false;
}
}
public static function jakLogin($name, $pass, $remember) {
// The new password encrypt with hash_hmac
$passcrypt = hash_hmac('sha256', $pass, DB_PASS_HASH);
global $jakdb;
// Get the stuff out the database
$datausr = $jakdb->get("user", ["idhash", "logins"], ["AND" => ["username" => $name, "password" => $passcrypt]]);
if ($datausr['logins'] % 10 == 0) {
// Generate new idhash
$nidhash = JAK_userlogin::generateRandID();
} else {
if (isset($datausr['idhash']) && !empty($datausr['idhash']) && $datausr['idhash'] != "NULL") {
// Take old idhash
$nidhash = $datausr['idhash'];
} else {
// Generate new idhash
$nidhash = JAK_userlogin::generateRandID();
}
}
// Set session in database
$jakdb->update("user", ["session" => session_id(), "idhash" => $nidhash, "logins[+]" => 1, "available" => 1, "forgot" => 0, "lastactivity" => time()], ["AND" => ["username" => $name, "password" => $passcrypt]]);
$_SESSION['jak_lcp_username'] = $name;
$_SESSION['jak_lcp_idhash'] = $nidhash;
// Check if cookies are set previous (wrongly) and delete
if (isset($_COOKIE['jak_lcp_cookname']) || isset($_COOKIE['jak_lcp_cookid'])) {
JAK_base::jakCookie('jak_lcp_cookname', $name, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
JAK_base::jakCookie('jak_lcp_cookid', $nidhash, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
}
// Now check if remember is selected and set cookies new...
if ($remember) {
JAK_base::jakCookie('jak_lcp_cookname', $name, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
JAK_base::jakCookie('jak_lcp_cookid', $nidhash, JAK_COOKIE_TIME, JAK_COOKIE_PATH);
}
}
public static function jakrestLogin($name, $pass) {
// The new password encrypt with hash_hmac
$passcrypt = hash_hmac('sha256', $pass, DB_PASS_HASH);
global $jakdb;
// Get the stuff out the database
$datausr = $jakdb->get("user",["idhash", "logins"], ["AND" => ["username" => $name, "password" => $passcrypt]]);
if ($datausr['logins'] % 10 == 0) {
// Generate new idhash
$nidhash = JAK_userlogin::generateRandID();
} else {
if (isset($datausr['idhash']) && !empty($datausr['idhash']) && $datausr['idhash'] != "NULL") {
// Take old idhash
$nidhash = $datausr['idhash'];
} else {
// Generate new idhash
$nidhash = JAK_userlogin::generateRandID();
}
}
// Set session in database
$jakdb->update("user", ["session" => session_id(), "idhash" => $nidhash, "logins[+]" => 1, "available" => 1, "forgot" => 0, "lastactivity" => time()], ["AND" => ["username" => $name, "password" => $passcrypt]]);
// Return the user data
return JAK_userlogin::jakUserinfo($name);
}
public static function jakWriteDeviceToken($userid, $opid, $device, $token, $appname, $appversion) {
// Check the data before we run any queries
$allowed_device_types = ['ios', 'android'];
if (in_array($device, $allowed_device_types) === false) {
return false;
}
if ((strlen(trim($token)) === 0) || (strlen(trim($token)) > 250)) {
return false;
}
$allowed_app_versions = ['LC3', 'HD3'];
if (in_array($appname, $allowed_app_versions) === false) {
$appname = 'LC3';
}
// trim token
$token = trim($token);
global $jakdb;
// Get the info out the database
$pushid = $jakdb->get("push_notification_devices", "id", ["token" => $token]);
if (isset($pushid) && !empty($pushid)) {
$jakdb->update("push_notification_devices", ["lastedit" => $jakdb->raw("NOW()")], ["id" => $pushid]);
} else {
// We have no entry at all
$jakdb->insert("push_notification_devices", ["userid" => $userid, "opid" => $opid, "ostype" => $device, "token" => $token, "appname" => $appname, "appversion" => $appversion, "lastedit" => $jakdb->raw("NOW()"), "created" => $jakdb->raw("NOW()")]);
}
// Remove old entries older than 4 weeks
$deleteold = strtotime("-4 weeks");
$deleteoldmysql = date('Y-m-d H:i:s', $deleteold);
$jakdb->delete("push_notification_devices", ["lastedit[<]" => $deleteoldmysql]);
return true;
}
public static function jakConfirmidhash($username, $idhash) {
global $jakdb;
if (isset($username) && !empty($username)) {
$datausr = $jakdb->get("user","idhash",["AND" => ["username" => $username, "access" => 1]]);
if ($datausr) {
$datausr = stripslashes($datausr);
$idhash = stripslashes($idhash);
/* Validate that userid is correct */
if(!is_null($datausr) && $idhash == $datausr) {
return true; //Success! Username and idhash confirmed
}
}
}
return false;
}
public static function jakUserinfo($username) {
global $jakdb;
$datauinfo = $jakdb->get("user", "*", ["AND" => ["username" => $username, "access" => 1]]);
if ($datauinfo) {
return $datauinfo;
} else {
return false;
}
}
public static function jakUpdatelastactivity($userid) {
global $jakdb;
if (is_numeric($userid)) $jakdb->update("user", ["lastactivity" => time()], ["id" => $userid]);
}
public static function jakForgotpassword($email, $time) {
global $jakdb;
if ($jakdb->has("user", ["AND" => ["email" => $email, "access" => 1]])) {
if ($time != 0) $jakdb->update("user", ["forgot" => $time], ["email" => $email]);
return true;
} else {
return false;
}
}
public static function jakForgotactive($forgotid) {
global $jakdb;
if ($jakdb->has("user", ["AND" => ["forgot" => $forgotid, "access" => 1]])) {
return true;
} else
return false;
}
public static function jakForgotcheckuser($email, $forgotid) {
global $jakdb;
if ($jakdb->has("user", ["AND" => ["email" => $email, "forgot" => $forgotid, "access" => 1]])) {
return true;
} else
return false;
}
public static function jakWriteloginlog($username, $url, $ip, $agent, $success) {
global $jakdb;
if ($success == 1) {
$jakdb->update("loginlog", ["access" => 1], ["AND" => ["ip" => $ip, "time" => $jakdb->raw("NOW()")]]);
} else {
$jakdb->insert("loginlog", ["name" => $username, "fromwhere" => $url, "usragent" => $agent, "ip" => $ip, "time" => $jakdb->raw("NOW()"), "access" => 0]);
}
}
public static function jakLogout($userid) {
global $jakdb;
// Delete cookies from this page
JAK_base::jakCookie('jak_lcp_cookname', '', -JAK_COOKIE_TIME, JAK_COOKIE_PATH);
JAK_base::jakCookie('jak_lcp_cookid', '', - JAK_COOKIE_TIME, JAK_COOKIE_PATH);
// Update Database to session NULL
$jakdb->update("user", ["session" => $jakdb->raw("NULL"), "idhash" => $jakdb->raw("NULL"), "available" => 0], ["id" => $userid]);
// Unset the main sessions
unset($_SESSION['jak_lcp_username']);
unset($_SESSION['jak_lcp_idhash']);
unset($_SESSION['jak_lcp_lang']);
// Destroy session and generate new one for that user
session_destroy();
// Start new session
session_start();
session_regenerate_id();
}
public static function jakLogoutRest($userid) {
global $jakdb;
// Update Database to session NULL
$jakdb->update("user", ["session" => $jakdb->raw("NULL"), "idhash" => $jakdb->raw("NULL"), "available" => 0], ["id" => $userid]);
}
public static function generateRandStr($length) {
$randstr = "";
for($i=0; $i<$length; $i++){
$randnum = mt_rand(0,61);
if($randnum < 10){
$randstr .= chr($randnum+48);
}else if($randnum < 36){
$randstr .= chr($randnum+55);
}else{
$randstr .= chr($randnum+61);
}
}
return $randstr;
}
private static function generateRandID() {
return md5(JAK_userlogin::generateRandStr(16));
}
}
?>

@ -0,0 +1,480 @@
<?php
namespace Emojione;
/**
* Client for Emojione
*/
class Client implements ClientInterface
{
public $ascii = false; // convert ascii smileys?
public $unicodeAlt = true; // use the unicode char as the alt attribute (makes copy and pasting the resulting text better)
public $imageType = 'png'; // or svg
public $cacheBustParam = '?v=2.2.5';
public $sprites = false;
public $imagePathPNG = '//cdn.jsdelivr.net/emojione/assets/png/';
public $imagePathSVG = '//cdn.jsdelivr.net/emojione/assets/svg/';
public $imagePathSVGSprites = './../../assets/sprites/emojione.sprites.svg';
public $unicode_replaceWith = false;
public $ignoredRegexp = '<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>';
public $unicodeRegexp = '([*#0-9](?>\\xEF\\xB8\\x8F)?\\xE2\\x83\\xA3|\\xC2[\\xA9\\xAE]|\\xE2..(\\xF0\\x9F\\x8F[\\xBB-\\xBF])?(?>\\xEF\\xB8\\x8F)?|\\xE3(?>\\x80[\\xB0\\xBD]|\\x8A[\\x97\\x99])(?>\\xEF\\xB8\\x8F)?|\\xF0\\x9F(?>[\\x80-\\x86].(?>\\xEF\\xB8\\x8F)?|\\x87.\\xF0\\x9F\\x87.|..((\\xE2\\x80\\x8D\\xF0\\x9F\\x97\\xA8)|(\\xF0\\x9F\\x8F[\\xBB-\\xBF])|(\\xE2\\x80\\x8D\\xF0\\x9F\\x91[\\xA6-\\xA9]){2,3}|(\\xE2\\x80\\x8D\\xE2\\x9D\\xA4\\xEF\\xB8\\x8F\\xE2\\x80\\x8D\\xF0\\x9F..(\\xE2\\x80\\x8D\\xF0\\x9F\\x91[\\xA6-\\xA9])?))?))';
public $shortcodeRegexp = ':([-+\\w]+):';
protected $ruleset = null;
public function __construct(RulesetInterface $ruleset = null)
{
if ( ! is_null($ruleset) )
{
$this->ruleset = $ruleset;
}
}
// ##########################################
// ######## core methods
// ##########################################
/**
* First pass changes unicode characters into emoji markup.
* Second pass changes any shortnames into emoji markup.
*
* @param string $string The input string.
* @return string String with appropriate html for rendering emoji.
*/
public function toImage($string)
{
$string = $this->unicodeToImage($string);
$string = $this->shortnameToImage($string);
return $string;
}
/**
* Uses toShort to transform all unicode into a standard shortname
* then transforms the shortname into unicode.
* This is done for standardization when converting several unicode types.
*
* @param string $string The input string.
* @return string String with standardized unicode.
*/
public function unifyUnicode($string)
{
$string = $this->toShort($string);
$string = $this->shortnameToUnicode($string);
return $string;
}
/**
* This will output unicode from shortname input.
* If Client/$ascii is true it will also output unicode from ascii.
* This is useful for sending emojis back to mobile devices.
*
* @param string $string The input string.
* @return string String with unicode replacements.
*/
public function shortnameToUnicode($string)
{
$string = preg_replace_callback('/'.$this->ignoredRegexp.'|('.$this->shortcodeRegexp.')/Si', array($this, 'shortnameToUnicodeCallback'), $string);
if ($this->ascii)
{
$ruleset = $this->getRuleset();
$asciiRegexp = $ruleset->getAsciiRegexp();
$string = preg_replace_callback('/'.$this->ignoredRegexp.'|((\\s|^)'.$asciiRegexp.'(?=\\s|$|[!,.?]))/S', array($this, 'asciiToUnicodeCallback'), $string);
}
return $string;
}
/**
* This will replace shortnames with their ascii equivalent.
* ex. :wink: --> ;^)
* This is useful for systems that don't support unicode or images.
*
* @param string $string The input string.
* @return string String with ascii replacements.
*/
public function shortnameToAscii($string)
{
$string = preg_replace_callback('/'.$this->ignoredRegexp.'|('.$this->shortcodeRegexp.')/Si', array($this, 'shortnameToAsciiCallback'), $string);
return $string;
}
/**
* This will output image markup (for png or svg) from shortname input.
*
* @param string $string The input string.
* @return string String with appropriate html for rendering emoji.
*/
public function shortnameToImage($string)
{
$string = preg_replace_callback('/'.$this->ignoredRegexp.'|('.$this->shortcodeRegexp.')/Si', array($this, 'shortnameToImageCallback'), $string);
if ($this->ascii)
{
$ruleset = $this->getRuleset();
$asciiRegexp = $ruleset->getAsciiRegexp();
$string = preg_replace_callback('/'.$this->ignoredRegexp.'|((\\s|^)'.$asciiRegexp.'(?=\\s|$|[!,.?]))/S', array($this, 'asciiToImageCallback'), $string);
}
return $string;
}
/**
* This will return the shortname from unicode input.
*
* @param string $string The input string.
* @return string shortname
*/
public function toShort($string)
{
return preg_replace_callback('/'.$this->ignoredRegexp.'|'.$this->unicodeRegexp.'/S', array($this, 'toShortCallback'), $string);
}
/**
* This will output image markup (for png or svg) from unicode input.
*
* @param string $string The input string.
* @return string String with appropriate html for rendering emoji.
*/
public function unicodeToImage($string)
{
return preg_replace_callback('/'.$this->ignoredRegexp.'|'.$this->unicodeRegexp.'/S', array($this, 'unicodeToImageCallback'), $string);
}
// ##########################################
// ######## preg_replace callbacks
// ##########################################
/**
* @param array $m Results of preg_replace_callback().
* @return string Ascii replacement result.
*/
public function shortnameToAsciiCallback($m)
{
if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1])))
{
return $m[0];
}
else
{
$ruleset = $this->getRuleset();
$shortcode_replace = $ruleset->getShortcodeReplace();
$ascii_replace = $ruleset->getAsciiReplace();
$aflipped = array_flip($ascii_replace);
$shortname = $m[0];
if (!isset($shortcode_replace[$shortname]))
{
return $m[0];
}
$unicode = $shortcode_replace[$shortname];
return isset($aflipped[$unicode]) ? $aflipped[$unicode] : $m[0];
}
}
/**
* @param array $m Results of preg_replace_callback().
* @return string Unicode replacement result.
*/
public function shortnameToUnicodeCallback($m)
{
if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) {
return $m[0];
}
else {
$ruleset = $this->getRuleset();
$unicode_replace = $ruleset->getUnicodeReplace();
$shortname = $m[1];
if (!array_key_exists($shortname, $unicode_replace)) {
return $m[0];
}
$unicode = $unicode_replace[$shortname];
return $unicode;
}
}
/**
* @param array $m Results of preg_replace_callback().
* @return string Image HTML replacement result.
*/
public function shortnameToImageCallback($m)
{
if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1]))) {
return $m[0];
}
else {
$ruleset = $this->getRuleset();
$shortcode_replace = $ruleset->getShortcodeReplace();
$shortname = $m[1];
if (!isset($shortcode_replace[$shortname]))
{
return $m[0];
}
$unicode = $shortcode_replace[$shortname];
$filename = $unicode;
if ($this->unicodeAlt)
{
$alt = $this->convert($unicode);
}
else
{
$alt = $shortname;
}
if ($this->imageType == 'png')
{
if ($this->sprites)
{
return '<span class="emojione emojione-'.$unicode.'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>';
}
else
{
return '<img class="emojione" data-shortname="'.$shortname.'" alt="'.$alt.'" src="'.$this->imagePathPNG.$filename.'.png'.$this->cacheBustParam.'"/>';
}
}
if ($this->sprites)
{
return '<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.$this->imagePathSVGSprites.'#emoji-'.$unicode.'"></use></svg>';
}
else
{
return '<object class="emojione" data="'.$this->imagePathSVG.$filename.'.svg'.$this->cacheBustParam.'" type="image/svg+xml" standby="'.$alt.'">'.$alt.'</object>';
}
}
}
/**
* @param array $m Results of preg_replace_callback().
* @return string Unicode replacement result.
*/
public function asciiToUnicodeCallback($m)
{
if ((!is_array($m)) || (!isset($m[3])) || (empty($m[3])))
{
return $m[0];
}
else
{
$ruleset = $this->getRuleset();
$ascii_replace = $ruleset->getAsciiReplace();
$shortname = $m[3];
$unicode = $ascii_replace[$shortname];
return $m[2].$this->convert($unicode);
}
}
/**
* @param array $m Results of preg_replace_callback().
* @return string Image HTML replacement result.
*/
public function asciiToImageCallback($m)
{
if ((!is_array($m)) || (!isset($m[3])) || (empty($m[3])))
{
return $m[0];
}
else
{
$ruleset = $this->getRuleset();
$ascii_replace = $ruleset->getAsciiReplace();
$shortname = html_entity_decode($m[3]);
$unicode = $ascii_replace[$shortname];
// unicode char or shortname for the alt tag? (unicode is better for copying and pasting the resulting text)
if ($this->unicodeAlt)
{
$alt = $this->convert($unicode);
}
else
{
$alt = htmlspecialchars($shortname);
}
if ($this->imageType == 'png')
{
if ($this->sprites)
{
return $m[2].'<span class="emojione emojione-'.$unicode.'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>';
}
else
{
return $m[2].'<img class="emojione" alt="'.$alt.'" src="'.$this->imagePathPNG.$unicode.'.png'.$this->cacheBustParam.'"/>';
}
}
if ($this->sprites)
{
return $m[2].'<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.$this->imagePathSVGSprites.'#emoji-'.$unicode.'"></use></svg>';
}
else
{
return $m[2].'<object class="emojione" data="'.$this->imagePathSVG.$unicode.'.svg'.$this->cacheBustParam.'" type="image/svg+xml" standby="'.$alt.'">'.$alt.'</object>';
}
}
}
/**
* @param array $m Results of preg_replace_callback().
* @return string shortname result
*/
public function toShortCallback($m)
{
if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1])))
{
return $m[0];
}
else
{
$ruleset = $this->getRuleset();
$unicode_replace = $ruleset->getUnicodeReplace();
$unicode = $m[1];
if (!in_array($unicode, $unicode_replace))
{
$unicode .= "\xEF\xB8\x8F";
if (!in_array($unicode, $unicode_replace))
{
$unicode = substr($m[1], 0, 4);
if (!in_array($unicode, $unicode_replace))
{
return $m[0];
}
}
}
return array_search($unicode, $unicode_replace);
}
}
/**
* @param array $m Results of preg_replace_callback().
* @return string Image HTML replacement result.
*/
public function unicodeToImageCallback($m)
{
if ((!is_array($m)) || (!isset($m[1])) || (empty($m[1])))
{
return $m[0];
}
else
{
$ruleset = $this->getRuleset();
$shortcode_replace = $ruleset->getShortcodeReplace();
$unicode_replace = $ruleset->getUnicodeReplace();
$unicode = $m[1];
if (!in_array($unicode, $unicode_replace))
{
$unicode .= "\xEF\xB8\x8F";
if (!in_array($unicode, $unicode_replace))
{
$unicode = substr($m[1], 0, 4);
if (!in_array($unicode, $unicode_replace))
{
return $m[0];
}
}
}
$shortname = array_search($unicode, $unicode_replace);
$filename = $shortcode_replace[$shortname];
if ($this->unicodeAlt)
{
$alt = $unicode;
}
else
{
$alt = $shortname;
}
if ($this->imageType == 'png')
{
if ($this->sprites)
{
return '<span class="emojione emojione-'.$filename.'" title="'.htmlspecialchars($shortname).'">'.$alt.'</span>';
}
else
{
return '<img class="emojione" alt="'.$alt.'" src="'.$this->imagePathPNG.$filename.'.png'.$this->cacheBustParam.'"/>';
}
}
if ($this->sprites)
{
return '<svg class="emojione"><description>'.$alt.'</description><use xlink:href="'.$this->imagePathSVGSprites.'#emoji-'.$filename.'"></use></svg>';
}
else
{
return '<object class="emojione" data="'.$this->imagePathSVG.$filename.'.svg'.$this->cacheBustParam.'" type="image/svg+xml" standby="'.$alt.'">'.$alt.'</object>';
}
}
}
// ##########################################
// ######## helper methods
// ##########################################
/**
* Converts from unicode to hexadecimal NCR.
*
* @param string $unicode unicode character/s
* @return string hexadecimal NCR
* */
public function convert($unicode)
{
if (stristr($unicode,'-'))
{
$pairs = explode('-',$unicode);
return '&#x'.implode(';&#x',$pairs).';';
}
else
{
return '&#x'.$unicode.';';
}
}
/**
* Get the Ruleset
*
* @return RulesetInterface The Ruleset
*/
public function getRuleset()
{
if ( $this->ruleset === null )
{
$this->ruleset = new Ruleset;
}
return $this->ruleset;
}
}

@ -0,0 +1,70 @@
<?php
namespace Emojione;
interface ClientInterface
{
/**
* First pass changes unicode characters into emoji markup.
* Second pass changes any shortnames into emoji markup.
*
* @param string $string The input string.
* @return string String with appropriate html for rendering emoji.
*/
public function toImage($string);
/**
* Uses toShort to transform all unicode into a standard shortname
* then transforms the shortname into unicode.
* This is done for standardization when converting several unicode types.
*
* @param string $string The input string.
* @return string String with standardized unicode.
*/
public function unifyUnicode($string);
/**
* This will output unicode from shortname input.
* If Client/$ascii is true it will also output unicode from ascii.
* This is useful for sending emojis back to mobile devices.
*
* @param string $string The input string.
* @return string String with unicode replacements.
*/
public function shortnameToUnicode($string);
/**
* This will replace shortnames with their ascii equivalent.
* ex. :wink: --> ;^)
* This is useful for systems that don't support unicode or images.
*
* @param string $string The input string.
* @return string String with ascii replacements.
*/
public function shortnameToAscii($string);
/**
* This will output image markup (for png or svg) from shortname input.
*
* @param string $string The input string.
* @return string String with appropriate html for rendering emoji.
*/
public function shortnameToImage($string);
/**
* This will return the shortname from unicode input.
*
* @param string $string The input string.
* @return string shortname
*/
public function toShort($string);
/**
* This will output image markup (for png or svg) from unicode input.
*
* @param string $string The input string.
* @return string String with appropriate html for rendering emoji.
*/
public function unicodeToImage($string);
}

@ -0,0 +1,116 @@
<?php
namespace Emojione;
class Emojione
{
public static $ascii = false; // convert ascii smileys?
public static $unicodeAlt = true; // use the unicode char as the alt attribute (makes copy and pasting the resulting text better)
public static $imageType = 'png';
public static $cacheBustParam = '?v=2.2.5';
public static $sprites = false;
public static $imagePathPNG = '//cdn.jsdelivr.net/emojione/assets/png/';
public static $imagePathSVG = '//cdn.jsdelivr.net/emojione/assets/svg/';
public static $imagePathSVGSprites = './../../assets/sprites/emojione.sprites.svg';
public static $ignoredRegexp = '<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>';
public static $unicodeRegexp = '([*#0-9](?>\\xEF\\xB8\\x8F)?\\xE2\\x83\\xA3|\\xC2[\\xA9\\xAE]|\\xE2..(\\xF0\\x9F\\x8F[\\xBB-\\xBF])?(?>\\xEF\\xB8\\x8F)?|\\xE3(?>\\x80[\\xB0\\xBD]|\\x8A[\\x97\\x99])(?>\\xEF\\xB8\\x8F)?|\\xF0\\x9F(?>[\\x80-\\x86].(?>\\xEF\\xB8\\x8F)?|\\x87.\\xF0\\x9F\\x87.|..((\\xE2\\x80\\x8D\\xF0\\x9F\\x97\\xA8)|(\\xF0\\x9F\\x8F[\\xBB-\\xBF])|(\\xE2\\x80\\x8D\\xF0\\x9F\\x91[\\xA6-\\xA9]){2,3}|(\\xE2\\x80\\x8D\\xE2\\x9D\\xA4\\xEF\\xB8\\x8F\\xE2\\x80\\x8D\\xF0\\x9F..(\\xE2\\x80\\x8D\\xF0\\x9F\\x91[\\xA6-\\xA9])?))?))';
public static $shortcodeRegexp = ':([-+\\w]+):';
protected static $client = null;
/**
* Magic caller
*
* @throws \BadMethodCallException If the method doesn't exists in client
*/
public static function __callStatic($method, $args)
{
$client = static::getClient();
// DEPRECATED
static::updateConfig($client);
if ( ! method_exists($client, $method) )
{
throw new \BadMethodCallException('The method "' . $method . '" does not exist.');
}
return call_user_func_array(array($client, $method), $args);
}
/**
* Get the Client
*
* @return ClientInterface The Client
*/
public static function getClient()
{
if ( static::$client === null )
{
static::setClient(new Client);
}
return static::$client;
}
/**
* Set the Client
*
* @param ClientInterface $client The Client
* @return void
*/
public static function setClient(ClientInterface $client)
{
// DEPRECATED
static::loadConfig($client);
static::$client = $client;
}
/**
* Load config from Client
*
* @deprecated
*
* @param ClientInterface $client The Client
* @return self
*/
protected static function loadConfig(ClientInterface $client)
{
static::$ascii = $client->ascii;
static::$unicodeAlt = $client->unicodeAlt;
static::$imageType = $client->imageType;
static::$cacheBustParam = $client->cacheBustParam;
static::$sprites = $client->sprites;
static::$imagePathPNG = $client->imagePathPNG;
static::$imagePathSVG = $client->imagePathSVG;
static::$imagePathSVGSprites = $client->imagePathSVGSprites;
static::$ignoredRegexp = $client->ignoredRegexp;
static::$unicodeRegexp = $client->unicodeRegexp;
static::$shortcodeRegexp = $client->shortcodeRegexp;
}
/**
* Update config in Client
*
* @deprecated
*
* @param ClientInterface $client The Client
* @return self
*/
protected static function updateConfig(ClientInterface $client)
{
$client->ascii = static::$ascii;
$client->unicodeAlt = static::$unicodeAlt;
$client->imageType = static::$imageType;
$client->cacheBustParam = static::$cacheBustParam;
$client->sprites = static::$sprites;
$client->imagePathPNG = static::$imagePathPNG;
$client->imagePathSVG = static::$imagePathSVG;
$client->imagePathSVGSprites = static::$imagePathSVGSprites;
$client->ignoredRegexp = static::$ignoredRegexp;
$client->unicodeRegexp = static::$unicodeRegexp;
$client->shortcodeRegexp = static::$shortcodeRegexp;
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,34 @@
<?php
namespace Emojione;
interface RulesetInterface
{
/**
* Returns the shortcode unicode replacement rules
*
* @return array The shortcode unicode rules
*/
public function getShortcodeReplace();
/**
* Returns the ascii unicode replacement rules
*
* @return array The ascii unicode rules
*/
public function getAsciiReplace();
/**
* Returns the unicode shortcode replacement rules
*
* @return array The unicode shortcode rules
*/
public function getUnicodeReplace();
/**
* Returns the regexp to find ascii smilies
*
* @return string The regexp
*/
public function getAsciiRegexp();
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2012 - 2Checkout.com, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,310 @@
2Checkout PHP Library
=====================
This library provides developers with a simple set of bindings to the 2Checkout Payment API, Hosted Checkout, Instant Notification Service and Admin API.
To use, download or clone the repository.
```shell
git clone https://github.com/2Checkout/2checkout-php.git
```
Require in your php script.
```php
require_once("/path/to/2checkout-php/lib/Twocheckout.php");
```
All methods return an Array by default or you can set the format to 'json' to get a JSON response.
**Example:**
```php
<?php
Twocheckout::format('json');
```
Credentials and Options
-----------------
Methods are provided to set the following credentials and options.
```php
<?php
// Your sellerId(account number) and privateKey are required to make the Payment API Authorization call.
Twocheckout::privateKey('BE632CB0-BB29-11E3-AFB6-D99C28100996');
Twocheckout::sellerId('901248204');
// Your username and password are required to make any Admin API call.
Twocheckout::username('testlibraryapi901248204');
Twocheckout::password('testlibraryapi901248204PASS');
// If you want to turn off SSL verification (Please don't do this in your production environment)
Twocheckout::verifySSL(false); // this is set to true by default
// To use your sandbox account set sandbox to true
Twocheckout::sandbox(true);
// All methods return an Array by default or you can set the format to 'json' to get a JSON response.
Twocheckout::format('json');
```
Full documentation for each binding is provided in the **[wiki](https://github.com/2Checkout/2checkout-php/wiki)**.
Example Payment API Usage
-----------------
*Example Request:*
```php
<?php
Twocheckout::privateKey('BE632CB0-BB29-11E3-AFB6-D99C28100996');
Twocheckout::sellerId('901248204');
try {
$charge = Twocheckout_Charge::auth(array(
"sellerId" => "901248204",
"merchantOrderId" => "123",
"token" => 'MjFiYzIzYjAtYjE4YS00ZmI0LTg4YzYtNDIzMTBlMjc0MDlk',
"currency" => 'USD',
"total" => '10.00',
"billingAddr" => array(
"name" => 'Testing Tester',
"addrLine1" => '123 Test St',
"city" => 'Columbus',
"state" => 'OH',
"zipCode" => '43123',
"country" => 'USA',
"email" => 'testingtester@2co.com',
"phoneNumber" => '555-555-5555'
),
"shippingAddr" => array(
"name" => 'Testing Tester',
"addrLine1" => '123 Test St',
"city" => 'Columbus',
"state" => 'OH',
"zipCode" => '43123',
"country" => 'USA',
"email" => 'testingtester@2co.com',
"phoneNumber" => '555-555-5555'
)
));
$this->assertEquals('APPROVED', $charge['response']['responseCode']);
} catch (Twocheckout_Error $e) {
$this->assertEquals('Unauthorized', $e->getMessage());
}
```
*Example Response:*
```php
Array
(
[validationErrors] =>
[exception] =>
[response] => Array
(
[type] => AuthResponse
[lineItems] => Array
(
[0] => Array
(
[options] => Array
(
)
[price] => 10.00
[quantity] => 1
[recurrence] =>
[startupFee] =>
[productId] =>
[tangible] => N
[name] => 123
[type] => product
[description] =>
[duration] =>
)
)
[transactionId] => 205181140830
[billingAddr] => Array
(
[addrLine1] => 123 Test St
[addrLine2] =>
[city] => Columbus
[zipCode] => 43123
[phoneNumber] => 555-555-5555
[phoneExtension] =>
[email] => testingtester@2co.com
[name] => Testing Tester
[state] => OH
[country] => USA
)
[shippingAddr] => Array
(
[addrLine1] => 123 Test St
[addrLine2] =>
[city] => Columbus
[zipCode] => 43123
[phoneNumber] =>
[phoneExtension] =>
[email] =>
[name] => Testing Tester
[state] => OH
[country] => USA
)
[merchantOrderId] => 123
[orderNumber] => 205181140821
[recurrentInstallmentId] =>
[responseMsg] => Successfully authorized the provided credit card
[responseCode] => APPROVED
[total] => 10.00
[currencyCode] => USD
[errors] =>
)
)
```
Example Admin API Usage
-----------------
*Example Request:*
```php
<?php
Twocheckout::username('testlibraryapi901248204');
Twocheckout::password('testlibraryapi901248204PASS');
$args = array(
'sale_id' => 4834917619
);
try {
$result = Twocheckout_Sale::stop($args);
} catch (Twocheckout_Error $e) {
$e->getMessage();
}
```
*Example Response:*
```php
<?php
[response_code] => OK
[response_message] => Array
(
[0] => 4834917634
[1] => 4834917646
[2] => 4834917658
)
```
Example Checkout Usage:
-----------------------
*Example Request:*
```php
<?php
$params = array(
'sid' => '1817037',
'mode' => '2CO',
'li_0_name' => 'Test Product',
'li_0_price' => '0.01'
);
Twocheckout_Charge::form($params, 'auto');
```
*Example Response:*
```php
<form id="2checkout" action="https://www.2checkout.com/checkout/spurchase" method="post">
<input type="hidden" name="sid" value="1817037"/>
<input type="hidden" name="mode" value="2CO"/>
<input type="hidden" name="li_0_name" value="Test Product"/>
<input type="hidden" name="li_0_price" value="0.01"/>
<input type="submit" value="Click here if you are not redirected automatically" /></form>
<script type="text/javascript">document.getElementById('2checkout').submit();</script>
```
Example Return Usage:
---------------------
*Example Request:*
```php
<?php
$params = array();
foreach ($_REQUEST as $k => $v) {
$params[$k] = $v;
}
$passback = Twocheckout_Return::check($params, "tango");
```
*Example Response:*
```php
<?php
[response_code] => Success
[response_message] => Hash Matched
```
Example INS Usage:
------------------
*Example Request:*
```php
<?php
$params = array();
foreach ($_POST as $k => $v) {
$params[$k] = $v;
}
$passback = Twocheckout_Notification::check($params, "tango");
```
*Example Response:*
```php
<?php
[response_code] => Success
[response_message] => Hash Matched
```
Exceptions:
-----------
Twocheckout_Error exceptions are thrown by if an error has returned. It is best to catch these exceptions so that they can be gracefully handled in your application.
*Example Usage*
```php
<?php
Twocheckout::username('testlibraryapi901248204');
Twocheckout::password('testlibraryapi901248204PASS');
$params = array(
'sale_id' => 4774380224,
'category' => 1,
'comment' => 'Order never sent.'
);
try {
$sale = Twocheckout_Sale::refund($params);
} catch (Twocheckout_Error $e) {
$e->getMessage();
}
```
Full documentation for each binding is provided in the **[wiki](https://github.com/2Checkout/2checkout-php/wiki)**.

@ -0,0 +1,54 @@
<?php
abstract class Twocheckout
{
public static $sid;
public static $privateKey;
public static $username;
public static $password;
public static $verifySSL = true;
public static $baseUrl = 'https://www.2checkout.com';
public static $error;
public static $format = 'array';
const VERSION = '0.4.0';
public static function sellerId($value = null) {
self::$sid = $value;
}
public static function privateKey($value = null) {
self::$privateKey = $value;
}
public static function username($value = null) {
self::$username = $value;
}
public static function password($value = null) {
self::$password = $value;
}
public static function verifySSL($value = null) {
if ($value == 0 || $value == false) {
self::$verifySSL = false;
} else {
self::$verifySSL = true;
}
}
public static function format($value = null) {
self::$format = $value;
}
}
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutAccount.php');
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutPayment.php');
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutApi.php');
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutSale.php');
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutProduct.php');
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutUtil.php');
require(dirname(__FILE__) . '/Twocheckout/Api/TwocheckoutError.php');
require(dirname(__FILE__) . '/Twocheckout/TwocheckoutReturn.php');
require(dirname(__FILE__) . '/Twocheckout/TwocheckoutNotification.php');
require(dirname(__FILE__) . '/Twocheckout/TwocheckoutCharge.php');
require(dirname(__FILE__) . '/Twocheckout/TwocheckoutMessage.php');

@ -0,0 +1,25 @@
<?php
class Twocheckout_Company extends Twocheckout
{
public static function retrieve()
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/acct/detail_company_info';
$result = $request->doCall($urlSuffix);
return Twocheckout_Util::returnResponse($result);
}
}
class Twocheckout_Contact extends Twocheckout
{
public static function retrieve()
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/acct/detail_contact_info';
$result = $request->doCall($urlSuffix);
return Twocheckout_Util::returnResponse($result);
}
}

@ -0,0 +1,55 @@
<?php
class Twocheckout_Api_Requester
{
public $baseUrl;
public $environment;
private $user;
private $pass;
private $sid;
private $privateKey;
function __construct() {
$this->user = Twocheckout::$username;
$this->pass = Twocheckout::$password;
$this->sid = Twocheckout::$sid;
$this->baseUrl = Twocheckout::$baseUrl;
$this->verifySSL = Twocheckout::$verifySSL;
$this->privateKey = Twocheckout::$privateKey;
}
function doCall($urlSuffix, $data=array())
{
$url = $this->baseUrl . $urlSuffix;
$ch = curl_init($url);
if (isset($data['api'])) {
unset( $data['api'] );
$data['privateKey'] = $this->privateKey;
$data['sellerId'] = $this->sid;
$data = json_encode($data);
$header = array("content-type:application/json","content-length:".strlen($data));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
} else {
$header = array("Accept: application/json");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "{$this->user}:{$this->pass}");
}
if ($this->verifySSL == false) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, "2Checkout PHP/0.1.0%s");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($ch);
curl_close($ch);
if ($resp === FALSE) {
throw new Twocheckout_Error("cURL call failed", "403");
} else {
return utf8_encode($resp);
}
}
}

@ -0,0 +1,14 @@
<?php
class Twocheckout_Error extends Exception
{
public function __construct($message, $code = 0)
{
parent::__construct($message, $code);
}
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
}

@ -0,0 +1,24 @@
<?php
class Twocheckout_Payment extends Twocheckout
{
public static function retrieve()
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/acct/list_payments';
$result = $request->doCall($urlSuffix);
$response = Twocheckout_Util::returnResponse($result);
return $response;
}
public static function pending()
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/acct/detail_pending_payment';
$result = $request->doCall($urlSuffix);
$response = Twocheckout_Util::returnResponse($result);
return $response;
}
}

@ -0,0 +1,42 @@
<?php
class Twocheckout_Product extends Twocheckout
{
public static function create($params=array())
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/products/create_product';
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
public static function retrieve($params=array())
{
$request = new Twocheckout_Api_Requester();
if(array_key_exists("product_id",$params)) {
$urlSuffix = '/api/products/detail_product';
} else {
$urlSuffix = '/api/products/list_products';
}
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
public static function update($params=array())
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/products/update_product';
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
public static function delete($params=array())
{
$request = new Twocheckout_Api_Requester();
$urlSuffix = '/api/products/delete_product';
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
}

@ -0,0 +1,96 @@
<?php
class Twocheckout_Sale extends Twocheckout
{
public static function retrieve($params=array())
{
$request = new Twocheckout_Api_Requester();
if(array_key_exists("sale_id",$params) || array_key_exists("invoice_id",$params)) {
$urlSuffix = '/api/sales/detail_sale';
} else {
$urlSuffix = '/api/sales/list_sales';
}
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
public static function refund($params=array()) {
$request = new Twocheckout_Api_Requester();
if(array_key_exists("lineitem_id",$params)) {
$urlSuffix ='/api/sales/refund_lineitem';
$result = $request->doCall($urlSuffix, $params);
} elseif(array_key_exists("invoice_id",$params) || array_key_exists("sale_id",$params)) {
$urlSuffix ='/api/sales/refund_invoice';
$result = $request->doCall($urlSuffix, $params);
} else {
$result = Twocheckout_Message::message('Error', 'You must pass a sale_id, invoice_id or lineitem_id to use this method.');
}
return Twocheckout_Util::returnResponse($result);
}
public static function stop($params=array()) {
$request = new Twocheckout_Api_Requester();
$urlSuffix ='/api/sales/stop_lineitem_recurring';
if(array_key_exists("lineitem_id",$params)) {
$result = $request->doCall($urlSuffix, $params);
} elseif(array_key_exists("sale_id",$params)) {
$result = Twocheckout_Sale::retrieve($params);
if (!is_array($result)) {
$result = Twocheckout_Util::returnResponse($result, 'array');
}
$lineitemData = Twocheckout_Util::getRecurringLineitems($result);
if (isset($lineitemData[0])) {
$stoppedLineitems = array();
foreach( $lineitemData as $value )
{
$params = array('lineitem_id' => $value);
$result = $request->doCall($urlSuffix, $params);
$result = json_decode($result, true);
if ($result['response_code'] == "OK") {
$stoppedLineitems[] = $value;
}
}
$result = Twocheckout_Message::message('OK', $stoppedLineitems);
} else {
throw new Twocheckout_Error("No recurring lineitems to stop.");
}
} else {
throw new Twocheckout_Error('You must pass a sale_id or lineitem_id to use this method.');
}
return Twocheckout_Util::returnResponse($result);
}
public static function active($params=array()) {
if(array_key_exists("sale_id",$params)) {
$result = Twocheckout_Sale::retrieve($params);
if (!is_array($result)) {
$result = Twocheckout_Util::returnResponse($result, 'array');
}
$lineitemData = Twocheckout_Util::getRecurringLineitems($result);
if (isset($lineitemData[0])) {
$result = Twocheckout_Message::message('OK', $lineitemData);
return Twocheckout_Util::returnResponse($result);
} else {
throw new Twocheckout_Error("No active recurring lineitems.");
}
} else {
throw new Twocheckout_Error("You must pass a sale_id to use this method.");
}
}
public static function comment($params=array()) {
$request = new Twocheckout_Api_Requester();
$urlSuffix ='/api/sales/create_comment';
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
public static function ship($params=array()) {
$request = new Twocheckout_Api_Requester();
$urlSuffix ='/api/sales/mark_shipped';
$result = $request->doCall($urlSuffix, $params);
return Twocheckout_Util::returnResponse($result);
}
}

@ -0,0 +1,74 @@
<?php
class Twocheckout_Util extends Twocheckout
{
static function returnResponse($contents, $format=null) {
$format = $format == null ? Twocheckout::$format : $format;
switch ($format) {
case "array":
$response = self::objectToArray($contents);
self::checkError($response);
break;
case "force_json":
$response = self::objectToJson($contents);
break;
default:
$response = self::objectToArray($contents);
self::checkError($response);
$response = json_encode($contents);
$response = json_decode($response);
}
return $response;
}
public static function objectToArray($object)
{
$object = json_decode($object, true);
$array=array();
foreach($object as $member=>$data)
{
$array[$member]=$data;
}
return $array;
}
public static function objectToJson($object)
{
return json_encode($object);
}
public static function getRecurringLineitems($saleDetail) {
$i = 0;
$invoiceData = array();
while (isset($saleDetail['sale']['invoices'][$i])) {
$invoiceData[$i] = $saleDetail['sale']['invoices'][$i];
$i++;
}
$invoice = max($invoiceData);
$i = 0;
$lineitemData = array();
while (isset($invoice['lineitems'][$i])) {
if ($invoice['lineitems'][$i]['billing']['recurring_status'] == "active") {
$lineitemData[] = $invoice['lineitems'][$i]['billing']['lineitem_id'];
}
$i++;
};
return $lineitemData;
}
public static function checkError($contents)
{
if (isset($contents['errors'])) {
throw new Twocheckout_Error($contents['errors'][0]['message']);
} elseif (isset($contents['exception'])) {
throw new Twocheckout_Error($contents['exception']['errorMsg'], $contents['exception']['errorCode']);
}
}
}

@ -0,0 +1,69 @@
<?php
class Twocheckout_Charge extends Twocheckout
{
public static function form($params, $type='Checkout')
{
echo '<form id="2checkout" action="'.Twocheckout::$baseUrl.'/checkout/purchase" method="post">';
foreach ($params as $key => $value)
{
echo '<input type="hidden" name="'.htmlspecialchars($key, ENT_QUOTES, 'UTF-8').'" value="'.htmlspecialchars($value, ENT_QUOTES, 'UTF-8').'"/>';
}
if ($type == 'auto') {
echo '<input type="submit" value="Click here if you are not redirected automatically" /></form>';
echo '<script type="text/javascript">document.getElementById("2checkout").submit();</script>';
} else {
echo '<input type="submit" value="'.$type.'" />';
echo '</form>';
}
}
public static function direct($params, $type='Checkout')
{
echo '<form id="2checkout" action="'.Twocheckout::$baseUrl.'/checkout/purchase" method="post">';
foreach ($params as $key => $value)
{
echo '<input type="hidden" name="'.$key.'" value="'.$value.'"/>';
}
if ($type == 'auto') {
echo '<input type="submit" value="Click here if the payment form does not open automatically." /></form>';
echo '<script type="text/javascript">
function submitForm() {
document.getElementById("tco_lightbox").style.display = "block";
document.getElementById("2checkout").submit();
}
setTimeout("submitForm()", 2000);
</script>';
} else {
echo '<input type="submit" value="'.$type.'" />';
echo '</form>';
}
echo '<script src="'.Twocheckout::$baseUrl.'/static/checkout/javascript/direct.min.js"></script>';
}
public static function link($params)
{
$url = Twocheckout::$baseUrl.'/checkout/purchase?'.http_build_query($params, '', '&amp;');
return $url;
}
public static function redirect($params)
{
$url = Twocheckout::$baseUrl.'/checkout/purchase?'.http_build_query($params, '', '&amp;');
header("Location: $url");
}
public static function auth($params=array())
{
$params['api'] = 'checkout';
$request = new Twocheckout_Api_Requester();
$result = $request->doCall('/checkout/api/1/'.self::$sid.'/rs/authService', $params);
return Twocheckout_Util::returnResponse($result);
}
}

@ -0,0 +1,13 @@
<?php
class Twocheckout_Message
{
public static function message($code, $message)
{
$response = array();
$response['response_code'] = $code;
$response['response_message'] = $message;
$response = json_encode($response);
return $response;
}
}

@ -0,0 +1,20 @@
<?php
class Twocheckout_Notification extends Twocheckout
{
public static function check($insMessage=array(), $secretWord)
{
$hashSid = $insMessage['vendor_id'];
$hashOrder = $insMessage['sale_id'];
$hashInvoice = $insMessage['invoice_id'];
$StringToHash = strtoupper(md5($hashOrder . $hashSid . $hashInvoice . $secretWord));
if ($StringToHash != $insMessage['md5_hash']) {
$result = Twocheckout_Message::message('Fail', 'Hash Mismatch');
} else {
$result = Twocheckout_Message::message('Success', 'Hash Matched');
}
return Twocheckout_Util::returnResponse($result);
}
}

@ -0,0 +1,21 @@
<?php
class Twocheckout_Return extends Twocheckout
{
public static function check($params=array(), $secretWord)
{
$hashSecretWord = $secretWord;
$hashSid = $params['sid'];
$hashTotal = $params['total'];
$hashOrder = $params['order_number'];
$StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal));
if ($StringToHash != $params['key']) {
$result = Twocheckout_Message::message('Fail', 'Hash Mismatch');
} else {
$result = Twocheckout_Message::message('Success', 'Hash Matched');
}
return Twocheckout_Util::returnResponse($result);
}
}

@ -0,0 +1,12 @@
*.DS_Store
composer.lock
vendor
phpunit.xml
tests/log
build
phplog
# Ignore eclipse project files
.buildpath
.project
.settings

@ -0,0 +1,3 @@
[submodule "sample-code-php"]
path = sample-code-php
url = https://github.com/AuthorizeNet/sample-code-php.git

@ -0,0 +1,17 @@
checks:
php:
code_rating: true
duplication: true
tools:
php_mess_detector: true
php_code_sniffer: true
sensiolabs_security_checker: true
php_cpd: true
php_loc: true
php_pdepend: true
external_code_coverage:
timeout: 1500 #15 min
filter:
paths:
- lib/*

@ -0,0 +1,37 @@
language: php
sudo: false
dist: trusty
env:
- TEST_SUITE=samples
php:
- 5.6
- 7.0
- 7.1
before_install:
# execute all of the commands which need to be executed
# before installing dependencies
- composer validate # make sure that our composer.json file is valid for packaging
install:
# install all of the dependencies we need here
- pecl install xmldiff
- composer install --prefer-dist
before_script:
# execute all of the commands which need to be executed
# before running actual tests
- git submodule update --remote --recursive
script:
# execute all of the tests or other commands to determine
# whether the build will pass or fail
- if [[ "$TEST_SUITE" == "samples" ]]; then phpenv config-rm xdebug.ini; cp -R lib sample-code-php/; cp -R vendor sample-code-php/; cd sample-code-php; vendor/phpunit/phpunit/phpunit test-runner.php .; fi
after_script:
# - if [[ "$TEST_SUITE" == "coverage" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
# - if [[ "$TEST_SUITE" == "coverage" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
Thanks for contributing to the Authorize.Net PHP SDK.
Before you submit a pull request, we ask that you consider the following:
- Submit an issue to state the problem your pull request solves or the funtionality that it adds. We can then advise on the feasability of the pull request, and let you know if there are other possible solutions.
- Part of the SDK is auto-generated based on the XML schema. Due to this auto-generation, we cannot merge contributions for request or response classes. You are welcome to open an issue to report problems or suggest improvements. Auto-generated classes include all files inside [contract/v1](https://github.com/AuthorizeNet/sdk-php/tree/master/lib/net/authorize/api/contract/v1) and [controller](https://github.com/AuthorizeNet/sdk-php/tree/master/lib/net/authorize/api/controller) folders, except [controller/base](https://github.com/AuthorizeNet/sdk-php/tree/master/lib/net/authorize/api/controller/base).
- Files marked as deprecated are no longer supported. Issues and pull requests for changes to these deprecated files will be closed.
- Recent changes will be in future branch. Check the code in *future* branch first to see if a fix has already been merged, before suggesting changes to a file.
- **Always create pull request to the future branch.** The pull request will be merged to future, and later pushed to master as part of the next release.

@ -0,0 +1,41 @@
SDK LICENSE AGREEMENT
This Software Development Kit (“SDK”) License Agreement (“Agreement”) is between you (both the individual downloading the SDK and any legal entity on behalf of which such individual is acting) (“You” or “Your”) and Authorize.Net LLC (“Authorize.Net’).
IT IS IMPORTANT THAT YOU READ CAREFULLY AND UNDERSTAND THIS AGREEMENT. BY CLICKING THE “I ACCEPT” BUTTON OR AN EQUIVALENT INDICATOR OR BY DOWNLOADING, INSTALLING OR USING THE SDK OR THE DOCUMENTATION, YOU AGREE TO BE BOUND BY THIS AGREEMENT.
1. DEFINITIONS
1.1 “Application(s)” means software programs that You develop to operate with the Gateway using components of the Software.
1.2 “Documentation” means the materials made available to You in connection with the Software by or on behalf of Authorize.Net pursuant to this Agreement.
1.3 “Gateway” means any electronic payment platform maintained and operated by Authorize.Net and any of its affiliates.
1.4 “Software” means all of the software included in the software development kit made available to You by or on behalf of Authorize.Net pursuant to this Agreement, including but not limited to sample source code, code snippets, software tools, code libraries, sample applications, Documentation and any upgrades, modified versions, updates, and/or additions thereto, if any, made available to You by or on behalf of Authorize.Net pursuant to this Agreement.
2. GRANT OF LICENSE; RESTRICTIONS
2.1 Limited License. Subject to and conditioned upon Your compliance with the terms of this Agreement, Authorize.Net hereby grants to You a limited, revocable, non-exclusive, non-transferable, royalty-free license during the term of this Agreement to: (a) in any country worldwide, use, reproduce, modify, and create derivative works of the components of the Software solely for the purpose of developing, testing and manufacturing Applications; (b) distribute, sell or otherwise provide Your Applications that include components of the Software to Your end users; and (c) use the Documentation in connection with the foregoing activities. The license to distribute Applications that include components of the Software as set forth in subsection (b) above includes the right to grant sublicenses to Your end users to use such components of the Software as incorporated into such Applications, subject to the limitations and restrictions set forth in this Agreement.
2.2 Restrictions. You shall not (and shall have no right to): (a) make or distribute copies of the Software or the Documentation, in whole or in part, except as expressly permitted pursuant to Section 2.1; (b) alter or remove any copyright, trademark, trade name or other proprietary notices, legends, symbols or labels appearing on or in the Software or Documentation; (c) sublicense (or purport to sublicense) the Software or the Documentation, in whole or in part, to any third party except as expressly permitted pursuant to Section 2.1; (d) engage in any activity with the Software, including the development or distribution of an Application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the Gateway or platform, servers, or systems of Authorize.Net, any of its affiliates, or any third party; (e) make any statements that Your Application is “certified” or otherwise endorsed, or that its performance is guaranteed, by Authorize.Net or any of its affiliates; or (f) otherwise use or exploit the Software or the Documentation for any purpose other than to develop and distribute Applications as expressly permitted by this Agreement.
2.3 Ownership. You shall retain ownership of Your Applications developed in accordance with this Agreement, subject to Authorize.Net’s ownership of the Software and Documentation (including Authorize.Net’s ownership of any portion of the Software or Documentation incorporated in Your Applications). You acknowledge and agree that all right, title and interest in and to the Software and Documentation shall, at all times, be and remain the exclusive property of Authorize.Net and that You do not have or acquire any rights, express or implied, in the Software or Documentation except those rights expressly granted under this Agreement.
2.4 No Support. Authorize.Net has no obligation to provide support, maintenance, upgrades, modifications or new releases of the Software.
2.5 Open Source Software. You hereby acknowledge that the Software may contain software that is distributed under “open source” license terms (“Open Source Software”). You shall review the Documentation in order to determine which portions of the Software are Open Source Software and are licensed under such Open Source Software license terms. To the extent any such license requires that Authorize.Net provide You any rights with respect to such Open Source Software that are inconsistent with the limited rights granted to You in this Agreement, then such rights in the applicable Open Source Software license shall take precedence over the rights and restrictions granted in this Agreement, but solely with respect to such Open Source Software. You acknowledge that the Open Source Software license is solely between You and the applicable licensor of the Open Source Software and that Your use, reproduction and distribution of Open Source Software shall be in compliance with applicable Open Source Software license. You understand and agree that Authorize.Net is not liable for any loss or damage that You may experience as a result of Your use of Open Source Software and that You will look solely to the licensor of the Open Source Software in the event of any such loss or damage.
2.6 License to Authorize.Net. In the event You choose to submit any suggestions, feedback or other information or materials related to the Software or Documentation or Your use thereof (collectively, “Feedback”) to Authorize.Net, You hereby grant to Authorize.Net a worldwide, non-exclusive, royalty-free, transferable, sublicensable, perpetual and irrevocable license to use and otherwise exploit such Feedback in connection with the Software, Documentation, and other products and services.
2.7 Use.
(a) You represent, warrant and agree to use the Software and write Applications only for purposes permitted by (i) this Agreement; (ii) applicable law and regulation, including, without limitation, the Payment Card Industry Data Security Standard (PCI DSS); and (iii) generally accepted practices or guidelines in the relevant jurisdictions. You represent, warrant and agree that if You use the Software to develop Applications for general public end users, that You will protect the privacy and legal rights of those users. If the Application receives or stores personal or sensitive information provided by end users, it must do so securely and in compliance with all applicable laws and regulations, including card association regulations. If the Application receives Authorize.Net account information, the Application may only use that information to access the end user's Authorize.Net account. You represent, warrant and agree that You are solely responsible for (and that neither Authorize.Net nor its affiliates have any responsibility to You or to any third party for): (i) any data, content, or resources that You obtain, transmit or display through the Application; and (ii) any breach of Your obligations under this Agreement, any applicable third party license, or any applicable law or regulation, and for the consequences of any such breach.
3. WARRANTY DISCLAIMER; LIMITATION OF LIABILITY
3.1 Disclaimer. THE SOFTWARE AND THE DOCUMENTATION ARE PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS WITH NO WARRANTY. YOU AGREE THAT YOUR USE OF THE SOFTWARE AND THE DOCUMENTATION IS AT YOUR SOLE RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, AUTHORIZE.NET AND ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE AND THE DOCUMENTATION, INCLUDING ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, SATISFACTORY QUALITY, ACCURACY, TITLE AND NON-INFRINGEMENT, AND ANY WARRANTIES THAT MAY ARISE OUT OF COURSE OF PERFORMANCE, COURSE OF DEALING OR USAGE OF TRADE. NEITHER AUTHORIZE.NET NOR ITS AFFILIATES WARRANT THAT THE FUNCTIONS OR INFORMATION CONTAINED IN THE SOFTWARE OR THE DOCUMENTATION WILL MEET ANY REQUIREMENTS OR NEEDS YOU MAY HAVE, OR THAT THE SOFTWARE OR DOCUMENTATION WILL OPERATE ERROR FREE, OR THAT THE SOFTWARE OR DOCUMENTATION IS COMPATIBLE WITH ANY PARTICULAR OPERATING SYSTEM. 
3.2 Limitation of Liability. IN NO EVENT SHALL AUTHORIZE.NET AND ITS AFFILIATES BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, BUSINESS, SAVINGS, DATA, USE OR COST OF SUBSTITUTE PROCUREMENT, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF AUTHORIZE.NET HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES ARE FORESEEABLE. IN NO EVENT SHALL THE ENTIRE LIABILITY OF AUTHORIZE.NET AND AFFILIATES ARISING FROM OR RELATING TO THIS AGREEMENT OR THE SUBJECT MATTER HEREOF EXCEED ONE HUNDRED U.S. DOLLARS ($100). THE PARTIES ACKNOWLEDGE THAT THE LIMITATIONS OF LIABILITY IN THIS SECTION 3.2 AND IN THE OTHER PROVISIONS OF THIS AGREEMENT AND THE ALLOCATION OF RISK HEREIN ARE AN ESSENTIAL ELEMENT OF THE BARGAIN BETWEEN THE PARTIES, WITHOUT WHICH AUTHORIZE.NET WOULD NOT HAVE ENTERED INTO THIS AGREEMENT.
4. INDEMNIFICATION. You shall indemnify, hold harmless and, at Authorize.Net’s request, defend Authorize.Net and its affiliates and their officers, directors, employees, and agents from and against any claim, suit or proceeding, and any associated liabilities, costs, damages and expenses, including reasonable attorneys’ fees, that arise out of relate to: (i) Your Applications or the use or distribution thereof and Your use or distribution of the Software or the Documentation (or any portion thereof including Open Source Software), including, but not limited to, any allegation that any such Application or any such use or distribution infringes, misappropriates or otherwise violates any intellectual property (including, without limitation, copyright, patent, and trademark), privacy, publicity or other rights of any third party, or has caused the death or injury of any person or damage to any property; (ii) Your alleged or actual breach of this Agreement; (iii) the alleged or actual breach of this Agreement by any party to whom you have provided Your Applications, the Software or the Documentation or (iii) Your alleged or actual violation of or non-compliance with any applicable laws, legislation, policies, rules, regulations or governmental requirements (including, without limitation, any laws, legislation, policies, rules, regulations or governmental requirements related to privacy and data collection).
5. TERMINATION. This Agreement and the licenses granted to you herein are effective until terminated. Authorize.Net may terminate this Agreement and the licenses granted to You at any time. Upon termination of this Agreement, You shall cease all use of the Software and the Documentation, return to Authorize.Net or destroy all copies of the Software and Documentation and related materials in Your possession, and so certify to Authorize.Net. Except for the license to You granted herein, the terms of this Agreement shall survive termination.
6. CONFIDENTIAL INFORMATION
a. You hereby agree (i) to hold Authorize.Net’s Confidential Information in strict confidence and to take reasonable precautions to protect such Confidential Information (including, without limitation, all precautions You employ with respect to Your own confidential materials), (ii) not to divulge any such Confidential Information to any third person; (iii) not to make any use whatsoever at any time of such Confidential Information except as strictly licensed hereunder, (iv) not to remove or export from the United States or re-export any such Confidential Information or any direct product thereof, except in compliance with, and with all licenses and approvals required under applicable U.S. and foreign export laws and regulations, including, without limitation, those of the U.S. Department of Commerce.
b. “Confidential Information” shall mean any data or information, oral or written, treated as confidential that relates to Authorize.Net’s past, present, or future research, development or business activities, including without limitation any unannounced products and services, any information relating to services, developments, inventions, processes, plans, financial information, customer data, revenue, transaction volume, forecasts, projections, application programming interfaces, Software and Documentation.
7. General Terms
7.1 Law. This Agreement and all matters arising out of or relating to this Agreement shall be governed by the internal laws of the State of California without giving effect to any choice of law rule. This Agreement shall not be governed by the United Nations Convention on Contracts for the International Sales of Goods, the application of which is expressly excluded. In the event of any controversy, claim or dispute between the parties arising out of or relating to this Agreement, such controversy, claim or dispute shall be resolved in the state or federal courts in Santa Clara County, California, and the parties hereby irrevocably consent to the jurisdiction and venue of such courts.
7.2 Logo License. Authorize.Net hereby grants to You the right to use, reproduce, publish, perform and display Authorize.Net logo solely in accordance with the current Authorize.Net brand guidelines.
7.3 Severability and Waiver. If any provision of this Agreement is held to be illegal, invalid or otherwise unenforceable, such provision shall be enforced to the extent possible consistent with the stated intention of the parties, or, if incapable of such enforcement, shall be deemed to be severed and deleted from this Agreement, while the remainder of this Agreement shall continue in full force and effect. The waiver by either party of any default or breach of this Agreement shall not constitute a waiver of any other or subsequent default or breach.
7.4 No Assignment. You may not assign, sell, transfer, delegate or otherwise dispose of, whether voluntarily or involuntarily, by operation of law or otherwise, this Agreement or any rights or obligations under this Agreement without the prior written consent of Authorize.Net, which may be withheld in Authorize.Net’s sole discretion. Any purported assignment, transfer or delegation by You shall be null and void. Subject to the foregoing, this Agreement shall be binding upon and shall inure to the benefit of the parties and their respective successors and assigns.
7.5 Government Rights. If You (or any person or entity to whom you provide the Software or Documentation) are an agency or instrumentality of the United States Government, the Software and Documentation are “commercial computer software” and “commercial computer software documentation,” and pursuant to FAR 12.212 or DFARS 227.7202, and their successors, as applicable, use, reproduction and disclosure of the Software and Documentation are governed by the terms of this Agreement.
7.6 Export Administration. You shall comply fully with all relevant export laws and regulations of the United States, including, without limitation, the U.S. Export Administration Regulations (collectively “Export Controls”). Without limiting the generality of the foregoing, You shall not, and You shall require Your representatives not to, export, direct or transfer the Software or the Documentation, or any direct product thereof, to any destination, person or entity restricted or prohibited by the Export Controls.
7.7 Privacy. In order to continually innovate and improve the Software, Licensee understands and agrees that Authorize.Net may collect certain usage statistics including but not limited to a unique identifier, associated IP address, version number of software, and information on which tools and/or services in the Software are being used and how they are being used.
7.8 Entire Agreement; Amendments. This Agreement constitutes the entire agreement between the parties and supersedes all prior or contemporaneous agreements or representations, written or oral, concerning the subject matter of this Agreement. Authorize.Net may make changes to this Agreement, Software or Documentation in its sole discretion. When these changes are made, Authorize.Net will make a new version of the Agreement, Software or Documentation available on the website where the Software is available. This Agreement may not be modified or amended by You except in a writing signed by a duly authorized representative of each party. You acknowledge and agree that
Authorize.Net has not made any representations, warranties or agreements of any kind, except as expressly set forth herein.
Authorize.Net Software Development Kit (SDK) License Agreement
v. February 1, 2017
1

@ -0,0 +1,85 @@
# Migrating from Legacy Authorize.Net Classes
Authorize.Net no longer supports several legacy classes, including AuthorizeNetAIM.php, AuthorizenetSIM.php, and others listed below, as part of PHP-SDK. If you are using any of these, we recommend that you update your code to use the new Authorize.Net API classes.
**For details on the deprecation and replacement of legacy Authorize.Net APIs, visit https://developer.authorize.net/api/upgrade_guide/.**
## Full list of classes that are no longer supported
| Class | New Feature | Sample Codes directory/repository |
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| AuthorizeNetAIM.php | [PaymentTransactions](https://developer.authorize.net/api/reference/index.html#payment-transactions) | [sample-code-php/PaymentTransactions](https://github.com/AuthorizeNet/sample-code-php/tree/master/PaymentTransactions) |
| AuthorizeNetARB.php | [RecurringBilling](https://developer.authorize.net/api/reference/index.html#recurring-billing) | [sample-code-php/RecurringBilling](https://github.com/AuthorizeNet/sample-code-php/tree/master/RecurringBilling) |
| AuthorizeNetCIM.php | [CustomerProfiles](https://developer.authorize.net/api/reference/index.html#customer-profiles) | [sample-code-php/CustomerProfiles](https://github.com/AuthorizeNet/sample-code-php/tree/master/CustomerProfiles) |
| Hosted CIM | [Accept Customer](https://developer.authorize.net/content/developer/en_us/api/reference/features/customer_profiles.html#Using_the_Accept_Customer_Hosted_Form) | Not available |
| AuthorizeNetCP.php | [PaymentTransactions](https://developer.authorize.net/api/reference/index.html#payment-transactions) | [sample-code-php/PaymentTransactions](https://github.com/AuthorizeNet/sample-code-php/tree/master/PaymentTransactions) |
| AuthorizeNetDPM.php | [Accept.JS](https://developer.authorize.net/api/reference/features/acceptjs.html) | [Sample Accept Application](https://github.com/AuthorizeNet/accept-sample-app) |
| AuthorizeNetSIM.php | [Accept Hosted](https://developer.authorize.net/content/developer/en_us/api/reference/features/accept_hosted.html) | Not available |
| AuthorizeNetSOAP.php | [PaymentTransactions](https://developer.authorize.net/api/reference/index.html#payment-transactions) | [sample-code-php/PaymentTransactions](https://github.com/AuthorizeNet/sample-code-php/tree/master/PaymentTransactions) |
| AuthorizeNetTD.php | [TransactionReporting](https://developer.authorize.net/api/reference/index.html#transaction-reporting) | [sample-code-php/TransactionReporting/](https://github.com/AuthorizeNet/sample-code-php/tree/master/TransactionReporting) |
## Example
#### Old AuthorizeNetAIM example:
```php
define("AUTHORIZENET_API_LOGIN_ID", "YOURLOGIN");
define("AUTHORIZENET_TRANSACTION_KEY", "YOURKEY");
define("AUTHORIZENET_SANDBOX", true);
$sale = new AuthorizeNetAIM;
$sale->amount = "5.99";
$sale->card_num = '6011000000000012';
$sale->exp_date = '04/15';
$response = $sale->authorizeAndCapture();
if ($response->approved) {
$transaction_id = $response->transaction_id;
}
```
#### Corresponding new model code (charge-credit-card):
```php
require 'vendor/autoload.php';
use net\authorize\api\contract\v1 as AnetAPI;
use net\authorize\api\controller as AnetController;
define("AUTHORIZENET_LOG_FILE", "phplog");
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName("YOURLOGIN");
$merchantAuthentication->setTransactionKey("YOURKEY");
// Create the payment data for a credit card
$creditCard = new AnetAPI\CreditCardType();
$creditCard->setCardNumber("6011000000000012");
$creditCard->setExpirationDate("2015-04");
$creditCard->setCardCode("123");
// Add the payment data to a paymentType object
$paymentOne = new AnetAPI\PaymentType();
$paymentOne->setCreditCard($creditCard);
$transactionRequestType = new AnetAPI\TransactionRequestType();
$transactionRequestType->setTransactionType("authCaptureTransaction");
$transactionRequestType->setAmount("5.99");
$transactionRequestType->setPayment($paymentOne);
// Assemble the complete transaction request
$request = new AnetAPI\CreateTransactionRequest();
$request->setMerchantAuthentication($merchantAuthentication);
$request->setTransactionRequest($transactionRequestType);
// Create the controller and get the response
$controller = new AnetController\CreateTransactionController($request);
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if ($response != null) {
// Check to see if the API request was successfully received and acted upon
if ($response->getMessages()->getResultCode() == "Ok") {
// Since the API request was successful, look for a transaction response
// and parse it to display the results of authorizing the card
$tresponse = $response->getTransactionResponse();
if ($tresponse != null && $tresponse->getMessages() != null) {
echo " Successfully created transaction with Transaction ID: " . $tresponse->getTransId() . "\n";
echo " Transaction Response Code: " . $tresponse->getResponseCode() . "\n";
echo " Message Code: " . $tresponse->getMessages()[0]->getCode() . "\n";
echo " Auth Code: " . $tresponse->getAuthCode() . "\n";
echo " Description: " . $tresponse->getMessages()[0]->getDescription() . "\n";
}
}
}
```

@ -0,0 +1,178 @@
# Authorize.Net PHP SDK
[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-php.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-php)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/?branch=master)
[![Packagist Stable Version](https://poser.pugx.org/authorizenet/authorizenet/v/stable.svg)](https://packagist.org/packages/authorizenet/authorizenet)
## Requirements
* PHP 5.6+
* cURL PHP Extension
* JSON PHP Extension
* An Authorize.Net account (see _Registration & Configuration_ section below)
* TLS 1.2 capable versions of libcurl and OpenSSL (or its equivalent)
### Migrating from older versions
Since August 2018, the Authorize.Net API has been reorganized to be more merchant focused. Authorize.Net AIM, ARB, CIM, Transaction Reporting, and SIM classes have been deprecated in favor of net\authorize\api. To see the full list of mapping of new features corresponding to the deprecated features, see [MIGRATING.md](MIGRATING.md).
### Contribution
- If you need information or clarification about Authorize.Net features, create an issue with your question. You can also search the [Authorize.Net developer community](https://community.developer.authorize.net/)for discussions related to your question.
- Before creating pull requests, read [the contributors guide](CONTRIBUTING.md)
### TLS 1.2
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. Make sure to upgrade all required components to support TLS 1.2. Keep these components up to date to mitigate the risk of new security flaws.
To test whether your current installation is capable of communicating to our servers using TLS 1.2, run the following PHP code and examine the output for the TLS version:
```php
<?php
$ch = curl_init('https://apitest.authorize.net/xml/v1/request.api');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
$data = curl_exec($ch);
curl_close($ch);
```
If curl is unable to connect to our URL (as given in the previous sample), it's likely that your system is not able to connect using TLS 1.2, or does not have a supported cipher installed. To verify what TLS version your connection _does_ support, run the following PHP code:
```php
<?php
$ch = curl_init('https://www.howsmyssl.com/a/check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
echo "Connection uses " . $json->tls_version ."\n";
```
## Installation
### Composer
We recommend using [`Composer`](http://getcomposer.org). *(Note: we never recommend you
override the new secure-http default setting)*.
*Update your composer.json file as per the example below and then run for this specific release
`composer update`.*
```json
{
"require": {
"php": ">=5.6",
"authorizenet/authorizenet": "2.0.1"
}
}
```
After installation through Composer,
don't forget to require its autoloader in your script or bootstrap file:
```php
require 'vendor/autoload.php';
```
### Custom SPL Autoloader
Alternatively, we provide a custom `SPL` autoloader for you to reference from within your PHP file:
```php
require 'path/to/anet_php_sdk/autoload.php';
```
This autoloader still requires the `vendor` directory and all of its dependencies to exist.
However, this is a possible solution for cases where composer can't be run on a given system.
You can run composer locally or on another system to build the directory, then copy the
`vendor` directory to the desired system.
## Registration & Configuration
Use of this SDK and the Authorize.Net APIs requires having an account on the Authorize.Net system. You can find these details in the Settings section. If you don't currently have a production Authorize.Net account, [sign up for a sandbox account](https://developer.authorize.net/sandbox/).
### Authentication
To authenticate with the Authorize.Net API, use your account's API Login ID and Transaction Key. If you don't have these credentials, obtain them from the Merchant Interface. For production accounts, the Merchant Interface is located at (https://account.authorize.net/), and for sandbox accounts, at (https://sandbox.authorize.net).
After you have your credentials, load them into the appropriate variables in your code. The below sample code shows how to set the credentials as part of the API request.
#### To set your API credentials for an API request:
...
```php
use net\authorize\api\contract\v1 as AnetAPI;
```
...
```php
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName("YOURLOGIN");
$merchantAuthentication->setTransactionKey("YOURKEY");
```
...
```php
$request = new AnetAPI\CreateTransactionRequest();
$request->setMerchantAuthentication($merchantAuthentication);
```
...
You should never include your Login ID and Transaction Key directly in a PHP file that's in a publically accessible portion of your website. A better practice would be to define these in a constants file, and then reference those constants in the appropriate place in your code.
### Switching between the sandbox environment and the production environment
Authorize.Net maintains a complete sandbox environment for testing and development purposes. The sandbox environment is an exact replica of our production environment, with simulated transaction authorization and settlement. By default, this SDK is configured to use the sandbox environment. To switch to the production environment, replace the environment constant in the execute method. For example:
```php
// For PRODUCTION use
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);
```
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
## SDK Usage Examples and Sample Code
To get started using this SDK, it's highly recommended to download our sample code repository:
* [Authorize.Net PHP Sample Code Repository (on GitHub)](https://github.com/AuthorizeNet/sample-code-php)
In that respository, we have comprehensive sample code for all common uses of our API:
Additionally, you can find details and examples of how our API is structured in our API Reference Guide:
* [Developer Center API Reference](http://developer.authorize.net/api/reference/index.html)
The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.
## Building & Testing the SDK
Integration tests for the AuthorizeNet SDK are in the `tests` directory. These tests
are mainly for SDK development. However, you can also browse through them to find
more usage examples for the various APIs.
- Run `composer update --dev` to load the `PHPUnit` test library.
- Copy the `phpunit.xml.dist` file to `phpunit.xml` and enter your merchant
credentials in the constant fields.
- Run `vendor/bin/phpunit` to run the test suite.
*You'll probably want to disable emails on your sandbox account.*
### Testing Guide
For additional help in testing your own code, Authorize.Net maintains a [comprehensive testing guide](http://developer.authorize.net/hello_world/testing_guide/) that includes test credit card numbers to use and special triggers to generate certain responses from the sandbox environment.
## Logging
The SDK generates a log with masking for sensitive data like credit card, expiration dates. The provided levels for logging are
`debug`, `info`, `warn`, `error`. Add ````use \net\authorize\util\LogFactory;````. Logger can be initialized using `$logger = LogFactory::getLog(get_class($this));`
The default log file `phplog` gets generated in the current folder. The subsequent logs are appended to the same file, unless the execution folder is changed, and a new log file is generated.
### Usage Examples
- Logging a string message `$logger->debug("Sending 'XML' Request type");`
- Logging xml strings `$logger->debug($xmlRequest);`
- Logging using formatting `$logger->debugFormat("Integer: %d, Float: %f, Xml-Request: %s\n", array(100, 1.29f, $xmlRequest));`
### Customizing Sensitive Tags
A local copy of [AuthorizedNetSensitiveTagsConfig.json](/lib/net/authorize/util/ANetSensitiveFields.php) gets generated when code invoking the logger first gets executed. The local file can later be edited by developer to re-configure what is masked and what is visible. (*Do not edit the JSON in the SDK*).
- For each element of the `sensitiveTags` array,
- `tagName` field corresponds to the name of the property in object, or xml-tag that should be hidden entirely ( *XXXX* shown if no replacement specified ) or masked (e.g. showing the last 4 digits of credit card number).
- `pattern`[<sup>[Note]</sup>](#regex-note) and `replacement`[<sup>[Note]</sup>](#regex-note) can be left `""`, if the default is to be used (as defined in [Log.php](/lib/net/authorize/util/Log.php)). `pattern` gives the regex to identify, while `replacement` defines the visible part.
- `disableMask` can be set to *true* to allow the log to fully display that property in an object, or tag in a xml string.
- `sensitiveStringRegexes`[<sup>[Note]</sup>](#regex-note) has list of credit-card regexes. So if credit-card number is not already masked, it would get entirely masked.
- Take care of non-ascii characters (refer [manual](http://php.net/manual/en/regexp.reference.unicode.php)) while defining the regex, e.g. use
`"pattern": "(\\p{N}+)(\\p{N}{4})"` instead of `"pattern": "(\\d+)(\\d{4})"`. Also note `\\` escape sequence is used.
**<a name="regex-note">Note</a>:**
**For any regex, no starting or ending '/' or any other delimiter should be defined. The '/' delimiter and unicode flag is added in the code.**
### Transaction Hash Upgrade
Authorize.Net is phasing out the MD5 based `transHash` element in favor of the SHA-512 based `transHashSHA2`. The setting in the Merchant Interface which controlled the MD5 Hash option is no longer available, and the `transHash` element will stop returning values at a later date to be determined. For information on how to use `transHashSHA2`, see the [Transaction Hash Upgrade Guide] (https://developer.authorize.net/support/hash_upgrade/).
## License
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file.

@ -0,0 +1,18 @@
<?php
/**
* Custom SPL autoloader for the AuthorizeNet SDK
*
* @package AuthorizeNet
*/
spl_autoload_register(function($className) {
static $classMap;
if (!isset($classMap)) {
$classMap = require __DIR__ . DIRECTORY_SEPARATOR . 'classmap.php';
}
if (isset($classMap[$className])) {
include $classMap[$className];
}
});

@ -0,0 +1,302 @@
<?php
spl_autoload_extensions(".php"); // comma-separated list
spl_autoload_register();
/**
* A map of classname => filename for SPL autoloading.
*
* @package AuthorizeNet
*/
$baseDir = __DIR__ ;
$libDir = $baseDir . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR;
$vendorDir = $baseDir . '/vendor';
return array(
// Following section contains the new controller model classes needed
//Utils
//'net\authorize\util\ObjectToXml' => $libDir . 'net/authorize/util/ObjectToXml.php',
'net\authorize\util\HttpClient' => $libDir . 'net/authorize/util/HttpClient.php',
'net\authorize\util\Helpers' => $libDir . 'net/authorize/util/Helpers.php',
'net\authorize\util\Log' => $libDir . 'net/authorize/util/Log.php',
'net\authorize\util\LogFactory' => $libDir . 'net/authorize/util/LogFactory.php',
'net\authorize\util\ANetSensitiveFields' => $libDir . 'net/authorize/util/ANetSensitiveFields.php',
'net\authorize\util\SensitiveTag' => $libDir . 'net/authorize/util/SensitiveTag.php',
'net\authorize\util\SensitiveDataConfigType' => $libDir . 'net/authorize/util/SensitiveDataConfigType.php',
'net\authorize\util\Mapper' => $libDir . 'net/authorize/util/Mapper.php',
'net\authorize\util\MapperObj' => $libDir . 'net/authorize/util/MapperObj.php',
//constants
'net\authorize\api\constants\ANetEnvironment' => $libDir . 'net/authorize/api/constants/ANetEnvironment.php',
//base classes
'net\authorize\api\controller\base\IApiOperation' => $libDir . 'net/authorize/api/controller/base/IApiOperation.php',
'net\authorize\api\controller\base\ApiOperationBase' => $libDir . 'net/authorize/api/controller/base/ApiOperationBase.php',
//following are generated class mappings
'net\authorize\api\contract\v1\ANetApiRequestType' => $libDir . 'net/authorize/api/contract/v1/ANetApiRequestType.php',
'net\authorize\api\contract\v1\ANetApiResponseType' => $libDir . 'net/authorize/api/contract/v1/ANetApiResponseType.php',
'net\authorize\api\contract\v1\ARBCancelSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBCancelSubscriptionRequest.php',
'net\authorize\api\contract\v1\ARBCancelSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBCancelSubscriptionResponse.php',
'net\authorize\api\contract\v1\ARBCreateSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBCreateSubscriptionRequest.php',
'net\authorize\api\contract\v1\ARBCreateSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBCreateSubscriptionResponse.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionListRequest' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionListRequest.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionListResponse' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionListResponse.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionListSortingType.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionRequest.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionResponse.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionStatusRequest' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionStatusRequest.php',
'net\authorize\api\contract\v1\ARBGetSubscriptionStatusResponse' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionStatusResponse.php',
'net\authorize\api\contract\v1\ARBSubscriptionMaskedType' => $libDir . 'net/authorize/api/contract/v1/ARBSubscriptionMaskedType.php',
'net\authorize\api\contract\v1\ARBSubscriptionType' => $libDir . 'net/authorize/api/contract/v1/ARBSubscriptionType.php',
'net\authorize\api\contract\v1\ArbTransactionType' => $libDir . 'net/authorize/api/contract/v1/ArbTransactionType.php',
'net\authorize\api\contract\v1\ARBUpdateSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBUpdateSubscriptionRequest.php',
'net\authorize\api\contract\v1\ARBUpdateSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBUpdateSubscriptionResponse.php',
'net\authorize\api\contract\v1\ArrayOfSettingType' => $libDir . 'net/authorize/api/contract/v1/ArrayOfSettingType.php',
'net\authorize\api\contract\v1\AuthenticateTestRequest' => $libDir . 'net/authorize/api/contract/v1/AuthenticateTestRequest.php',
'net\authorize\api\contract\v1\AuthenticateTestResponse' => $libDir . 'net/authorize/api/contract/v1/AuthenticateTestResponse.php',
'net\authorize\api\contract\v1\BankAccountMaskedType' => $libDir . 'net/authorize/api/contract/v1/BankAccountMaskedType.php',
'net\authorize\api\contract\v1\BankAccountType' => $libDir . 'net/authorize/api/contract/v1/BankAccountType.php',
'net\authorize\api\contract\v1\BatchDetailsType' => $libDir . 'net/authorize/api/contract/v1/BatchDetailsType.php',
'net\authorize\api\contract\v1\BatchStatisticType' => $libDir . 'net/authorize/api/contract/v1/BatchStatisticType.php',
'net\authorize\api\contract\v1\CardArtType' => $libDir . 'net/authorize/api/contract/v1/CardArtType.php',
'net\authorize\api\contract\v1\CcAuthenticationType' => $libDir . 'net/authorize/api/contract/v1/CcAuthenticationType.php',
'net\authorize\api\contract\v1\CreateCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerPaymentProfileRequest.php',
'net\authorize\api\contract\v1\CreateCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerPaymentProfileResponse.php',
'net\authorize\api\contract\v1\CreateCustomerProfileFromTransactionRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileFromTransactionRequest.php',
'net\authorize\api\contract\v1\CreateCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileRequest.php',
'net\authorize\api\contract\v1\CreateCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileResponse.php',
'net\authorize\api\contract\v1\CreateCustomerProfileTransactionRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileTransactionRequest.php',
'net\authorize\api\contract\v1\CreateCustomerProfileTransactionResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileTransactionResponse.php',
'net\authorize\api\contract\v1\CreateCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerShippingAddressRequest.php',
'net\authorize\api\contract\v1\CreateCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerShippingAddressResponse.php',
'net\authorize\api\contract\v1\CreateProfileResponseType' => $libDir . 'net/authorize/api/contract/v1/CreateProfileResponseType.php',
'net\authorize\api\contract\v1\CreateTransactionRequest' => $libDir . 'net/authorize/api/contract/v1/CreateTransactionRequest.php',
'net\authorize\api\contract\v1\CreateTransactionResponse' => $libDir . 'net/authorize/api/contract/v1/CreateTransactionResponse.php',
'net\authorize\api\contract\v1\CreditCardMaskedType' => $libDir . 'net/authorize/api/contract/v1/CreditCardMaskedType.php',
'net\authorize\api\contract\v1\CreditCardSimpleType' => $libDir . 'net/authorize/api/contract/v1/CreditCardSimpleType.php',
'net\authorize\api\contract\v1\CreditCardTrackType' => $libDir . 'net/authorize/api/contract/v1/CreditCardTrackType.php',
'net\authorize\api\contract\v1\CreditCardType' => $libDir . 'net/authorize/api/contract/v1/CreditCardType.php',
'net\authorize\api\contract\v1\CustomerAddressExType' => $libDir . 'net/authorize/api/contract/v1/CustomerAddressExType.php',
'net\authorize\api\contract\v1\CustomerAddressType' => $libDir . 'net/authorize/api/contract/v1/CustomerAddressType.php',
'net\authorize\api\contract\v1\CustomerDataType' => $libDir . 'net/authorize/api/contract/v1/CustomerDataType.php',
'net\authorize\api\contract\v1\CustomerProfileIdType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileIdType.php',
'net\authorize\api\contract\v1\CustomerPaymentProfileBaseType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileBaseType.php',
'net\authorize\api\contract\v1\CustomerPaymentProfileExType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileExType.php',
'net\authorize\api\contract\v1\CustomerPaymentProfileListItemType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileListItemType.php',
'net\authorize\api\contract\v1\CustomerPaymentProfileMaskedType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileMaskedType.php',
'net\authorize\api\contract\v1\CustomerPaymentProfileSortingType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileSortingType.php',
'net\authorize\api\contract\v1\CustomerPaymentProfileType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileType.php',
'net\authorize\api\contract\v1\CustomerProfileBaseType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileBaseType.php',
'net\authorize\api\contract\v1\CustomerProfileExType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileExType.php',
'net\authorize\api\contract\v1\CustomerProfileMaskedType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileMaskedType.php',
'net\authorize\api\contract\v1\CustomerProfilePaymentType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfilePaymentType.php',
'net\authorize\api\contract\v1\CustomerProfileSummaryType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileSummaryType.php',
'net\authorize\api\contract\v1\CustomerProfileType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileType.php',
'net\authorize\api\contract\v1\CustomerType' => $libDir . 'net/authorize/api/contract/v1/CustomerType.php',
'net\authorize\api\contract\v1\DecryptPaymentDataRequest' => $libDir . 'net/authorize/api/contract/v1/DecryptPaymentDataRequest.php',
'net\authorize\api\contract\v1\DecryptPaymentDataResponse' => $libDir . 'net/authorize/api/contract/v1/DecryptPaymentDataResponse.php',
'net\authorize\api\contract\v1\DeleteCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerPaymentProfileRequest.php',
'net\authorize\api\contract\v1\DeleteCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerPaymentProfileResponse.php',
'net\authorize\api\contract\v1\DeleteCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerProfileRequest.php',
'net\authorize\api\contract\v1\DeleteCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerProfileResponse.php',
'net\authorize\api\contract\v1\DeleteCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerShippingAddressRequest.php',
'net\authorize\api\contract\v1\DeleteCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerShippingAddressResponse.php',
'net\authorize\api\contract\v1\DriversLicenseMaskedType' => $libDir . 'net/authorize/api/contract/v1/DriversLicenseMaskedType.php',
'net\authorize\api\contract\v1\DriversLicenseType' => $libDir . 'net/authorize/api/contract/v1/DriversLicenseType.php',
'net\authorize\api\contract\v1\EmailSettingsType' => $libDir . 'net/authorize/api/contract/v1/EmailSettingsType.php',
'net\authorize\api\contract\v1\EncryptedTrackDataType' => $libDir . 'net/authorize/api/contract/v1/EncryptedTrackDataType.php',
'net\authorize\api\contract\v1\EnumCollection' => $libDir . 'net/authorize/api/contract/v1/EnumCollection.php',
'net\authorize\api\contract\v1\ErrorResponse' => $libDir . 'net/authorize/api/contract/v1/ErrorResponse.php',
'net\authorize\api\contract\v1\ExtendedAmountType' => $libDir . 'net/authorize/api/contract/v1/ExtendedAmountType.php',
'net\authorize\api\contract\v1\FDSFilterType' => $libDir . 'net/authorize/api/contract/v1/FDSFilterType.php',
'net\authorize\api\contract\v1\FingerPrintType' => $libDir . 'net/authorize/api/contract/v1/FingerPrintType.php',
'net\authorize\api\contract\v1\FraudInformationType'=> $libDir . 'net/authorize/api/contract/v1/FraudInformationType.php',
'net\authorize\api\contract\v1\GetBatchStatisticsRequest' => $libDir . 'net/authorize/api/contract/v1/GetBatchStatisticsRequest.php',
'net\authorize\api\contract\v1\GetBatchStatisticsResponse' => $libDir . 'net/authorize/api/contract/v1/GetBatchStatisticsResponse.php',
'net\authorize\api\contract\v1\GetCustomerPaymentProfileListRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileListRequest.php',
'net\authorize\api\contract\v1\GetCustomerPaymentProfileListResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileListResponse.php',
'net\authorize\api\contract\v1\GetCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileRequest.php',
'net\authorize\api\contract\v1\GetCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileResponse.php',
'net\authorize\api\contract\v1\GetCustomerProfileIdsRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileIdsRequest.php',
'net\authorize\api\contract\v1\GetCustomerProfileIdsResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileIdsResponse.php',
'net\authorize\api\contract\v1\GetCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileRequest.php',
'net\authorize\api\contract\v1\GetCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileResponse.php',
'net\authorize\api\contract\v1\GetCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerShippingAddressRequest.php',
'net\authorize\api\contract\v1\GetCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerShippingAddressResponse.php',
'net\authorize\api\contract\v1\GetHostedPaymentPageRequest'=> $libDir . 'net/authorize/api/contract/v1/GetHostedPaymentPageRequest.php',
'net\authorize\api\contract\v1\GetHostedPaymentPageResponse'=> $libDir . 'net/authorize/api/contract/v1/GetHostedPaymentPageResponse.php',
'net\authorize\api\contract\v1\GetHostedProfilePageRequest' => $libDir . 'net/authorize/api/contract/v1/GetHostedProfilePageRequest.php',
'net\authorize\api\contract\v1\GetHostedProfilePageResponse' => $libDir . 'net/authorize/api/contract/v1/GetHostedProfilePageResponse.php',
'net\authorize\api\contract\v1\GetMerchantDetailsRequest'=> $libDir . 'net/authorize/api/contract/v1/GetMerchantDetailsRequest.php',
'net\authorize\api\contract\v1\GetMerchantDetailsResponse'=> $libDir . 'net/authorize/api/contract/v1/GetMerchantDetailsResponse.php',
'net\authorize\api\contract\v1\GetSettledBatchListRequest' => $libDir . 'net/authorize/api/contract/v1/GetSettledBatchListRequest.php',
'net\authorize\api\contract\v1\GetSettledBatchListResponse' => $libDir . 'net/authorize/api/contract/v1/GetSettledBatchListResponse.php',
'net\authorize\api\contract\v1\GetTransactionDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/GetTransactionDetailsRequest.php',
'net\authorize\api\contract\v1\GetTransactionDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/GetTransactionDetailsResponse.php',
'net\authorize\api\contract\v1\GetTransactionListRequest' => $libDir . 'net/authorize/api/contract/v1/GetTransactionListRequest.php',
'net\authorize\api\contract\v1\GetTransactionListResponse' => $libDir . 'net/authorize/api/contract/v1/GetTransactionListResponse.php',
'net\authorize\api\contract\v1\GetUnsettledTransactionListRequest' => $libDir . 'net/authorize/api/contract/v1/GetUnsettledTransactionListRequest.php',
'net\authorize\api\contract\v1\GetUnsettledTransactionListResponse' => $libDir . 'net/authorize/api/contract/v1/GetUnsettledTransactionListResponse.php',
'net\authorize\api\contract\v1\HeldTransactionRequestType'=> $libDir . 'net/authorize/api/contract/v1/HeldTransactionRequestType.php',
'net\authorize\api\contract\v1\ImpersonationAuthenticationType' => $libDir . 'net/authorize/api/contract/v1/ImpersonationAuthenticationType.php',
'net\authorize\api\contract\v1\IsAliveRequest' => $libDir . 'net/authorize/api/contract/v1/IsAliveRequest.php',
'net\authorize\api\contract\v1\IsAliveResponse' => $libDir . 'net/authorize/api/contract/v1/IsAliveResponse.php',
'net\authorize\api\contract\v1\KeyBlockType' => $libDir . 'net/authorize/api/contract/v1/KeyBlockType.php',
'net\authorize\api\contract\v1\KeyManagementSchemeType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType.php',
'net\authorize\api\contract\v1\KeyValueType' => $libDir . 'net/authorize/api/contract/v1/KeyValueType.php',
'net\authorize\api\contract\v1\LineItemType' => $libDir . 'net/authorize/api/contract/v1/LineItemType.php',
'net\authorize\api\contract\v1\LogoutRequest' => $libDir . 'net/authorize/api/contract/v1/LogoutRequest.php',
'net\authorize\api\contract\v1\LogoutResponse' => $libDir . 'net/authorize/api/contract/v1/LogoutResponse.php',
'net\authorize\api\contract\v1\MerchantAuthenticationType' => $libDir . 'net/authorize/api/contract/v1/MerchantAuthenticationType.php',
'net\authorize\api\contract\v1\MerchantContactType' => $libDir . 'net/authorize/api/contract/v1/MerchantContactType.php',
'net\authorize\api\contract\v1\MessagesType' => $libDir . 'net/authorize/api/contract/v1/MessagesType.php',
'net\authorize\api\contract\v1\MobileDeviceLoginRequest' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceLoginRequest.php',
'net\authorize\api\contract\v1\MobileDeviceLoginResponse' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceLoginResponse.php',
'net\authorize\api\contract\v1\MobileDeviceRegistrationRequest' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceRegistrationRequest.php',
'net\authorize\api\contract\v1\MobileDeviceRegistrationResponse' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceRegistrationResponse.php',
'net\authorize\api\contract\v1\MobileDeviceType' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceType.php',
'net\authorize\api\contract\v1\NameAndAddressType' => $libDir . 'net/authorize/api/contract/v1/NameAndAddressType.php',
'net\authorize\api\contract\v1\OpaqueDataType' => $libDir . 'net/authorize/api/contract/v1/OpaqueDataType.php',
'net\authorize\api\contract\v1\OrderExType' => $libDir . 'net/authorize/api/contract/v1/OrderExType.php',
'net\authorize\api\contract\v1\OrderType' => $libDir . 'net/authorize/api/contract/v1/OrderType.php',
'net\authorize\api\contract\v1\PagingType' => $libDir . 'net/authorize/api/contract/v1/PagingType.php',
'net\authorize\api\contract\v1\PaymentDetailsType' => $libDir . 'net/authorize/api/contract/v1/PaymentDetailsType.php',
'net\authorize\api\contract\v1\PaymentMaskedType' => $libDir . 'net/authorize/api/contract/v1/PaymentMaskedType.php',
'net\authorize\api\contract\v1\PaymentProfileType' => $libDir . 'net/authorize/api/contract/v1/PaymentProfileType.php',
'net\authorize\api\contract\v1\PaymentScheduleType' => $libDir . 'net/authorize/api/contract/v1/PaymentScheduleType.php',
'net\authorize\api\contract\v1\PaymentSimpleType' => $libDir . 'net/authorize/api/contract/v1/PaymentSimpleType.php',
'net\authorize\api\contract\v1\PaymentType' => $libDir . 'net/authorize/api/contract/v1/PaymentType.php',
'net\authorize\api\contract\v1\PayPalType' => $libDir . 'net/authorize/api/contract/v1/PayPalType.php',
'net\authorize\api\contract\v1\PermissionType' => $libDir . 'net/authorize/api/contract/v1/PermissionType.php',
'net\authorize\api\contract\v1\ProcessorType'=> $libDir . 'net/authorize/api/contract/v1/ProcessorType.php',
'net\authorize\api\contract\v1\ProfileTransactionType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransactionType.php',
'net\authorize\api\contract\v1\ProfileTransAmountType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransAmountType.php',
'net\authorize\api\contract\v1\ProfileTransAuthCaptureType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransAuthCaptureType.php',
'net\authorize\api\contract\v1\ProfileTransAuthOnlyType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransAuthOnlyType.php',
'net\authorize\api\contract\v1\ProfileTransCaptureOnlyType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransCaptureOnlyType.php',
'net\authorize\api\contract\v1\ProfileTransOrderType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransOrderType.php',
'net\authorize\api\contract\v1\ProfileTransPriorAuthCaptureType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransPriorAuthCaptureType.php',
'net\authorize\api\contract\v1\ProfileTransRefundType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransRefundType.php',
'net\authorize\api\contract\v1\ProfileTransVoidType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransVoidType.php',
'net\authorize\api\contract\v1\ReturnedItemType' => $libDir . 'net/authorize/api/contract/v1/ReturnedItemType.php',
'net\authorize\api\contract\v1\SearchCriteriaCustomerProfileType' => $libDir . 'net/authorize/api/contract/v1/SearchCriteriaCustomerProfileType.php',
'net\authorize\api\contract\v1\SecurePaymentContainerErrorType' => $libDir . 'net/authorize/api/contract/v1/SecurePaymentContainerErrorType.php',
'net\authorize\api\contract\v1\SecurePaymentContainerRequest' => $libDir . 'net/authorize/api/contract/v1/SecurePaymentContainerRequest.php',
'net\authorize\api\contract\v1\SecurePaymentContainerResponse' => $libDir . 'net/authorize/api/contract/v1/SecurePaymentContainerResponse.php',
'net\authorize\api\contract\v1\SendCustomerTransactionReceiptRequest' => $libDir . 'net/authorize/api/contract/v1/SendCustomerTransactionReceiptRequest.php',
'net\authorize\api\contract\v1\SendCustomerTransactionReceiptResponse' => $libDir . 'net/authorize/api/contract/v1/SendCustomerTransactionReceiptResponse.php',
'net\authorize\api\contract\v1\SettingType' => $libDir . 'net/authorize/api/contract/v1/SettingType.php',
'net\authorize\api\contract\v1\SolutionType' => $libDir . 'net/authorize/api/contract/v1/SolutionType.php',
'net\authorize\api\contract\v1\SubMerchantType' => $libDir . 'net/authorize/api/contract/v1/SubMerchantType.php',
'net\authorize\api\contract\v1\SubscriptionCustomerProfileType' => $libDir . 'net/authorize/api/contract/v1/SubscriptionCustomerProfileType.php',
'net\authorize\api\contract\v1\SubscriptionDetailType' => $libDir . 'net/authorize/api/contract/v1/SubscriptionDetailType.php',
'net\authorize\api\contract\v1\SubscriptionPaymentType' => $libDir . 'net/authorize/api/contract/v1/SubscriptionPaymentType.php',
'net\authorize\api\contract\v1\TokenMaskedType' => $libDir . 'net/authorize/api/contract/v1/TokenMaskedType.php',
'net\authorize\api\contract\v1\TransactionDetailsType' => $libDir . 'net/authorize/api/contract/v1/TransactionDetailsType.php',
'net\authorize\api\contract\v1\TransactionListSortingType'=> $libDir . 'net/authorize/api/contract/v1/TransactionListSortingType.php',
'net\authorize\api\contract\v1\TransactionRequestType' => $libDir . 'net/authorize/api/contract/v1/TransactionRequestType.php',
'net\authorize\api\contract\v1\TransactionResponseType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType.php',
'net\authorize\api\contract\v1\TransactionSummaryType' => $libDir . 'net/authorize/api/contract/v1/TransactionSummaryType.php',
'net\authorize\api\contract\v1\TransRetailInfoType' => $libDir . 'net/authorize/api/contract/v1/TransRetailInfoType.php',
'net\authorize\api\contract\v1\UpdateCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerPaymentProfileRequest.php',
'net\authorize\api\contract\v1\UpdateCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerPaymentProfileResponse.php',
'net\authorize\api\contract\v1\UpdateCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerProfileRequest.php',
'net\authorize\api\contract\v1\UpdateCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerProfileResponse.php',
'net\authorize\api\contract\v1\UpdateCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerShippingAddressRequest.php',
'net\authorize\api\contract\v1\UpdateCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerShippingAddressResponse.php',
'net\authorize\api\contract\v1\UpdateHeldTransactionRequest'=> $libDir . 'net/authorize/api/contract/v1/UpdateHeldTransactionRequest.php',
'net\authorize\api\contract\v1\UpdateHeldTransactionResponse'=> $libDir . 'net/authorize/api/contract/v1/UpdateHeldTransactionResponse.php',
'net\authorize\api\contract\v1\UpdateSplitTenderGroupRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateSplitTenderGroupRequest.php',
'net\authorize\api\contract\v1\UpdateSplitTenderGroupResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateSplitTenderGroupResponse.php',
'net\authorize\api\contract\v1\UserFieldType' => $libDir . 'net/authorize/api/contract/v1/UserFieldType.php',
'net\authorize\api\contract\v1\ValidateCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/ValidateCustomerPaymentProfileRequest.php',
'net\authorize\api\contract\v1\ValidateCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/ValidateCustomerPaymentProfileResponse.php',
'net\authorize\api\contract\v1\WebCheckOutDataType' => $libDir . 'net/authorize/api/contract/v1/WebCheckOutDataType.php',
'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType.php',
'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType\DeviceInfoAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/DeviceInfoAType.php',
'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType\EncryptedDataAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/EncryptedDataAType.php',
'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType\ModeAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/ModeAType.php',
'net\authorize\api\contract\v1\MessagesType\MessageAType' => $libDir . 'net/authorize/api/contract/v1/MessagesType/MessageAType.php',
'net\authorize\api\contract\v1\PaymentScheduleType\IntervalAType' => $libDir . 'net/authorize/api/contract/v1/PaymentScheduleType/IntervalAType.php',
'net\authorize\api\contract\v1\TransactionRequestType\UserFieldsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionRequestType/UserFieldsAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/ErrorsAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\MessagesAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/MessagesAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\PrePaidCardAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/PrePaidCardAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\SecureAcceptanceAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/SecureAcceptanceAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\SplitTenderPaymentsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/SplitTenderPaymentsAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\UserFieldsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/UserFieldsAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/ErrorsAType/ErrorAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\MessagesAType\MessageAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/MessagesAType/MessageAType.php',
'net\authorize\api\contract\v1\TransactionResponseType\SplitTenderPaymentsAType\SplitTenderPaymentAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/SplitTenderPaymentsAType/SplitTenderPaymentAType.php',
'net\authorize\api\contract\v1\WebCheckOutDataType\TokenAType' => $libDir . 'net/authorize/api/contract/v1/WebCheckOutDataType/TokenAType.php',
'net\authorize\api\contract\v1\GetTransactionListForCustomerRequest' => $libDir . 'net/authorize/api/contract/v1/GetTransactionListForCustomerRequest.php',
'net\authorize\api\contract\v1\GetAUJobSummaryRequest' => $libDir . 'net/authorize/api/contract/v1/getAUJobSummaryRequest.php',
'net\authorize\api\contract\v1\GetAUJobSummaryResponse' => $libDir . 'net/authorize/api/contract/v1/GetAUJobSummaryResponse.php',
'net\authorize\api\contract\v1\GetAUJobDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/GetAUJobDetailsRequest.php',
'net\authorize\api\contract\v1\GetAUJobDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/GetAUJobDetailsResponse.php',
'net\authorize\api\contract\v1\AuDeleteType' => $libDir . 'net/authorize/api/contract/v1/AuDeleteType.php',
'net\authorize\api\contract\v1\AuDetailsType' => $libDir . 'net/authorize/api/contract/v1/AuDetailsType.php',
'net\authorize\api\contract\v1\AuResponseType' => $libDir . 'net/authorize/api/contract/v1/AuResponseType.php',
'net\authorize\api\contract\v1\AuUpdateType' => $libDir . 'net/authorize/api/contract/v1/AuUpdateType.php',
'net\authorize\api\contract\v1\ListOfAUDetailsType' => $libDir . 'net/authorize/api/contract/v1/ListOfAUDetailsType.php',
'net\authorize\api\contract\v1\EmvTagType' => $libDir . 'net/authorize/api/contract/v1/EmvTagType.php',
'net\authorize\api\contract\v1\PaymentEmvType' => $libDir . 'net/authorize/api/contract/v1/PaymentEmvType.php',
'net\authorize\api\contract\v1\OtherTaxType' => $libDir . 'net/authorize/api/contract/v1/OtherTaxType.php',
'net\authorize\api\contract\v1\UpdateMerchantDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateMerchantDetailsRequest.php',
'net\authorize\api\contract\v1\UpdateMerchantDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateMerchantDetailsResponse.php',
'net\authorize\api\contract\v1\WebCheckOutDataTypeTokenType' => $libDir . 'net/authorize/api/contract/v1/WebCheckOutDataTypeTokenType.php',
//Controllers
'net\authorize\api\controller\ARBCancelSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBCancelSubscriptionController.php',
'net\authorize\api\controller\ARBCreateSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBCreateSubscriptionController.php',
'net\authorize\api\controller\ARBGetSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBGetSubscriptionController.php',
'net\authorize\api\controller\ARBGetSubscriptionListController' => $libDir . 'net/authorize/api/controller/ARBGetSubscriptionListController.php',
'net\authorize\api\controller\ARBGetSubscriptionStatusController' => $libDir . 'net/authorize/api/controller/ARBGetSubscriptionStatusController.php',
'net\authorize\api\controller\ARBUpdateSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBUpdateSubscriptionController.php',
'net\authorize\api\controller\AuthenticateTestController' => $libDir . 'net/authorize/api/controller/AuthenticateTestController.php',
'net\authorize\api\controller\CreateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/CreateCustomerPaymentProfileController.php',
'net\authorize\api\controller\CreateCustomerProfileController' => $libDir . 'net/authorize/api/controller/CreateCustomerProfileController.php',
'net\authorize\api\controller\CreateCustomerProfileFromTransactionController' => $libDir . 'net/authorize/api/controller/CreateCustomerProfileFromTransactionController.php',
'net\authorize\api\controller\CreateCustomerProfileTransactionController' => $libDir . 'net/authorize/api/controller/CreateCustomerProfileTransactionController.php',
'net\authorize\api\controller\CreateCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/CreateCustomerShippingAddressController.php',
'net\authorize\api\controller\CreateTransactionController' => $libDir . 'net/authorize/api/controller/CreateTransactionController.php',
'net\authorize\api\controller\DecryptPaymentDataController' => $libDir . 'net/authorize/api/controller/DecryptPaymentDataController.php',
'net\authorize\api\controller\DeleteCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerPaymentProfileController.php',
'net\authorize\api\controller\DeleteCustomerProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerProfileController.php',
'net\authorize\api\controller\DeleteCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/DeleteCustomerShippingAddressController.php',
'net\authorize\api\controller\GetAUJobDetailsController' => $libDir . 'net/authorize/api/controller/GetAUJobDetailsController.php',
'net\authorize\api\controller\GetAUJobSummaryController' => $libDir . 'net/authorize/api/controller/GetAUJobSummaryController.php',
'net\authorize\api\controller\GetBatchStatisticsController' => $libDir . 'net/authorize/api/controller/GetBatchStatisticsController.php',
'net\authorize\api\controller\GetCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileController.php',
'net\authorize\api\controller\GetCustomerPaymentProfileListController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileListController.php',
'net\authorize\api\controller\GetCustomerProfileController' => $libDir . 'net/authorize/api/controller/GetCustomerProfileController.php',
'net\authorize\api\controller\GetCustomerProfileIdsController' => $libDir . 'net/authorize/api/controller/GetCustomerProfileIdsController.php',
'net\authorize\api\controller\GetCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/GetCustomerShippingAddressController.php',
'net\authorize\api\controller\GetHostedPaymentPageController' => $libDir . 'net/authorize/api/controller/GetHostedPaymentPageController.php',
'net\authorize\api\controller\GetHostedProfilePageController' => $libDir . 'net/authorize/api/controller/GetHostedProfilePageController.php',
'net\authorize\api\controller\GetMerchantDetailsController' => $libDir . 'net/authorize/api/controller/GetMerchantDetailsController.php',
'net\authorize\api\controller\GetSettledBatchListController' => $libDir . 'net/authorize/api/controller/GetSettledBatchListController.php',
'net\authorize\api\controller\GetTransactionDetailsController' => $libDir . 'net/authorize/api/controller/GetTransactionDetailsController.php',
'net\authorize\api\controller\GetTransactionListController' => $libDir . 'net/authorize/api/controller/GetTransactionListController.php',
'net\authorize\api\controller\GetTransactionListForCustomerController' => $libDir . 'net/authorize/api/controller/GetTransactionListForCustomerController.php',
'net\authorize\api\controller\GetUnsettledTransactionListController' => $libDir . 'net/authorize/api/controller/GetUnsettledTransactionListController.php',
'net\authorize\api\controller\IsAliveController' => $libDir . 'net/authorize/api/controller/IsAliveController.php',
'net\authorize\api\controller\LogoutController' => $libDir . 'net/authorize/api/controller/LogoutController.php',
'net\authorize\api\controller\MobileDeviceLoginController' => $libDir . 'net/authorize/api/controller/MobileDeviceLoginController.php',
'net\authorize\api\controller\MobileDeviceRegistrationController' => $libDir . 'net/authorize/api/controller/MobileDeviceRegistrationController.php',
'net\authorize\api\controller\SecurePaymentContainerController' => $libDir . 'net/authorize/api/controller/SecurePaymentContainerController.php',
'net\authorize\api\controller\SendCustomerTransactionReceiptController' => $libDir . 'net/authorize/api/controller/SendCustomerTransactionReceiptController.php',
'net\authorize\api\controller\UpdateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/UpdateCustomerPaymentProfileController.php',
'net\authorize\api\controller\UpdateCustomerProfileController' => $libDir . 'net/authorize/api/controller/UpdateCustomerProfileController.php',
'net\authorize\api\controller\UpdateCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/UpdateCustomerShippingAddressController.php',
'net\authorize\api\controller\UpdateHeldTransactionController' => $libDir . 'net/authorize/api/controller/UpdateHeldTransactionController.php',
'net\authorize\api\controller\UpdateMerchantDetailsController' => $libDir . 'net/authorize/api/controller/UpdateMerchantDetailsController.php',
'net\authorize\api\controller\UpdateSplitTenderGroupController' => $libDir . 'net/authorize/api/controller/UpdateSplitTenderGroupController.php',
'net\authorize\api\controller\ValidateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/ValidateCustomerPaymentProfileController.php'
);

@ -0,0 +1,11 @@
<?php
namespace net\authorize\api\constants;
class ANetEnvironment
{
const CUSTOM = "http://wwww.myendpoint.com";
const SANDBOX = "https://apitest.authorize.net";
const PRODUCTION = "https://api2.authorize.net";
const VERSION = "2.0.1";
}

@ -0,0 +1,182 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ANetApiRequestType
*
*
* XSD Type: ANetApiRequest
*/
class ANetApiRequestType implements \JsonSerializable
{
/**
* @property \net\authorize\api\contract\v1\MerchantAuthenticationType
* $merchantAuthentication
*/
private $merchantAuthentication = null;
/**
* @property string $clientId
*/
private $clientId = null;
/**
* @property string $refId
*/
private $refId = null;
/**
* Gets as merchantAuthentication
*
* @return \net\authorize\api\contract\v1\MerchantAuthenticationType
*/
public function getMerchantAuthentication()
{
return $this->merchantAuthentication;
}
/**
* Sets a new merchantAuthentication
*
* @param \net\authorize\api\contract\v1\MerchantAuthenticationType
* $merchantAuthentication
* @return self
*/
public function setMerchantAuthentication(\net\authorize\api\contract\v1\MerchantAuthenticationType $merchantAuthentication)
{
$this->merchantAuthentication = $merchantAuthentication;
return $this;
}
/**
* Gets as clientId
*
* @return string
*/
public function getClientId()
{
return $this->clientId;
}
/**
* Sets a new clientId
*
* @param string $clientId
* @return self
*/
public function setClientId($clientId)
{
$this->clientId = $clientId;
return $this;
}
/**
* Gets as refId
*
* @return string
*/
public function getRefId()
{
return $this->refId;
}
/**
* Sets a new refId
*
* @param string $refId
* @return self
*/
public function setRefId($refId)
{
$this->refId = $refId;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,180 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ANetApiResponseType
*
*
* XSD Type: ANetApiResponse
*/
class ANetApiResponseType implements \JsonSerializable
{
/**
* @property string $refId
*/
private $refId = null;
/**
* @property \net\authorize\api\contract\v1\MessagesType $messages
*/
private $messages = null;
/**
* @property string $sessionToken
*/
private $sessionToken = null;
/**
* Gets as refId
*
* @return string
*/
public function getRefId()
{
return $this->refId;
}
/**
* Sets a new refId
*
* @param string $refId
* @return self
*/
public function setRefId($refId)
{
$this->refId = $refId;
return $this;
}
/**
* Gets as messages
*
* @return \net\authorize\api\contract\v1\MessagesType
*/
public function getMessages()
{
return $this->messages;
}
/**
* Sets a new messages
*
* @param \net\authorize\api\contract\v1\MessagesType $messages
* @return self
*/
public function setMessages(\net\authorize\api\contract\v1\MessagesType $messages)
{
$this->messages = $messages;
return $this;
}
/**
* Gets as sessionToken
*
* @return string
*/
public function getSessionToken()
{
return $this->sessionToken;
}
/**
* Sets a new sessionToken
*
* @param string $sessionToken
* @return self
*/
public function setSessionToken($sessionToken)
{
$this->sessionToken = $sessionToken;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,75 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBCancelSubscriptionRequest
*/
class ARBCancelSubscriptionRequest extends ANetApiRequestType
{
/**
* @property string $subscriptionId
*/
private $subscriptionId = null;
/**
* Gets as subscriptionId
*
* @return string
*/
public function getSubscriptionId()
{
return $this->subscriptionId;
}
/**
* Sets a new subscriptionId
*
* @param string $subscriptionId
* @return self
*/
public function setSubscriptionId($subscriptionId)
{
$this->subscriptionId = $subscriptionId;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,61 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBCancelSubscriptionResponse
*/
class ARBCancelSubscriptionResponse extends ANetApiResponseType
{
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,75 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBCreateSubscriptionRequest
*/
class ARBCreateSubscriptionRequest extends ANetApiRequestType
{
/**
* @property \net\authorize\api\contract\v1\ARBSubscriptionType $subscription
*/
private $subscription = null;
/**
* Gets as subscription
*
* @return \net\authorize\api\contract\v1\ARBSubscriptionType
*/
public function getSubscription()
{
return $this->subscription;
}
/**
* Sets a new subscription
*
* @param \net\authorize\api\contract\v1\ARBSubscriptionType $subscription
* @return self
*/
public function setSubscription(\net\authorize\api\contract\v1\ARBSubscriptionType $subscription)
{
$this->subscription = $subscription;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,115 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBCreateSubscriptionResponse
*/
class ARBCreateSubscriptionResponse extends ANetApiResponseType
{
/**
* @property string $subscriptionId
*/
private $subscriptionId = null;
/**
* @property \net\authorize\api\contract\v1\CustomerProfileIdType $profile
*/
private $profile = null;
/**
* Gets as subscriptionId
*
* @return string
*/
public function getSubscriptionId()
{
return $this->subscriptionId;
}
/**
* Sets a new subscriptionId
*
* @param string $subscriptionId
* @return self
*/
public function setSubscriptionId($subscriptionId)
{
$this->subscriptionId = $subscriptionId;
return $this;
}
/**
* Gets as profile
*
* @return \net\authorize\api\contract\v1\CustomerProfileIdType
*/
public function getProfile()
{
return $this->profile;
}
/**
* Sets a new profile
*
* @param \net\authorize\api\contract\v1\CustomerProfileIdType $profile
* @return self
*/
public function setProfile(\net\authorize\api\contract\v1\CustomerProfileIdType $profile)
{
$this->profile = $profile;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,130 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionListRequest
*/
class ARBGetSubscriptionListRequest extends ANetApiRequestType
{
/**
* @property string $searchType
*/
private $searchType = null;
/**
* @property \net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType
* $sorting
*/
private $sorting = null;
/**
* @property \net\authorize\api\contract\v1\PagingType $paging
*/
private $paging = null;
/**
* Gets as searchType
*
* @return string
*/
public function getSearchType()
{
return $this->searchType;
}
/**
* Sets a new searchType
*
* @param string $searchType
* @return self
*/
public function setSearchType($searchType)
{
$this->searchType = $searchType;
return $this;
}
/**
* Gets as sorting
*
* @return \net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType
*/
public function getSorting()
{
return $this->sorting;
}
/**
* Sets a new sorting
*
* @param \net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType $sorting
* @return self
*/
public function setSorting(\net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType $sorting)
{
$this->sorting = $sorting;
return $this;
}
/**
* Gets as paging
*
* @return \net\authorize\api\contract\v1\PagingType
*/
public function getPaging()
{
return $this->paging;
}
/**
* Sets a new paging
*
* @param \net\authorize\api\contract\v1\PagingType $paging
* @return self
*/
public function setPaging(\net\authorize\api\contract\v1\PagingType $paging)
{
$this->paging = $paging;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,151 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionListResponse
*/
class ARBGetSubscriptionListResponse extends ANetApiResponseType
{
/**
* @property integer $totalNumInResultSet
*/
private $totalNumInResultSet = null;
/**
* @property \net\authorize\api\contract\v1\SubscriptionDetailType[]
* $subscriptionDetails
*/
private $subscriptionDetails = null;
/**
* Gets as totalNumInResultSet
*
* @return integer
*/
public function getTotalNumInResultSet()
{
return $this->totalNumInResultSet;
}
/**
* Sets a new totalNumInResultSet
*
* @param integer $totalNumInResultSet
* @return self
*/
public function setTotalNumInResultSet($totalNumInResultSet)
{
$this->totalNumInResultSet = $totalNumInResultSet;
return $this;
}
/**
* Adds as subscriptionDetail
*
* @return self
* @param \net\authorize\api\contract\v1\SubscriptionDetailType $subscriptionDetail
*/
public function addToSubscriptionDetails(\net\authorize\api\contract\v1\SubscriptionDetailType $subscriptionDetail)
{
$this->subscriptionDetails[] = $subscriptionDetail;
return $this;
}
/**
* isset subscriptionDetails
*
* @param scalar $index
* @return boolean
*/
public function issetSubscriptionDetails($index)
{
return isset($this->subscriptionDetails[$index]);
}
/**
* unset subscriptionDetails
*
* @param scalar $index
* @return void
*/
public function unsetSubscriptionDetails($index)
{
unset($this->subscriptionDetails[$index]);
}
/**
* Gets as subscriptionDetails
*
* @return \net\authorize\api\contract\v1\SubscriptionDetailType[]
*/
public function getSubscriptionDetails()
{
return $this->subscriptionDetails;
}
/**
* Sets a new subscriptionDetails
*
* @param \net\authorize\api\contract\v1\SubscriptionDetailType[]
* $subscriptionDetails
* @return self
*/
public function setSubscriptionDetails(array $subscriptionDetails)
{
$this->subscriptionDetails = $subscriptionDetails;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,153 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionListSortingType
*
*
* XSD Type: ARBGetSubscriptionListSorting
*/
class ARBGetSubscriptionListSortingType implements \JsonSerializable
{
/**
* @property string $orderBy
*/
private $orderBy = null;
/**
* @property boolean $orderDescending
*/
private $orderDescending = null;
/**
* Gets as orderBy
*
* @return string
*/
public function getOrderBy()
{
return $this->orderBy;
}
/**
* Sets a new orderBy
*
* @param string $orderBy
* @return self
*/
public function setOrderBy($orderBy)
{
$this->orderBy = $orderBy;
return $this;
}
/**
* Gets as orderDescending
*
* @return boolean
*/
public function getOrderDescending()
{
return $this->orderDescending;
}
/**
* Sets a new orderDescending
*
* @param boolean $orderDescending
* @return self
*/
public function setOrderDescending($orderDescending)
{
$this->orderDescending = $orderDescending;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,102 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionRequest
*/
class ARBGetSubscriptionRequest extends ANetApiRequestType
{
/**
* @property string $subscriptionId
*/
private $subscriptionId = null;
/**
* @property boolean $includeTransactions
*/
private $includeTransactions = null;
/**
* Gets as subscriptionId
*
* @return string
*/
public function getSubscriptionId()
{
return $this->subscriptionId;
}
/**
* Sets a new subscriptionId
*
* @param string $subscriptionId
* @return self
*/
public function setSubscriptionId($subscriptionId)
{
$this->subscriptionId = $subscriptionId;
return $this;
}
/**
* Gets as includeTransactions
*
* @return boolean
*/
public function getIncludeTransactions()
{
return $this->includeTransactions;
}
/**
* Sets a new includeTransactions
*
* @param boolean $includeTransactions
* @return self
*/
public function setIncludeTransactions($includeTransactions)
{
$this->includeTransactions = $includeTransactions;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,88 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionResponse
*/
class ARBGetSubscriptionResponse extends ANetApiResponseType
{
/**
* @property \net\authorize\api\contract\v1\ARBSubscriptionMaskedType $subscription
*/
private $subscription = null;
/**
* Gets as subscription
*
* @return \net\authorize\api\contract\v1\ARBSubscriptionMaskedType
*/
public function getSubscription()
{
return $this->subscription;
}
/**
* Sets a new subscription
*
* @param \net\authorize\api\contract\v1\ARBSubscriptionMaskedType $subscription
* @return self
*/
public function setSubscription(\net\authorize\api\contract\v1\ARBSubscriptionMaskedType $subscription)
{
$this->subscription = $subscription;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,75 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionStatusRequest
*/
class ARBGetSubscriptionStatusRequest extends ANetApiRequestType
{
/**
* @property string $subscriptionId
*/
private $subscriptionId = null;
/**
* Gets as subscriptionId
*
* @return string
*/
public function getSubscriptionId()
{
return $this->subscriptionId;
}
/**
* Sets a new subscriptionId
*
* @param string $subscriptionId
* @return self
*/
public function setSubscriptionId($subscriptionId)
{
$this->subscriptionId = $subscriptionId;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,88 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBGetSubscriptionStatusResponse
*/
class ARBGetSubscriptionStatusResponse extends ANetApiResponseType
{
/**
* @property string $status
*/
private $status = null;
/**
* Gets as status
*
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Sets a new status
*
* @param string $status
* @return self
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,350 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBSubscriptionMaskedType
*
*
* XSD Type: ARBSubscriptionMaskedType
*/
class ARBSubscriptionMaskedType implements \JsonSerializable
{
/**
* @property string $name
*/
private $name = null;
/**
* @property \net\authorize\api\contract\v1\PaymentScheduleType $paymentSchedule
*/
private $paymentSchedule = null;
/**
* @property float $amount
*/
private $amount = null;
/**
* @property float $trialAmount
*/
private $trialAmount = null;
/**
* @property string $status
*/
private $status = null;
/**
* @property \net\authorize\api\contract\v1\SubscriptionCustomerProfileType
* $profile
*/
private $profile = null;
/**
* @property \net\authorize\api\contract\v1\OrderType $order
*/
private $order = null;
/**
* @property \net\authorize\api\contract\v1\ArbTransactionType[] $arbTransactions
*/
private $arbTransactions = null;
/**
* Gets as name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sets a new name
*
* @param string $name
* @return self
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Gets as paymentSchedule
*
* @return \net\authorize\api\contract\v1\PaymentScheduleType
*/
public function getPaymentSchedule()
{
return $this->paymentSchedule;
}
/**
* Sets a new paymentSchedule
*
* @param \net\authorize\api\contract\v1\PaymentScheduleType $paymentSchedule
* @return self
*/
public function setPaymentSchedule(\net\authorize\api\contract\v1\PaymentScheduleType $paymentSchedule)
{
$this->paymentSchedule = $paymentSchedule;
return $this;
}
/**
* Gets as amount
*
* @return float
*/
public function getAmount()
{
return $this->amount;
}
/**
* Sets a new amount
*
* @param float $amount
* @return self
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Gets as trialAmount
*
* @return float
*/
public function getTrialAmount()
{
return $this->trialAmount;
}
/**
* Sets a new trialAmount
*
* @param float $trialAmount
* @return self
*/
public function setTrialAmount($trialAmount)
{
$this->trialAmount = $trialAmount;
return $this;
}
/**
* Gets as status
*
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Sets a new status
*
* @param string $status
* @return self
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Gets as profile
*
* @return \net\authorize\api\contract\v1\SubscriptionCustomerProfileType
*/
public function getProfile()
{
return $this->profile;
}
/**
* Sets a new profile
*
* @param \net\authorize\api\contract\v1\SubscriptionCustomerProfileType $profile
* @return self
*/
public function setProfile(\net\authorize\api\contract\v1\SubscriptionCustomerProfileType $profile)
{
$this->profile = $profile;
return $this;
}
/**
* Gets as order
*
* @return \net\authorize\api\contract\v1\OrderType
*/
public function getOrder()
{
return $this->order;
}
/**
* Sets a new order
*
* @param \net\authorize\api\contract\v1\OrderType $order
* @return self
*/
public function setOrder(\net\authorize\api\contract\v1\OrderType $order)
{
$this->order = $order;
return $this;
}
/**
* Adds as arbTransaction
*
* @return self
* @param \net\authorize\api\contract\v1\ArbTransactionType $arbTransaction
*/
public function addToArbTransactions(\net\authorize\api\contract\v1\ArbTransactionType $arbTransaction)
{
$this->arbTransactions[] = $arbTransaction;
return $this;
}
/**
* isset arbTransactions
*
* @param scalar $index
* @return boolean
*/
public function issetArbTransactions($index)
{
return isset($this->arbTransactions[$index]);
}
/**
* unset arbTransactions
*
* @param scalar $index
* @return void
*/
public function unsetArbTransactions($index)
{
unset($this->arbTransactions[$index]);
}
/**
* Gets as arbTransactions
*
* @return \net\authorize\api\contract\v1\ArbTransactionType[]
*/
public function getArbTransactions()
{
return $this->arbTransactions;
}
/**
* Sets a new arbTransactions
*
* @param \net\authorize\api\contract\v1\ArbTransactionType[] $arbTransactions
* @return self
*/
public function setArbTransactions(array $arbTransactions)
{
$this->arbTransactions = $arbTransactions;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,369 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBSubscriptionType
*
*
* XSD Type: ARBSubscriptionType
*/
class ARBSubscriptionType implements \JsonSerializable
{
/**
* @property string $name
*/
private $name = null;
/**
* @property \net\authorize\api\contract\v1\PaymentScheduleType $paymentSchedule
*/
private $paymentSchedule = null;
/**
* @property float $amount
*/
private $amount = null;
/**
* @property float $trialAmount
*/
private $trialAmount = null;
/**
* @property \net\authorize\api\contract\v1\PaymentType $payment
*/
private $payment = null;
/**
* @property \net\authorize\api\contract\v1\OrderType $order
*/
private $order = null;
/**
* @property \net\authorize\api\contract\v1\CustomerType $customer
*/
private $customer = null;
/**
* @property \net\authorize\api\contract\v1\NameAndAddressType $billTo
*/
private $billTo = null;
/**
* @property \net\authorize\api\contract\v1\NameAndAddressType $shipTo
*/
private $shipTo = null;
/**
* @property \net\authorize\api\contract\v1\CustomerProfileIdType $profile
*/
private $profile = null;
/**
* Gets as name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Sets a new name
*
* @param string $name
* @return self
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Gets as paymentSchedule
*
* @return \net\authorize\api\contract\v1\PaymentScheduleType
*/
public function getPaymentSchedule()
{
return $this->paymentSchedule;
}
/**
* Sets a new paymentSchedule
*
* @param \net\authorize\api\contract\v1\PaymentScheduleType $paymentSchedule
* @return self
*/
public function setPaymentSchedule(\net\authorize\api\contract\v1\PaymentScheduleType $paymentSchedule)
{
$this->paymentSchedule = $paymentSchedule;
return $this;
}
/**
* Gets as amount
*
* @return float
*/
public function getAmount()
{
return $this->amount;
}
/**
* Sets a new amount
*
* @param float $amount
* @return self
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Gets as trialAmount
*
* @return float
*/
public function getTrialAmount()
{
return $this->trialAmount;
}
/**
* Sets a new trialAmount
*
* @param float $trialAmount
* @return self
*/
public function setTrialAmount($trialAmount)
{
$this->trialAmount = $trialAmount;
return $this;
}
/**
* Gets as payment
*
* @return \net\authorize\api\contract\v1\PaymentType
*/
public function getPayment()
{
return $this->payment;
}
/**
* Sets a new payment
*
* @param \net\authorize\api\contract\v1\PaymentType $payment
* @return self
*/
public function setPayment(\net\authorize\api\contract\v1\PaymentType $payment)
{
$this->payment = $payment;
return $this;
}
/**
* Gets as order
*
* @return \net\authorize\api\contract\v1\OrderType
*/
public function getOrder()
{
return $this->order;
}
/**
* Sets a new order
*
* @param \net\authorize\api\contract\v1\OrderType $order
* @return self
*/
public function setOrder(\net\authorize\api\contract\v1\OrderType $order)
{
$this->order = $order;
return $this;
}
/**
* Gets as customer
*
* @return \net\authorize\api\contract\v1\CustomerType
*/
public function getCustomer()
{
return $this->customer;
}
/**
* Sets a new customer
*
* @param \net\authorize\api\contract\v1\CustomerType $customer
* @return self
*/
public function setCustomer(\net\authorize\api\contract\v1\CustomerType $customer)
{
$this->customer = $customer;
return $this;
}
/**
* Gets as billTo
*
* @return \net\authorize\api\contract\v1\NameAndAddressType
*/
public function getBillTo()
{
return $this->billTo;
}
/**
* Sets a new billTo
*
* @param \net\authorize\api\contract\v1\NameAndAddressType $billTo
* @return self
*/
public function setBillTo(\net\authorize\api\contract\v1\NameAndAddressType $billTo)
{
$this->billTo = $billTo;
return $this;
}
/**
* Gets as shipTo
*
* @return \net\authorize\api\contract\v1\NameAndAddressType
*/
public function getShipTo()
{
return $this->shipTo;
}
/**
* Sets a new shipTo
*
* @param \net\authorize\api\contract\v1\NameAndAddressType $shipTo
* @return self
*/
public function setShipTo(\net\authorize\api\contract\v1\NameAndAddressType $shipTo)
{
$this->shipTo = $shipTo;
return $this;
}
/**
* Gets as profile
*
* @return \net\authorize\api\contract\v1\CustomerProfileIdType
*/
public function getProfile()
{
return $this->profile;
}
/**
* Sets a new profile
*
* @param \net\authorize\api\contract\v1\CustomerProfileIdType $profile
* @return self
*/
public function setProfile(\net\authorize\api\contract\v1\CustomerProfileIdType $profile)
{
$this->profile = $profile;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,102 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBUpdateSubscriptionRequest
*/
class ARBUpdateSubscriptionRequest extends ANetApiRequestType
{
/**
* @property string $subscriptionId
*/
private $subscriptionId = null;
/**
* @property \net\authorize\api\contract\v1\ARBSubscriptionType $subscription
*/
private $subscription = null;
/**
* Gets as subscriptionId
*
* @return string
*/
public function getSubscriptionId()
{
return $this->subscriptionId;
}
/**
* Sets a new subscriptionId
*
* @param string $subscriptionId
* @return self
*/
public function setSubscriptionId($subscriptionId)
{
$this->subscriptionId = $subscriptionId;
return $this;
}
/**
* Gets as subscription
*
* @return \net\authorize\api\contract\v1\ARBSubscriptionType
*/
public function getSubscription()
{
return $this->subscription;
}
/**
* Sets a new subscription
*
* @param \net\authorize\api\contract\v1\ARBSubscriptionType $subscription
* @return self
*/
public function setSubscription(\net\authorize\api\contract\v1\ARBSubscriptionType $subscription)
{
$this->subscription = $subscription;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,88 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ARBUpdateSubscriptionResponse
*/
class ARBUpdateSubscriptionResponse extends ANetApiResponseType
{
/**
* @property \net\authorize\api\contract\v1\CustomerProfileIdType $profile
*/
private $profile = null;
/**
* Gets as profile
*
* @return \net\authorize\api\contract\v1\CustomerProfileIdType
*/
public function getProfile()
{
return $this->profile;
}
/**
* Sets a new profile
*
* @param \net\authorize\api\contract\v1\CustomerProfileIdType $profile
* @return self
*/
public function setProfile(\net\authorize\api\contract\v1\CustomerProfileIdType $profile)
{
$this->profile = $profile;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,234 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ArbTransactionType
*
*
* XSD Type: arbTransaction
*/
class ArbTransactionType implements \JsonSerializable
{
/**
* @property string $transId
*/
private $transId = null;
/**
* @property string $response
*/
private $response = null;
/**
* @property \DateTime $submitTimeUTC
*/
private $submitTimeUTC = null;
/**
* @property integer $payNum
*/
private $payNum = null;
/**
* @property integer $attemptNum
*/
private $attemptNum = null;
/**
* Gets as transId
*
* @return string
*/
public function getTransId()
{
return $this->transId;
}
/**
* Sets a new transId
*
* @param string $transId
* @return self
*/
public function setTransId($transId)
{
$this->transId = $transId;
return $this;
}
/**
* Gets as response
*
* @return string
*/
public function getResponse()
{
return $this->response;
}
/**
* Sets a new response
*
* @param string $response
* @return self
*/
public function setResponse($response)
{
$this->response = $response;
return $this;
}
/**
* Gets as submitTimeUTC
*
* @return \DateTime
*/
public function getSubmitTimeUTC()
{
return $this->submitTimeUTC;
}
/**
* Sets a new submitTimeUTC
*
* @param \DateTime $submitTimeUTC
* @return self
*/
public function setSubmitTimeUTC(\DateTime $submitTimeUTC)
{
$this->submitTimeUTC = $submitTimeUTC;
return $this;
}
/**
* Gets as payNum
*
* @return integer
*/
public function getPayNum()
{
return $this->payNum;
}
/**
* Sets a new payNum
*
* @param integer $payNum
* @return self
*/
public function setPayNum($payNum)
{
$this->payNum = $payNum;
return $this;
}
/**
* Gets as attemptNum
*
* @return integer
*/
public function getAttemptNum()
{
return $this->attemptNum;
}
/**
* Sets a new attemptNum
*
* @param integer $attemptNum
* @return self
*/
public function setAttemptNum($attemptNum)
{
$this->attemptNum = $attemptNum;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,160 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing ArrayOfSettingType
*
*
* XSD Type: ArrayOfSetting
*/
class ArrayOfSettingType implements \JsonSerializable
{
/**
* @property \net\authorize\api\contract\v1\SettingType[] $setting
*/
private $setting = null;
/**
* Adds as setting
*
* @return self
* @param \net\authorize\api\contract\v1\SettingType $setting
*/
public function addToSetting(\net\authorize\api\contract\v1\SettingType $setting)
{
$this->setting[] = $setting;
return $this;
}
/**
* isset setting
*
* @param scalar $index
* @return boolean
*/
public function issetSetting($index)
{
return isset($this->setting[$index]);
}
/**
* unset setting
*
* @param scalar $index
* @return void
*/
public function unsetSetting($index)
{
unset($this->setting[$index]);
}
/**
* Gets as setting
*
* @return \net\authorize\api\contract\v1\SettingType[]
*/
public function getSetting()
{
return $this->setting;
}
/**
* Sets a new setting
*
* @param \net\authorize\api\contract\v1\SettingType[] $setting
* @return self
*/
public function setSetting(array $setting)
{
$this->setting = $setting;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,126 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing AuDeleteType
*
*
* XSD Type: auDeleteType
*/
class AuDeleteType extends AuDetailsType implements \JsonSerializable
{
/**
* @property \net\authorize\api\contract\v1\CreditCardMaskedType $creditCard
*/
private $creditCard = null;
/**
* Gets as creditCard
*
* @return \net\authorize\api\contract\v1\CreditCardMaskedType
*/
public function getCreditCard()
{
return $this->creditCard;
}
/**
* Sets a new creditCard
*
* @param \net\authorize\api\contract\v1\CreditCardMaskedType $creditCard
* @return self
*/
public function setCreditCard(\net\authorize\api\contract\v1\CreditCardMaskedType $creditCard)
{
$this->creditCard = $creditCard;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,288 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing AuDetailsType
*
*
* XSD Type: auDetailsType
*/
class AuDetailsType implements \JsonSerializable
{
/**
* @property integer $customerProfileID
*/
private $customerProfileID = null;
/**
* @property integer $customerPaymentProfileID
*/
private $customerPaymentProfileID = null;
/**
* @property string $firstName
*/
private $firstName = null;
/**
* @property string $lastName
*/
private $lastName = null;
/**
* @property string $updateTimeUTC
*/
private $updateTimeUTC = null;
/**
* @property string $auReasonCode
*/
private $auReasonCode = null;
/**
* @property string $reasonDescription
*/
private $reasonDescription = null;
/**
* Gets as customerProfileID
*
* @return integer
*/
public function getCustomerProfileID()
{
return $this->customerProfileID;
}
/**
* Sets a new customerProfileID
*
* @param integer $customerProfileID
* @return self
*/
public function setCustomerProfileID($customerProfileID)
{
$this->customerProfileID = $customerProfileID;
return $this;
}
/**
* Gets as customerPaymentProfileID
*
* @return integer
*/
public function getCustomerPaymentProfileID()
{
return $this->customerPaymentProfileID;
}
/**
* Sets a new customerPaymentProfileID
*
* @param integer $customerPaymentProfileID
* @return self
*/
public function setCustomerPaymentProfileID($customerPaymentProfileID)
{
$this->customerPaymentProfileID = $customerPaymentProfileID;
return $this;
}
/**
* Gets as firstName
*
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* Sets a new firstName
*
* @param string $firstName
* @return self
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
return $this;
}
/**
* Gets as lastName
*
* @return string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* Sets a new lastName
*
* @param string $lastName
* @return self
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
return $this;
}
/**
* Gets as updateTimeUTC
*
* @return string
*/
public function getUpdateTimeUTC()
{
return $this->updateTimeUTC;
}
/**
* Sets a new updateTimeUTC
*
* @param string $updateTimeUTC
* @return self
*/
public function setUpdateTimeUTC($updateTimeUTC)
{
$this->updateTimeUTC = $updateTimeUTC;
return $this;
}
/**
* Gets as auReasonCode
*
* @return string
*/
public function getAuReasonCode()
{
return $this->auReasonCode;
}
/**
* Sets a new auReasonCode
*
* @param string $auReasonCode
* @return self
*/
public function setAuReasonCode($auReasonCode)
{
$this->auReasonCode = $auReasonCode;
return $this;
}
/**
* Gets as reasonDescription
*
* @return string
*/
public function getReasonDescription()
{
return $this->reasonDescription;
}
/**
* Sets a new reasonDescription
*
* @param string $reasonDescription
* @return self
*/
public function setReasonDescription($reasonDescription)
{
$this->reasonDescription = $reasonDescription;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,180 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing AuResponseType
*
*
* XSD Type: auResponseType
*/
class AuResponseType implements \JsonSerializable
{
/**
* @property string $auReasonCode
*/
private $auReasonCode = null;
/**
* @property integer $profileCount
*/
private $profileCount = null;
/**
* @property string $reasonDescription
*/
private $reasonDescription = null;
/**
* Gets as auReasonCode
*
* @return string
*/
public function getAuReasonCode()
{
return $this->auReasonCode;
}
/**
* Sets a new auReasonCode
*
* @param string $auReasonCode
* @return self
*/
public function setAuReasonCode($auReasonCode)
{
$this->auReasonCode = $auReasonCode;
return $this;
}
/**
* Gets as profileCount
*
* @return integer
*/
public function getProfileCount()
{
return $this->profileCount;
}
/**
* Sets a new profileCount
*
* @param integer $profileCount
* @return self
*/
public function setProfileCount($profileCount)
{
$this->profileCount = $profileCount;
return $this;
}
/**
* Gets as reasonDescription
*
* @return string
*/
public function getReasonDescription()
{
return $this->reasonDescription;
}
/**
* Sets a new reasonDescription
*
* @param string $reasonDescription
* @return self
*/
public function setReasonDescription($reasonDescription)
{
$this->reasonDescription = $reasonDescription;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,153 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing AuUpdateType
*
*
* XSD Type: auUpdateType
*/
class AuUpdateType extends AuDetailsType implements \JsonSerializable
{
/**
* @property \net\authorize\api\contract\v1\CreditCardMaskedType $newCreditCard
*/
private $newCreditCard = null;
/**
* @property \net\authorize\api\contract\v1\CreditCardMaskedType $oldCreditCard
*/
private $oldCreditCard = null;
/**
* Gets as newCreditCard
*
* @return \net\authorize\api\contract\v1\CreditCardMaskedType
*/
public function getNewCreditCard()
{
return $this->newCreditCard;
}
/**
* Sets a new newCreditCard
*
* @param \net\authorize\api\contract\v1\CreditCardMaskedType $newCreditCard
* @return self
*/
public function setNewCreditCard(\net\authorize\api\contract\v1\CreditCardMaskedType $newCreditCard)
{
$this->newCreditCard = $newCreditCard;
return $this;
}
/**
* Gets as oldCreditCard
*
* @return \net\authorize\api\contract\v1\CreditCardMaskedType
*/
public function getOldCreditCard()
{
return $this->oldCreditCard;
}
/**
* Sets a new oldCreditCard
*
* @param \net\authorize\api\contract\v1\CreditCardMaskedType $oldCreditCard
* @return self
*/
public function setOldCreditCard(\net\authorize\api\contract\v1\CreditCardMaskedType $oldCreditCard)
{
$this->oldCreditCard = $oldCreditCard;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,48 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing AuthenticateTestRequest
*/
class AuthenticateTestRequest extends ANetApiRequestType
{
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,61 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing AuthenticateTestResponse
*/
class AuthenticateTestResponse extends ANetApiResponseType
{
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,261 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing BankAccountMaskedType
*
*
* XSD Type: bankAccountMaskedType
*/
class BankAccountMaskedType implements \JsonSerializable
{
/**
* @property string $accountType
*/
private $accountType = null;
/**
* @property string $routingNumber
*/
private $routingNumber = null;
/**
* @property string $accountNumber
*/
private $accountNumber = null;
/**
* @property string $nameOnAccount
*/
private $nameOnAccount = null;
/**
* @property string $echeckType
*/
private $echeckType = null;
/**
* @property string $bankName
*/
private $bankName = null;
/**
* Gets as accountType
*
* @return string
*/
public function getAccountType()
{
return $this->accountType;
}
/**
* Sets a new accountType
*
* @param string $accountType
* @return self
*/
public function setAccountType($accountType)
{
$this->accountType = $accountType;
return $this;
}
/**
* Gets as routingNumber
*
* @return string
*/
public function getRoutingNumber()
{
return $this->routingNumber;
}
/**
* Sets a new routingNumber
*
* @param string $routingNumber
* @return self
*/
public function setRoutingNumber($routingNumber)
{
$this->routingNumber = $routingNumber;
return $this;
}
/**
* Gets as accountNumber
*
* @return string
*/
public function getAccountNumber()
{
return $this->accountNumber;
}
/**
* Sets a new accountNumber
*
* @param string $accountNumber
* @return self
*/
public function setAccountNumber($accountNumber)
{
$this->accountNumber = $accountNumber;
return $this;
}
/**
* Gets as nameOnAccount
*
* @return string
*/
public function getNameOnAccount()
{
return $this->nameOnAccount;
}
/**
* Sets a new nameOnAccount
*
* @param string $nameOnAccount
* @return self
*/
public function setNameOnAccount($nameOnAccount)
{
$this->nameOnAccount = $nameOnAccount;
return $this;
}
/**
* Gets as echeckType
*
* @return string
*/
public function getEcheckType()
{
return $this->echeckType;
}
/**
* Sets a new echeckType
*
* @param string $echeckType
* @return self
*/
public function setEcheckType($echeckType)
{
$this->echeckType = $echeckType;
return $this;
}
/**
* Gets as bankName
*
* @return string
*/
public function getBankName()
{
return $this->bankName;
}
/**
* Sets a new bankName
*
* @param string $bankName
* @return self
*/
public function setBankName($bankName)
{
$this->bankName = $bankName;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,288 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing BankAccountType
*
*
* XSD Type: bankAccountType
*/
class BankAccountType implements \JsonSerializable
{
/**
* @property string $accountType
*/
private $accountType = null;
/**
* @property string $routingNumber
*/
private $routingNumber = null;
/**
* @property string $accountNumber
*/
private $accountNumber = null;
/**
* @property string $nameOnAccount
*/
private $nameOnAccount = null;
/**
* @property string $echeckType
*/
private $echeckType = null;
/**
* @property string $bankName
*/
private $bankName = null;
/**
* @property string $checkNumber
*/
private $checkNumber = null;
/**
* Gets as accountType
*
* @return string
*/
public function getAccountType()
{
return $this->accountType;
}
/**
* Sets a new accountType
*
* @param string $accountType
* @return self
*/
public function setAccountType($accountType)
{
$this->accountType = $accountType;
return $this;
}
/**
* Gets as routingNumber
*
* @return string
*/
public function getRoutingNumber()
{
return $this->routingNumber;
}
/**
* Sets a new routingNumber
*
* @param string $routingNumber
* @return self
*/
public function setRoutingNumber($routingNumber)
{
$this->routingNumber = $routingNumber;
return $this;
}
/**
* Gets as accountNumber
*
* @return string
*/
public function getAccountNumber()
{
return $this->accountNumber;
}
/**
* Sets a new accountNumber
*
* @param string $accountNumber
* @return self
*/
public function setAccountNumber($accountNumber)
{
$this->accountNumber = $accountNumber;
return $this;
}
/**
* Gets as nameOnAccount
*
* @return string
*/
public function getNameOnAccount()
{
return $this->nameOnAccount;
}
/**
* Sets a new nameOnAccount
*
* @param string $nameOnAccount
* @return self
*/
public function setNameOnAccount($nameOnAccount)
{
$this->nameOnAccount = $nameOnAccount;
return $this;
}
/**
* Gets as echeckType
*
* @return string
*/
public function getEcheckType()
{
return $this->echeckType;
}
/**
* Sets a new echeckType
*
* @param string $echeckType
* @return self
*/
public function setEcheckType($echeckType)
{
$this->echeckType = $echeckType;
return $this;
}
/**
* Gets as bankName
*
* @return string
*/
public function getBankName()
{
return $this->bankName;
}
/**
* Sets a new bankName
*
* @param string $bankName
* @return self
*/
public function setBankName($bankName)
{
$this->bankName = $bankName;
return $this;
}
/**
* Gets as checkNumber
*
* @return string
*/
public function getCheckNumber()
{
return $this->checkNumber;
}
/**
* Sets a new checkNumber
*
* @param string $checkNumber
* @return self
*/
public function setCheckNumber($checkNumber)
{
$this->checkNumber = $checkNumber;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,349 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing BatchDetailsType
*
*
* XSD Type: batchDetailsType
*/
class BatchDetailsType implements \JsonSerializable
{
/**
* @property string $batchId
*/
private $batchId = null;
/**
* @property \DateTime $settlementTimeUTC
*/
private $settlementTimeUTC = null;
/**
* @property \DateTime $settlementTimeLocal
*/
private $settlementTimeLocal = null;
/**
* @property string $settlementState
*/
private $settlementState = null;
/**
* @property string $paymentMethod
*/
private $paymentMethod = null;
/**
* @property string $marketType
*/
private $marketType = null;
/**
* @property string $product
*/
private $product = null;
/**
* @property \net\authorize\api\contract\v1\BatchStatisticType[] $statistics
*/
private $statistics = null;
/**
* Gets as batchId
*
* @return string
*/
public function getBatchId()
{
return $this->batchId;
}
/**
* Sets a new batchId
*
* @param string $batchId
* @return self
*/
public function setBatchId($batchId)
{
$this->batchId = $batchId;
return $this;
}
/**
* Gets as settlementTimeUTC
*
* @return \DateTime
*/
public function getSettlementTimeUTC()
{
return $this->settlementTimeUTC;
}
/**
* Sets a new settlementTimeUTC
*
* @param \DateTime $settlementTimeUTC
* @return self
*/
public function setSettlementTimeUTC(\DateTime $settlementTimeUTC)
{
$this->settlementTimeUTC = $settlementTimeUTC;
return $this;
}
/**
* Gets as settlementTimeLocal
*
* @return \DateTime
*/
public function getSettlementTimeLocal()
{
return $this->settlementTimeLocal;
}
/**
* Sets a new settlementTimeLocal
*
* @param \DateTime $settlementTimeLocal
* @return self
*/
public function setSettlementTimeLocal(\DateTime $settlementTimeLocal)
{
$this->settlementTimeLocal = $settlementTimeLocal;
return $this;
}
/**
* Gets as settlementState
*
* @return string
*/
public function getSettlementState()
{
return $this->settlementState;
}
/**
* Sets a new settlementState
*
* @param string $settlementState
* @return self
*/
public function setSettlementState($settlementState)
{
$this->settlementState = $settlementState;
return $this;
}
/**
* Gets as paymentMethod
*
* @return string
*/
public function getPaymentMethod()
{
return $this->paymentMethod;
}
/**
* Sets a new paymentMethod
*
* @param string $paymentMethod
* @return self
*/
public function setPaymentMethod($paymentMethod)
{
$this->paymentMethod = $paymentMethod;
return $this;
}
/**
* Gets as marketType
*
* @return string
*/
public function getMarketType()
{
return $this->marketType;
}
/**
* Sets a new marketType
*
* @param string $marketType
* @return self
*/
public function setMarketType($marketType)
{
$this->marketType = $marketType;
return $this;
}
/**
* Gets as product
*
* @return string
*/
public function getProduct()
{
return $this->product;
}
/**
* Sets a new product
*
* @param string $product
* @return self
*/
public function setProduct($product)
{
$this->product = $product;
return $this;
}
/**
* Adds as statistic
*
* @return self
* @param \net\authorize\api\contract\v1\BatchStatisticType $statistic
*/
public function addToStatistics(\net\authorize\api\contract\v1\BatchStatisticType $statistic)
{
$this->statistics[] = $statistic;
return $this;
}
/**
* isset statistics
*
* @param scalar $index
* @return boolean
*/
public function issetStatistics($index)
{
return isset($this->statistics[$index]);
}
/**
* unset statistics
*
* @param scalar $index
* @return void
*/
public function unsetStatistics($index)
{
unset($this->statistics[$index]);
}
/**
* Gets as statistics
*
* @return \net\authorize\api\contract\v1\BatchStatisticType[]
*/
public function getStatistics()
{
return $this->statistics;
}
/**
* Sets a new statistics
*
* @param \net\authorize\api\contract\v1\BatchStatisticType[] $statistics
* @return self
*/
public function setStatistics(array $statistics)
{
$this->statistics = $statistics;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,666 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing BatchStatisticType
*
*
* XSD Type: batchStatisticType
*/
class BatchStatisticType implements \JsonSerializable
{
/**
* @property string $accountType
*/
private $accountType = null;
/**
* @property float $chargeAmount
*/
private $chargeAmount = null;
/**
* @property integer $chargeCount
*/
private $chargeCount = null;
/**
* @property float $refundAmount
*/
private $refundAmount = null;
/**
* @property integer $refundCount
*/
private $refundCount = null;
/**
* @property integer $voidCount
*/
private $voidCount = null;
/**
* @property integer $declineCount
*/
private $declineCount = null;
/**
* @property integer $errorCount
*/
private $errorCount = null;
/**
* @property float $returnedItemAmount
*/
private $returnedItemAmount = null;
/**
* @property integer $returnedItemCount
*/
private $returnedItemCount = null;
/**
* @property float $chargebackAmount
*/
private $chargebackAmount = null;
/**
* @property integer $chargebackCount
*/
private $chargebackCount = null;
/**
* @property integer $correctionNoticeCount
*/
private $correctionNoticeCount = null;
/**
* @property float $chargeChargeBackAmount
*/
private $chargeChargeBackAmount = null;
/**
* @property integer $chargeChargeBackCount
*/
private $chargeChargeBackCount = null;
/**
* @property float $refundChargeBackAmount
*/
private $refundChargeBackAmount = null;
/**
* @property integer $refundChargeBackCount
*/
private $refundChargeBackCount = null;
/**
* @property float $chargeReturnedItemsAmount
*/
private $chargeReturnedItemsAmount = null;
/**
* @property integer $chargeReturnedItemsCount
*/
private $chargeReturnedItemsCount = null;
/**
* @property float $refundReturnedItemsAmount
*/
private $refundReturnedItemsAmount = null;
/**
* @property integer $refundReturnedItemsCount
*/
private $refundReturnedItemsCount = null;
/**
* Gets as accountType
*
* @return string
*/
public function getAccountType()
{
return $this->accountType;
}
/**
* Sets a new accountType
*
* @param string $accountType
* @return self
*/
public function setAccountType($accountType)
{
$this->accountType = $accountType;
return $this;
}
/**
* Gets as chargeAmount
*
* @return float
*/
public function getChargeAmount()
{
return $this->chargeAmount;
}
/**
* Sets a new chargeAmount
*
* @param float $chargeAmount
* @return self
*/
public function setChargeAmount($chargeAmount)
{
$this->chargeAmount = $chargeAmount;
return $this;
}
/**
* Gets as chargeCount
*
* @return integer
*/
public function getChargeCount()
{
return $this->chargeCount;
}
/**
* Sets a new chargeCount
*
* @param integer $chargeCount
* @return self
*/
public function setChargeCount($chargeCount)
{
$this->chargeCount = $chargeCount;
return $this;
}
/**
* Gets as refundAmount
*
* @return float
*/
public function getRefundAmount()
{
return $this->refundAmount;
}
/**
* Sets a new refundAmount
*
* @param float $refundAmount
* @return self
*/
public function setRefundAmount($refundAmount)
{
$this->refundAmount = $refundAmount;
return $this;
}
/**
* Gets as refundCount
*
* @return integer
*/
public function getRefundCount()
{
return $this->refundCount;
}
/**
* Sets a new refundCount
*
* @param integer $refundCount
* @return self
*/
public function setRefundCount($refundCount)
{
$this->refundCount = $refundCount;
return $this;
}
/**
* Gets as voidCount
*
* @return integer
*/
public function getVoidCount()
{
return $this->voidCount;
}
/**
* Sets a new voidCount
*
* @param integer $voidCount
* @return self
*/
public function setVoidCount($voidCount)
{
$this->voidCount = $voidCount;
return $this;
}
/**
* Gets as declineCount
*
* @return integer
*/
public function getDeclineCount()
{
return $this->declineCount;
}
/**
* Sets a new declineCount
*
* @param integer $declineCount
* @return self
*/
public function setDeclineCount($declineCount)
{
$this->declineCount = $declineCount;
return $this;
}
/**
* Gets as errorCount
*
* @return integer
*/
public function getErrorCount()
{
return $this->errorCount;
}
/**
* Sets a new errorCount
*
* @param integer $errorCount
* @return self
*/
public function setErrorCount($errorCount)
{
$this->errorCount = $errorCount;
return $this;
}
/**
* Gets as returnedItemAmount
*
* @return float
*/
public function getReturnedItemAmount()
{
return $this->returnedItemAmount;
}
/**
* Sets a new returnedItemAmount
*
* @param float $returnedItemAmount
* @return self
*/
public function setReturnedItemAmount($returnedItemAmount)
{
$this->returnedItemAmount = $returnedItemAmount;
return $this;
}
/**
* Gets as returnedItemCount
*
* @return integer
*/
public function getReturnedItemCount()
{
return $this->returnedItemCount;
}
/**
* Sets a new returnedItemCount
*
* @param integer $returnedItemCount
* @return self
*/
public function setReturnedItemCount($returnedItemCount)
{
$this->returnedItemCount = $returnedItemCount;
return $this;
}
/**
* Gets as chargebackAmount
*
* @return float
*/
public function getChargebackAmount()
{
return $this->chargebackAmount;
}
/**
* Sets a new chargebackAmount
*
* @param float $chargebackAmount
* @return self
*/
public function setChargebackAmount($chargebackAmount)
{
$this->chargebackAmount = $chargebackAmount;
return $this;
}
/**
* Gets as chargebackCount
*
* @return integer
*/
public function getChargebackCount()
{
return $this->chargebackCount;
}
/**
* Sets a new chargebackCount
*
* @param integer $chargebackCount
* @return self
*/
public function setChargebackCount($chargebackCount)
{
$this->chargebackCount = $chargebackCount;
return $this;
}
/**
* Gets as correctionNoticeCount
*
* @return integer
*/
public function getCorrectionNoticeCount()
{
return $this->correctionNoticeCount;
}
/**
* Sets a new correctionNoticeCount
*
* @param integer $correctionNoticeCount
* @return self
*/
public function setCorrectionNoticeCount($correctionNoticeCount)
{
$this->correctionNoticeCount = $correctionNoticeCount;
return $this;
}
/**
* Gets as chargeChargeBackAmount
*
* @return float
*/
public function getChargeChargeBackAmount()
{
return $this->chargeChargeBackAmount;
}
/**
* Sets a new chargeChargeBackAmount
*
* @param float $chargeChargeBackAmount
* @return self
*/
public function setChargeChargeBackAmount($chargeChargeBackAmount)
{
$this->chargeChargeBackAmount = $chargeChargeBackAmount;
return $this;
}
/**
* Gets as chargeChargeBackCount
*
* @return integer
*/
public function getChargeChargeBackCount()
{
return $this->chargeChargeBackCount;
}
/**
* Sets a new chargeChargeBackCount
*
* @param integer $chargeChargeBackCount
* @return self
*/
public function setChargeChargeBackCount($chargeChargeBackCount)
{
$this->chargeChargeBackCount = $chargeChargeBackCount;
return $this;
}
/**
* Gets as refundChargeBackAmount
*
* @return float
*/
public function getRefundChargeBackAmount()
{
return $this->refundChargeBackAmount;
}
/**
* Sets a new refundChargeBackAmount
*
* @param float $refundChargeBackAmount
* @return self
*/
public function setRefundChargeBackAmount($refundChargeBackAmount)
{
$this->refundChargeBackAmount = $refundChargeBackAmount;
return $this;
}
/**
* Gets as refundChargeBackCount
*
* @return integer
*/
public function getRefundChargeBackCount()
{
return $this->refundChargeBackCount;
}
/**
* Sets a new refundChargeBackCount
*
* @param integer $refundChargeBackCount
* @return self
*/
public function setRefundChargeBackCount($refundChargeBackCount)
{
$this->refundChargeBackCount = $refundChargeBackCount;
return $this;
}
/**
* Gets as chargeReturnedItemsAmount
*
* @return float
*/
public function getChargeReturnedItemsAmount()
{
return $this->chargeReturnedItemsAmount;
}
/**
* Sets a new chargeReturnedItemsAmount
*
* @param float $chargeReturnedItemsAmount
* @return self
*/
public function setChargeReturnedItemsAmount($chargeReturnedItemsAmount)
{
$this->chargeReturnedItemsAmount = $chargeReturnedItemsAmount;
return $this;
}
/**
* Gets as chargeReturnedItemsCount
*
* @return integer
*/
public function getChargeReturnedItemsCount()
{
return $this->chargeReturnedItemsCount;
}
/**
* Sets a new chargeReturnedItemsCount
*
* @param integer $chargeReturnedItemsCount
* @return self
*/
public function setChargeReturnedItemsCount($chargeReturnedItemsCount)
{
$this->chargeReturnedItemsCount = $chargeReturnedItemsCount;
return $this;
}
/**
* Gets as refundReturnedItemsAmount
*
* @return float
*/
public function getRefundReturnedItemsAmount()
{
return $this->refundReturnedItemsAmount;
}
/**
* Sets a new refundReturnedItemsAmount
*
* @param float $refundReturnedItemsAmount
* @return self
*/
public function setRefundReturnedItemsAmount($refundReturnedItemsAmount)
{
$this->refundReturnedItemsAmount = $refundReturnedItemsAmount;
return $this;
}
/**
* Gets as refundReturnedItemsCount
*
* @return integer
*/
public function getRefundReturnedItemsCount()
{
return $this->refundReturnedItemsCount;
}
/**
* Sets a new refundReturnedItemsCount
*
* @param integer $refundReturnedItemsCount
* @return self
*/
public function setRefundReturnedItemsCount($refundReturnedItemsCount)
{
$this->refundReturnedItemsCount = $refundReturnedItemsCount;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,234 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CardArtType
*
*
* XSD Type: cardArt
*/
class CardArtType implements \JsonSerializable
{
/**
* @property string $cardBrand
*/
private $cardBrand = null;
/**
* @property string $cardImageHeight
*/
private $cardImageHeight = null;
/**
* @property string $cardImageUrl
*/
private $cardImageUrl = null;
/**
* @property string $cardImageWidth
*/
private $cardImageWidth = null;
/**
* @property string $cardType
*/
private $cardType = null;
/**
* Gets as cardBrand
*
* @return string
*/
public function getCardBrand()
{
return $this->cardBrand;
}
/**
* Sets a new cardBrand
*
* @param string $cardBrand
* @return self
*/
public function setCardBrand($cardBrand)
{
$this->cardBrand = $cardBrand;
return $this;
}
/**
* Gets as cardImageHeight
*
* @return string
*/
public function getCardImageHeight()
{
return $this->cardImageHeight;
}
/**
* Sets a new cardImageHeight
*
* @param string $cardImageHeight
* @return self
*/
public function setCardImageHeight($cardImageHeight)
{
$this->cardImageHeight = $cardImageHeight;
return $this;
}
/**
* Gets as cardImageUrl
*
* @return string
*/
public function getCardImageUrl()
{
return $this->cardImageUrl;
}
/**
* Sets a new cardImageUrl
*
* @param string $cardImageUrl
* @return self
*/
public function setCardImageUrl($cardImageUrl)
{
$this->cardImageUrl = $cardImageUrl;
return $this;
}
/**
* Gets as cardImageWidth
*
* @return string
*/
public function getCardImageWidth()
{
return $this->cardImageWidth;
}
/**
* Sets a new cardImageWidth
*
* @param string $cardImageWidth
* @return self
*/
public function setCardImageWidth($cardImageWidth)
{
$this->cardImageWidth = $cardImageWidth;
return $this;
}
/**
* Gets as cardType
*
* @return string
*/
public function getCardType()
{
return $this->cardType;
}
/**
* Sets a new cardType
*
* @param string $cardType
* @return self
*/
public function setCardType($cardType)
{
$this->cardType = $cardType;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,153 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CcAuthenticationType
*
*
* XSD Type: ccAuthenticationType
*/
class CcAuthenticationType implements \JsonSerializable
{
/**
* @property string $authenticationIndicator
*/
private $authenticationIndicator = null;
/**
* @property string $cardholderAuthenticationValue
*/
private $cardholderAuthenticationValue = null;
/**
* Gets as authenticationIndicator
*
* @return string
*/
public function getAuthenticationIndicator()
{
return $this->authenticationIndicator;
}
/**
* Sets a new authenticationIndicator
*
* @param string $authenticationIndicator
* @return self
*/
public function setAuthenticationIndicator($authenticationIndicator)
{
$this->authenticationIndicator = $authenticationIndicator;
return $this;
}
/**
* Gets as cardholderAuthenticationValue
*
* @return string
*/
public function getCardholderAuthenticationValue()
{
return $this->cardholderAuthenticationValue;
}
/**
* Sets a new cardholderAuthenticationValue
*
* @param string $cardholderAuthenticationValue
* @return self
*/
public function setCardholderAuthenticationValue($cardholderAuthenticationValue)
{
$this->cardholderAuthenticationValue = $cardholderAuthenticationValue;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,130 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerPaymentProfileRequest
*/
class CreateCustomerPaymentProfileRequest extends ANetApiRequestType
{
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property \net\authorize\api\contract\v1\CustomerPaymentProfileType
* $paymentProfile
*/
private $paymentProfile = null;
/**
* @property string $validationMode
*/
private $validationMode = null;
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Gets as paymentProfile
*
* @return \net\authorize\api\contract\v1\CustomerPaymentProfileType
*/
public function getPaymentProfile()
{
return $this->paymentProfile;
}
/**
* Sets a new paymentProfile
*
* @param \net\authorize\api\contract\v1\CustomerPaymentProfileType $paymentProfile
* @return self
*/
public function setPaymentProfile(\net\authorize\api\contract\v1\CustomerPaymentProfileType $paymentProfile)
{
$this->paymentProfile = $paymentProfile;
return $this;
}
/**
* Gets as validationMode
*
* @return string
*/
public function getValidationMode()
{
return $this->validationMode;
}
/**
* Sets a new validationMode
*
* @param string $validationMode
* @return self
*/
public function setValidationMode($validationMode)
{
$this->validationMode = $validationMode;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,142 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerPaymentProfileResponse
*/
class CreateCustomerPaymentProfileResponse extends ANetApiResponseType
{
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property string $customerPaymentProfileId
*/
private $customerPaymentProfileId = null;
/**
* @property string $validationDirectResponse
*/
private $validationDirectResponse = null;
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Gets as customerPaymentProfileId
*
* @return string
*/
public function getCustomerPaymentProfileId()
{
return $this->customerPaymentProfileId;
}
/**
* Sets a new customerPaymentProfileId
*
* @param string $customerPaymentProfileId
* @return self
*/
public function setCustomerPaymentProfileId($customerPaymentProfileId)
{
$this->customerPaymentProfileId = $customerPaymentProfileId;
return $this;
}
/**
* Gets as validationDirectResponse
*
* @return string
*/
public function getValidationDirectResponse()
{
return $this->validationDirectResponse;
}
/**
* Sets a new validationDirectResponse
*
* @param string $validationDirectResponse
* @return self
*/
public function setValidationDirectResponse($validationDirectResponse)
{
$this->validationDirectResponse = $validationDirectResponse;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,210 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerProfileFromTransactionRequest
*/
class CreateCustomerProfileFromTransactionRequest extends ANetApiRequestType
{
/**
* @property string $transId
*/
private $transId = null;
/**
* @property \net\authorize\api\contract\v1\CustomerProfileBaseType $customer
*/
private $customer = null;
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property boolean $defaultPaymentProfile
*/
private $defaultPaymentProfile = null;
/**
* @property boolean $defaultShippingAddress
*/
private $defaultShippingAddress = null;
/**
* @property string $profileType
*/
private $profileType = null;
/**
* Gets as transId
*
* @return string
*/
public function getTransId()
{
return $this->transId;
}
/**
* Sets a new transId
*
* @param string $transId
* @return self
*/
public function setTransId($transId)
{
$this->transId = $transId;
return $this;
}
/**
* Gets as customer
*
* @return \net\authorize\api\contract\v1\CustomerProfileBaseType
*/
public function getCustomer()
{
return $this->customer;
}
/**
* Sets a new customer
*
* @param \net\authorize\api\contract\v1\CustomerProfileBaseType $customer
* @return self
*/
public function setCustomer(\net\authorize\api\contract\v1\CustomerProfileBaseType $customer)
{
$this->customer = $customer;
return $this;
}
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Gets as defaultPaymentProfile
*
* @return boolean
*/
public function getDefaultPaymentProfile()
{
return $this->defaultPaymentProfile;
}
/**
* Sets a new defaultPaymentProfile
*
* @param boolean $defaultPaymentProfile
* @return self
*/
public function setDefaultPaymentProfile($defaultPaymentProfile)
{
$this->defaultPaymentProfile = $defaultPaymentProfile;
return $this;
}
/**
* Gets as defaultShippingAddress
*
* @return boolean
*/
public function getDefaultShippingAddress()
{
return $this->defaultShippingAddress;
}
/**
* Sets a new defaultShippingAddress
*
* @param boolean $defaultShippingAddress
* @return self
*/
public function setDefaultShippingAddress($defaultShippingAddress)
{
$this->defaultShippingAddress = $defaultShippingAddress;
return $this;
}
/**
* Gets as profileType
*
* @return string
*/
public function getProfileType()
{
return $this->profileType;
}
/**
* Sets a new profileType
*
* @param string $profileType
* @return self
*/
public function setProfileType($profileType)
{
$this->profileType = $profileType;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,102 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerProfileRequest
*/
class CreateCustomerProfileRequest extends ANetApiRequestType
{
/**
* @property \net\authorize\api\contract\v1\CustomerProfileType $profile
*/
private $profile = null;
/**
* @property string $validationMode
*/
private $validationMode = null;
/**
* Gets as profile
*
* @return \net\authorize\api\contract\v1\CustomerProfileType
*/
public function getProfile()
{
return $this->profile;
}
/**
* Sets a new profile
*
* @param \net\authorize\api\contract\v1\CustomerProfileType $profile
* @return self
*/
public function setProfile(\net\authorize\api\contract\v1\CustomerProfileType $profile)
{
$this->profile = $profile;
return $this;
}
/**
* Gets as validationMode
*
* @return string
*/
public function getValidationMode()
{
return $this->validationMode;
}
/**
* Sets a new validationMode
*
* @param string $validationMode
* @return self
*/
public function setValidationMode($validationMode)
{
$this->validationMode = $validationMode;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,271 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerProfileResponse
*/
class CreateCustomerProfileResponse extends ANetApiResponseType
{
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property string[] $customerPaymentProfileIdList
*/
private $customerPaymentProfileIdList = null;
/**
* @property string[] $customerShippingAddressIdList
*/
private $customerShippingAddressIdList = null;
/**
* @property string[] $validationDirectResponseList
*/
private $validationDirectResponseList = null;
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Adds as numericString
*
* @return self
* @param string $numericString
*/
public function addToCustomerPaymentProfileIdList($numericString)
{
$this->customerPaymentProfileIdList[] = $numericString;
return $this;
}
/**
* isset customerPaymentProfileIdList
*
* @param scalar $index
* @return boolean
*/
public function issetCustomerPaymentProfileIdList($index)
{
return isset($this->customerPaymentProfileIdList[$index]);
}
/**
* unset customerPaymentProfileIdList
*
* @param scalar $index
* @return void
*/
public function unsetCustomerPaymentProfileIdList($index)
{
unset($this->customerPaymentProfileIdList[$index]);
}
/**
* Gets as customerPaymentProfileIdList
*
* @return string[]
*/
public function getCustomerPaymentProfileIdList()
{
return $this->customerPaymentProfileIdList;
}
/**
* Sets a new customerPaymentProfileIdList
*
* @param string $customerPaymentProfileIdList
* @return self
*/
public function setCustomerPaymentProfileIdList(array $customerPaymentProfileIdList)
{
$this->customerPaymentProfileIdList = $customerPaymentProfileIdList;
return $this;
}
/**
* Adds as numericString
*
* @return self
* @param string $numericString
*/
public function addToCustomerShippingAddressIdList($numericString)
{
$this->customerShippingAddressIdList[] = $numericString;
return $this;
}
/**
* isset customerShippingAddressIdList
*
* @param scalar $index
* @return boolean
*/
public function issetCustomerShippingAddressIdList($index)
{
return isset($this->customerShippingAddressIdList[$index]);
}
/**
* unset customerShippingAddressIdList
*
* @param scalar $index
* @return void
*/
public function unsetCustomerShippingAddressIdList($index)
{
unset($this->customerShippingAddressIdList[$index]);
}
/**
* Gets as customerShippingAddressIdList
*
* @return string[]
*/
public function getCustomerShippingAddressIdList()
{
return $this->customerShippingAddressIdList;
}
/**
* Sets a new customerShippingAddressIdList
*
* @param string $customerShippingAddressIdList
* @return self
*/
public function setCustomerShippingAddressIdList(array $customerShippingAddressIdList)
{
$this->customerShippingAddressIdList = $customerShippingAddressIdList;
return $this;
}
/**
* Adds as string
*
* @return self
* @param string $string
*/
public function addToValidationDirectResponseList($string)
{
$this->validationDirectResponseList[] = $string;
return $this;
}
/**
* isset validationDirectResponseList
*
* @param scalar $index
* @return boolean
*/
public function issetValidationDirectResponseList($index)
{
return isset($this->validationDirectResponseList[$index]);
}
/**
* unset validationDirectResponseList
*
* @param scalar $index
* @return void
*/
public function unsetValidationDirectResponseList($index)
{
unset($this->validationDirectResponseList[$index]);
}
/**
* Gets as validationDirectResponseList
*
* @return string[]
*/
public function getValidationDirectResponseList()
{
return $this->validationDirectResponseList;
}
/**
* Sets a new validationDirectResponseList
*
* @param string[] $validationDirectResponseList
* @return self
*/
public function setValidationDirectResponseList(array $validationDirectResponseList)
{
$this->validationDirectResponseList = $validationDirectResponseList;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,102 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerProfileTransactionRequest
*/
class CreateCustomerProfileTransactionRequest extends ANetApiRequestType
{
/**
* @property \net\authorize\api\contract\v1\ProfileTransactionType $transaction
*/
private $transaction = null;
/**
* @property string $extraOptions
*/
private $extraOptions = null;
/**
* Gets as transaction
*
* @return \net\authorize\api\contract\v1\ProfileTransactionType
*/
public function getTransaction()
{
return $this->transaction;
}
/**
* Sets a new transaction
*
* @param \net\authorize\api\contract\v1\ProfileTransactionType $transaction
* @return self
*/
public function setTransaction(\net\authorize\api\contract\v1\ProfileTransactionType $transaction)
{
$this->transaction = $transaction;
return $this;
}
/**
* Gets as extraOptions
*
* @return string
*/
public function getExtraOptions()
{
return $this->extraOptions;
}
/**
* Sets a new extraOptions
*
* @param string $extraOptions
* @return self
*/
public function setExtraOptions($extraOptions)
{
$this->extraOptions = $extraOptions;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,117 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerProfileTransactionResponse
*/
class CreateCustomerProfileTransactionResponse extends ANetApiResponseType
{
/**
* @property \net\authorize\api\contract\v1\TransactionResponseType
* $transactionResponse
*/
private $transactionResponse = null;
/**
* @property string $directResponse
*/
private $directResponse = null;
/**
* Gets as transactionResponse
*
* @return \net\authorize\api\contract\v1\TransactionResponseType
*/
public function getTransactionResponse()
{
return $this->transactionResponse;
}
/**
* Sets a new transactionResponse
*
* @param \net\authorize\api\contract\v1\TransactionResponseType
* $transactionResponse
* @return self
*/
public function setTransactionResponse(\net\authorize\api\contract\v1\TransactionResponseType $transactionResponse)
{
$this->transactionResponse = $transactionResponse;
return $this;
}
/**
* Gets as directResponse
*
* @return string
*/
public function getDirectResponse()
{
return $this->directResponse;
}
/**
* Sets a new directResponse
*
* @param string $directResponse
* @return self
*/
public function setDirectResponse($directResponse)
{
$this->directResponse = $directResponse;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,129 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerShippingAddressRequest
*/
class CreateCustomerShippingAddressRequest extends ANetApiRequestType
{
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property \net\authorize\api\contract\v1\CustomerAddressType $address
*/
private $address = null;
/**
* @property boolean $defaultShippingAddress
*/
private $defaultShippingAddress = null;
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Gets as address
*
* @return \net\authorize\api\contract\v1\CustomerAddressType
*/
public function getAddress()
{
return $this->address;
}
/**
* Sets a new address
*
* @param \net\authorize\api\contract\v1\CustomerAddressType $address
* @return self
*/
public function setAddress(\net\authorize\api\contract\v1\CustomerAddressType $address)
{
$this->address = $address;
return $this;
}
/**
* Gets as defaultShippingAddress
*
* @return boolean
*/
public function getDefaultShippingAddress()
{
return $this->defaultShippingAddress;
}
/**
* Sets a new defaultShippingAddress
*
* @param boolean $defaultShippingAddress
* @return self
*/
public function setDefaultShippingAddress($defaultShippingAddress)
{
$this->defaultShippingAddress = $defaultShippingAddress;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,115 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateCustomerShippingAddressResponse
*/
class CreateCustomerShippingAddressResponse extends ANetApiResponseType
{
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property string $customerAddressId
*/
private $customerAddressId = null;
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Gets as customerAddressId
*
* @return string
*/
public function getCustomerAddressId()
{
return $this->customerAddressId;
}
/**
* Sets a new customerAddressId
*
* @param string $customerAddressId
* @return self
*/
public function setCustomerAddressId($customerAddressId)
{
$this->customerAddressId = $customerAddressId;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,275 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateProfileResponseType
*
*
* XSD Type: createProfileResponse
*/
class CreateProfileResponseType implements \JsonSerializable
{
/**
* @property \net\authorize\api\contract\v1\MessagesType $messages
*/
private $messages = null;
/**
* @property string $customerProfileId
*/
private $customerProfileId = null;
/**
* @property string[] $customerPaymentProfileIdList
*/
private $customerPaymentProfileIdList = null;
/**
* @property string[] $customerShippingAddressIdList
*/
private $customerShippingAddressIdList = null;
/**
* Gets as messages
*
* @return \net\authorize\api\contract\v1\MessagesType
*/
public function getMessages()
{
return $this->messages;
}
/**
* Sets a new messages
*
* @param \net\authorize\api\contract\v1\MessagesType $messages
* @return self
*/
public function setMessages(\net\authorize\api\contract\v1\MessagesType $messages)
{
$this->messages = $messages;
return $this;
}
/**
* Gets as customerProfileId
*
* @return string
*/
public function getCustomerProfileId()
{
return $this->customerProfileId;
}
/**
* Sets a new customerProfileId
*
* @param string $customerProfileId
* @return self
*/
public function setCustomerProfileId($customerProfileId)
{
$this->customerProfileId = $customerProfileId;
return $this;
}
/**
* Adds as numericString
*
* @return self
* @param string $numericString
*/
public function addToCustomerPaymentProfileIdList($numericString)
{
$this->customerPaymentProfileIdList[] = $numericString;
return $this;
}
/**
* isset customerPaymentProfileIdList
*
* @param scalar $index
* @return boolean
*/
public function issetCustomerPaymentProfileIdList($index)
{
return isset($this->customerPaymentProfileIdList[$index]);
}
/**
* unset customerPaymentProfileIdList
*
* @param scalar $index
* @return void
*/
public function unsetCustomerPaymentProfileIdList($index)
{
unset($this->customerPaymentProfileIdList[$index]);
}
/**
* Gets as customerPaymentProfileIdList
*
* @return string[]
*/
public function getCustomerPaymentProfileIdList()
{
return $this->customerPaymentProfileIdList;
}
/**
* Sets a new customerPaymentProfileIdList
*
* @param string $customerPaymentProfileIdList
* @return self
*/
public function setCustomerPaymentProfileIdList(array $customerPaymentProfileIdList)
{
$this->customerPaymentProfileIdList = $customerPaymentProfileIdList;
return $this;
}
/**
* Adds as numericString
*
* @return self
* @param string $numericString
*/
public function addToCustomerShippingAddressIdList($numericString)
{
$this->customerShippingAddressIdList[] = $numericString;
return $this;
}
/**
* isset customerShippingAddressIdList
*
* @param scalar $index
* @return boolean
*/
public function issetCustomerShippingAddressIdList($index)
{
return isset($this->customerShippingAddressIdList[$index]);
}
/**
* unset customerShippingAddressIdList
*
* @param scalar $index
* @return void
*/
public function unsetCustomerShippingAddressIdList($index)
{
unset($this->customerShippingAddressIdList[$index]);
}
/**
* Gets as customerShippingAddressIdList
*
* @return string[]
*/
public function getCustomerShippingAddressIdList()
{
return $this->customerShippingAddressIdList;
}
/**
* Sets a new customerShippingAddressIdList
*
* @param string $customerShippingAddressIdList
* @return self
*/
public function setCustomerShippingAddressIdList(array $customerShippingAddressIdList)
{
$this->customerShippingAddressIdList = $customerShippingAddressIdList;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,76 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateTransactionRequest
*/
class CreateTransactionRequest extends ANetApiRequestType
{
/**
* @property \net\authorize\api\contract\v1\TransactionRequestType
* $transactionRequest
*/
private $transactionRequest = null;
/**
* Gets as transactionRequest
*
* @return \net\authorize\api\contract\v1\TransactionRequestType
*/
public function getTransactionRequest()
{
return $this->transactionRequest;
}
/**
* Sets a new transactionRequest
*
* @param \net\authorize\api\contract\v1\TransactionRequestType $transactionRequest
* @return self
*/
public function setTransactionRequest(\net\authorize\api\contract\v1\TransactionRequestType $transactionRequest)
{
$this->transactionRequest = $transactionRequest;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
}

@ -0,0 +1,118 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreateTransactionResponse
*/
class CreateTransactionResponse extends ANetApiResponseType
{
/**
* @property \net\authorize\api\contract\v1\TransactionResponseType
* $transactionResponse
*/
private $transactionResponse = null;
/**
* @property \net\authorize\api\contract\v1\CreateProfileResponseType
* $profileResponse
*/
private $profileResponse = null;
/**
* Gets as transactionResponse
*
* @return \net\authorize\api\contract\v1\TransactionResponseType
*/
public function getTransactionResponse()
{
return $this->transactionResponse;
}
/**
* Sets a new transactionResponse
*
* @param \net\authorize\api\contract\v1\TransactionResponseType
* $transactionResponse
* @return self
*/
public function setTransactionResponse(\net\authorize\api\contract\v1\TransactionResponseType $transactionResponse)
{
$this->transactionResponse = $transactionResponse;
return $this;
}
/**
* Gets as profileResponse
*
* @return \net\authorize\api\contract\v1\CreateProfileResponseType
*/
public function getProfileResponse()
{
return $this->profileResponse;
}
/**
* Sets a new profileResponse
*
* @param \net\authorize\api\contract\v1\CreateProfileResponseType $profileResponse
* @return self
*/
public function setProfileResponse(\net\authorize\api\contract\v1\CreateProfileResponseType $profileResponse)
{
$this->profileResponse = $profileResponse;
return $this;
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,261 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreditCardMaskedType
*
*
* XSD Type: creditCardMaskedType
*/
class CreditCardMaskedType implements \JsonSerializable
{
/**
* @property string $cardNumber
*/
private $cardNumber = null;
/**
* @property string $expirationDate
*/
private $expirationDate = null;
/**
* @property string $cardType
*/
private $cardType = null;
/**
* @property \net\authorize\api\contract\v1\CardArtType $cardArt
*/
private $cardArt = null;
/**
* @property string $issuerNumber
*/
private $issuerNumber = null;
/**
* @property boolean $isPaymentToken
*/
private $isPaymentToken = null;
/**
* Gets as cardNumber
*
* @return string
*/
public function getCardNumber()
{
return $this->cardNumber;
}
/**
* Sets a new cardNumber
*
* @param string $cardNumber
* @return self
*/
public function setCardNumber($cardNumber)
{
$this->cardNumber = $cardNumber;
return $this;
}
/**
* Gets as expirationDate
*
* @return string
*/
public function getExpirationDate()
{
return $this->expirationDate;
}
/**
* Sets a new expirationDate
*
* @param string $expirationDate
* @return self
*/
public function setExpirationDate($expirationDate)
{
$this->expirationDate = $expirationDate;
return $this;
}
/**
* Gets as cardType
*
* @return string
*/
public function getCardType()
{
return $this->cardType;
}
/**
* Sets a new cardType
*
* @param string $cardType
* @return self
*/
public function setCardType($cardType)
{
$this->cardType = $cardType;
return $this;
}
/**
* Gets as cardArt
*
* @return \net\authorize\api\contract\v1\CardArtType
*/
public function getCardArt()
{
return $this->cardArt;
}
/**
* Sets a new cardArt
*
* @param \net\authorize\api\contract\v1\CardArtType $cardArt
* @return self
*/
public function setCardArt(\net\authorize\api\contract\v1\CardArtType $cardArt)
{
$this->cardArt = $cardArt;
return $this;
}
/**
* Gets as issuerNumber
*
* @return string
*/
public function getIssuerNumber()
{
return $this->issuerNumber;
}
/**
* Sets a new issuerNumber
*
* @param string $issuerNumber
* @return self
*/
public function setIssuerNumber($issuerNumber)
{
$this->issuerNumber = $issuerNumber;
return $this;
}
/**
* Gets as isPaymentToken
*
* @return boolean
*/
public function getIsPaymentToken()
{
return $this->isPaymentToken;
}
/**
* Sets a new isPaymentToken
*
* @param boolean $isPaymentToken
* @return self
*/
public function setIsPaymentToken($isPaymentToken)
{
$this->isPaymentToken = $isPaymentToken;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,153 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreditCardSimpleType
*
*
* XSD Type: creditCardSimpleType
*/
class CreditCardSimpleType implements \JsonSerializable
{
/**
* @property string $cardNumber
*/
private $cardNumber = null;
/**
* @property string $expirationDate
*/
private $expirationDate = null;
/**
* Gets as cardNumber
*
* @return string
*/
public function getCardNumber()
{
return $this->cardNumber;
}
/**
* Sets a new cardNumber
*
* @param string $cardNumber
* @return self
*/
public function setCardNumber($cardNumber)
{
$this->cardNumber = $cardNumber;
return $this;
}
/**
* Gets as expirationDate
*
* @return string
*/
public function getExpirationDate()
{
return $this->expirationDate;
}
/**
* Sets a new expirationDate
*
* @param string $expirationDate
* @return self
*/
public function setExpirationDate($expirationDate)
{
$this->expirationDate = $expirationDate;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

@ -0,0 +1,153 @@
<?php
namespace net\authorize\api\contract\v1;
/**
* Class representing CreditCardTrackType
*
*
* XSD Type: creditCardTrackType
*/
class CreditCardTrackType implements \JsonSerializable
{
/**
* @property string $track1
*/
private $track1 = null;
/**
* @property string $track2
*/
private $track2 = null;
/**
* Gets as track1
*
* @return string
*/
public function getTrack1()
{
return $this->track1;
}
/**
* Sets a new track1
*
* @param string $track1
* @return self
*/
public function setTrack1($track1)
{
$this->track1 = $track1;
return $this;
}
/**
* Gets as track2
*
* @return string
*/
public function getTrack2()
{
return $this->track2;
}
/**
* Sets a new track2
*
* @param string $track2
* @return self
*/
public function setTrack2($track2)
{
$this->track2 = $track2;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save