/home/desid573/public_html/gcdriver/payment/xero
NameSizeModeActions
certs/-0755rm
lib/-0755rm
tests/-0755rm
.gitignore1420644editdlrm
.pdf803810644editdlrm
7320c944-101d-4f21-924f-5c49298ec5df.pdf803810644editdlrm
addContact.php79560644editdlrm
addNewContact.php00644editdlrm
class.phpmailer.php800460644editdlrm
class.pop3.php103850644editdlrm
class.smtp.php245860644editdlrm
composer.json5560644editdlrm
error_log10921950644editdlrm
getInvoice.php79560644editdlrm
getInvoiceReturn.php79560644editdlrm
index.php5000644editdlrm
invoiceRetrieve.php21370644editdlrm
invoiceSend.php101870644editdlrm
license.txt10550644editdlrm
partner.php41000644editdlrm
private.php16220644editdlrm
public.php42520644editdlrm
README.md72660644editdlrm
webhook.php16410644editdlrm
_config.php22810644editdlrm
Edit: /home/desid573/public_html/gcdriver/payment/xero/public.php (4252B)
'YOURCONSUMERKEY', 'shared_secret' => 'YOURSECRET', // API versions 'core_version' => '2.0', 'payroll_version' => '1.0', 'file_version' => '1.0' ); if (XRO_APP_TYPE == "Private" || XRO_APP_TYPE == "Partner") { $signatures ['rsa_private_key'] = BASE_PATH . '/certs/privatekey.pem'; $signatures ['rsa_public_key'] = BASE_PATH . '/certs/publickey.cer'; } if (XRO_APP_TYPE == "Partner") { $signatures ['curl_ssl_cert'] = BASE_PATH . '/certs/entrust-cert-RQ3.pem'; $signatures ['curl_ssl_password'] = '1234'; $signatures ['curl_ssl_key'] = BASE_PATH . '/certs/entrust-private-RQ3.pem'; } $XeroOAuth = new XeroOAuth ( array_merge ( array ( 'application_type' => XRO_APP_TYPE, 'oauth_callback' => OAUTH_CALLBACK, 'user_agent' => $useragent ), $signatures ) ); $initialCheck = $XeroOAuth->diagnostics (); $checkErrors = count ( $initialCheck ); if ($checkErrors > 0) { // you could handle any config errors here, or keep on truckin if you like to live dangerously foreach ( $initialCheck as $check ) { echo 'Error: ' . $check . PHP_EOL; } } else { $here = XeroOAuth::php_self (); session_start (); $oauthSession = retrieveSession (); include 'tests/tests.php'; if (isset ( $_REQUEST ['oauth_verifier'] )) { $XeroOAuth->config ['access_token'] = $_SESSION ['oauth'] ['oauth_token']; $XeroOAuth->config ['access_token_secret'] = $_SESSION ['oauth'] ['oauth_token_secret']; $code = $XeroOAuth->request ( 'GET', $XeroOAuth->url ( 'AccessToken', '' ), array ( 'oauth_verifier' => $_REQUEST ['oauth_verifier'], 'oauth_token' => $_REQUEST ['oauth_token'] ) ); if ($XeroOAuth->response ['code'] == 200) { $response = $XeroOAuth->extract_params ( $XeroOAuth->response ['response'] ); $session = persistSession ( $response ); unset ( $_SESSION ['oauth'] ); header ( "Location: {$here}" ); } else { outputError ( $XeroOAuth ); } // start the OAuth dance } elseif (isset ( $_REQUEST ['authenticate'] ) || isset ( $_REQUEST ['authorize'] )) { $params = array ( 'oauth_callback' => OAUTH_CALLBACK ); $response = $XeroOAuth->request ( 'GET', $XeroOAuth->url ( 'RequestToken', '' ), $params ); if ($XeroOAuth->response ['code'] == 200) { $scope = ""; // $scope = 'payroll.payrollcalendars,payroll.superfunds,payroll.payruns,payroll.payslip,payroll.employees,payroll.TaxDeclaration'; if ($_REQUEST ['authenticate'] > 1) $scope = 'payroll.employees,payroll.payruns,payroll.timesheets'; print_r ( $XeroOAuth->extract_params ( $XeroOAuth->response ['response'] ) ); $_SESSION ['oauth'] = $XeroOAuth->extract_params ( $XeroOAuth->response ['response'] ); $authurl = $XeroOAuth->url ( "Authorize", '' ) . "?oauth_token={$_SESSION['oauth']['oauth_token']}&scope=" . $scope; echo '

To complete the OAuth flow follow this URL: ' . $authurl . '

'; } else { outputError ( $XeroOAuth ); } } testLinks (); }