Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from base #1

Merged
merged 17 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# interface-library
Shopgate Interface PHP Library is deprecated!
Please use our new repository instead: [Shopgate Cart Integration SDK](https://github.com/shopgate/cart-integration-sdk)
2 changes: 1 addition & 1 deletion build_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$buildConfig = array (
'major' => 2,
'minor' => 9,
'build' => 60,
'build' => 64,
'shopgate_library_path' => '',
'plugin_name' => 'library',
'display_name' => 'Shopgate Library 2.9.x',
Expand Down
14 changes: 13 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
'''Version 2.9.64'''
* Added missing getter for review XML filename in the configuration

'''Version 2.9.63'''
* Added payment method constants for Merchant Payment

'''Version 2.9.62'''
* restored compatibility for PHP versions below 5.3

'''Version 2.9.61'''
* fixed a bug in stack trace generation that may appear on certain server configurations

'''Version 2.9.60'''
* fixed debug logging

Expand Down Expand Up @@ -27,7 +39,7 @@
* added ShopgateClient to ShopgateCartBase to distinguish between the mobile clients
* added error code to remove items silently in the cart validation
* replaced "document.write" with asynchronous loading of mobile redirect / mobile header
* added Content-Length header to Response objects for CSV, XML and JSON repsonses
* added Content-Length header to Response objects for CSV, XML and JSON responses

'''Version 2.9.55'''
* refactored ShopgateLogger to be able to pass a strategy for logging
Expand Down
10 changes: 5 additions & 5 deletions classes/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getType()
*/
public function isMobileWebsite()
{
return $this->type == $this::TYPE_MOBILESITE;
return $this->type == self::TYPE_MOBILESITE;
}

/**
Expand All @@ -62,10 +62,10 @@ public function isMobileWebsite()
public function isApp()
{
$appTypes = array(
$this::TYPE_ANDROIDPHONEAPP,
$this::TYPE_ANDROIDTABLETAPP,
$this::TYPE_IPADAPP,
$this::TYPE_IPHONEAPP
self::TYPE_ANDROIDPHONEAPP,
self::TYPE_ANDROIDTABLETAPP,
self::TYPE_IPADAPP,
self::TYPE_IPHONEAPP
);
return in_array($this->type, $appTypes);
}
Expand Down
4 changes: 4 additions & 0 deletions classes/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,10 @@ public function getReviewsCsvFilename() {
return $this->reviews_csv_filename;
}

public function getReviewsXmlFilename() {
return $this->reviews_xml_filename;
}

public function getAccessLogFilename() {
return $this->access_log_filename;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
###################################################################################
# define constants
###################################################################################
define("SHOPGATE_LIBRARY_VERSION", "2.9.60");
define("SHOPGATE_LIBRARY_VERSION", "2.9.64");
define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8');
define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../'));

Expand Down
10 changes: 9 additions & 1 deletion classes/helper/logging/stack_trace/GeneratorDefault.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ private function generateFormattedTrace(array $traces)

if (!isset($trace['file'])) {
$trace['file'] = 'unknown file';
$trace['line'] = 'unknown line';
$trace['line'] = 'unknown line';
}

if (!isset($trace['function'])) {
$trace['function'] = 'unknown function';
}

if (!isset($trace['args']) || !is_array($trace['args'])) {
$trace['args'] = array();
}

$arguments = $this->namedParameterProvider->get($trace['class'], $trace['function'], $trace['args']);
Expand Down
265 changes: 135 additions & 130 deletions classes/orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,162 +23,167 @@
*/
abstract class ShopgateCartBase extends ShopgateContainer {

const SHOPGATE = "SHOPGATE";
const SHOPGATE = 'SHOPGATE';

// Prepayment
const PREPAY = "PREPAY";
const PAYONE_PRP = "PAYONE_PRP";
const SG_PREPAY = "SG_PREPAY";
const PREPAY = 'PREPAY';
const PAYONE_PRP = 'PAYONE_PRP';
const SG_PREPAY = 'SG_PREPAY';

// Debit
const DEBIT = "DEBIT";
const PAYMRW_DBT = "PAYMRW_DBT";
const PAYONE_DBT = "PAYONE_DBT";
const DEBIT = 'DEBIT';
const PAYMRW_DBT = 'PAYMRW_DBT';
const PAYONE_DBT = 'PAYONE_DBT';

// Cash On Delivery
const COD = "COD";
const COLL_STORE = "COLL_STORE";
const COD = 'COD';
const COLL_STORE = 'COLL_STORE';

// Installment
const ACCRD_INS = "ACCRD_INS";
const PAYOL_INS = "PAYOL_INS";
const ACCRD_INS = 'ACCRD_INS';
const PAYOL_INS = 'PAYOL_INS';

// Invoice
const INVOICE = "INVOICE";
const ACCRD_INV = "ACCRD_INV";
const KLARNA_INV = "KLARNA_INV";
const BILLSAFE = "BILLSAFE";
const MSTPAY_INV = "MSTPAY_INV";
const PAYMRW_INV = "PAYMRW_INV";
const PAYONE_INV = "PAYONE_INV";
const SG_INVOICE = "SG_INVOICE";
const WCARD_INV = "WCARD_INV";
const PAYONE_KLV = "PAYONE_KLV";
const PAYOL_INV = "PAYOL_INV";
const INVOICE = 'INVOICE';
const ACCRD_INV = 'ACCRD_INV';
const KLARNA_INV = 'KLARNA_INV';
const BILLSAFE = 'BILLSAFE';
const MSTPAY_INV = 'MSTPAY_INV';
const PAYMRW_INV = 'PAYMRW_INV';
const PAYONE_INV = 'PAYONE_INV';
const SG_INVOICE = 'SG_INVOICE';
const WCARD_INV = 'WCARD_INV';
const PAYONE_KLV = 'PAYONE_KLV';
const PAYOL_INV = 'PAYOL_INV';

// Paypal
const PAYPAL = "PAYPAL";
const PPAL_PLUS = "PPAL_PLUS";
const CMPTOP_PP = "CMPTOP_PP";
const MASTPAY_PP = "MASTPAY_PP";
const PAYONE_PP = "PAYONE_PP";
const SAGEPAY_PP = "SAGEPAY_PP";
const SG_PAYPAL = "SG_PAYPAL";
const SIX_PP = "SIX_PP";
const WCARD_PP = "WCARD_PP";
const PAYPAL = 'PAYPAL';
const PPAL_PLUS = 'PPAL_PLUS';
const CMPTOP_PP = 'CMPTOP_PP';
const MASTPAY_PP = 'MASTPAY_PP';
const PAYONE_PP = 'PAYONE_PP';
const SAGEPAY_PP = 'SAGEPAY_PP';
const SG_PAYPAL = 'SG_PAYPAL';
const SIX_PP = 'SIX_PP';
const WCARD_PP = 'WCARD_PP';

// Credit Card
const CC = "CC";
const AUTHN_CC = "AUTHN_CC";
const BCLEPDQ_CC = "BCLEPDQ_CC";
const BNSTRM_CC = "BNSTRM_CC";
const BRAINTR_CC = "BRAINTR_CC";
const CHASE_CC = "CHASE_CC";
const CMPTOP_CC = "CMPTOP_CC";
const CONCAR_CC = "CONCAR_CC";
const CRDSTRM_CC = "CRDSTRM_CC";
const CREDITCARD = "CREDITCARD";
const CYBRSRC_CC = "CYBRSRC_CC";
const DRCPAY_CC = "DRCPAY_CC";
const DTCASH_CC = "DTCASH_CC";
const DT_CC = "DT_CC";
const EFSNET_CC = "EFSNET_CC";
const ELAVON_CC = "ELAVON_CC";
const EPAY_CC = "EPAY_CC";
const EWAY_CC = "EWAY_CC";
const EXACT_CC = "EXACT_CC";
const FRSTDAT_CC = "FRSTDAT_CC";
const GAMEDAY_CC = "GAMEDAY_CC";
const GARANTI_CC = "GARANTI_CC";
const GESTPAY_CC = "GESTPAY_CC";
const HDLPAY_CC = "HDLPAY_CC";
const HIPAY = "HIPAY";
const HITRUST_CC = "HITRUST_CC";
const INSPIRE_CC = "INSPIRE_CC";
const INSTAP_CC = "INSTAP_CC";
const INTUIT_CC = "INTUIT_CC";
const IRIDIUM_CC = "IRIDIUM_CC";
const LITLE_CC = "LITLE_CC";
const MASTPAY_CC = "MASTPAY_CC";
const MERESOL_CC = "MERESOL_CC";
const MERWARE_CC = "MERWARE_CC";
const MODRPAY_CC = "MODRPAY_CC";
const MONERIS_CC = "MONERIS_CC";
const MSTPAY_CC = "MSTPAY_CC";
const NELTRAX_CC = "NELTRAX_CC";
const NETBILL_CC = "NETBILL_CC";
const NETREGS_CC = "NETREGS_CC";
const NOCHEX_CC = "NOCHEX_CC";
const OGONE_CC = "OGONE_CC";
const OPTIMAL_CC = "OPTIMAL_CC";
const PAY4ONE_CC = "PAY4ONE_CC";
const PAYBOX_CC = "PAYBOX_CC";
const PAYEXPR_CC = "PAYEXPR_CC";
const PAYFAST_CC = "PAYFAST_CC";
const PAYFLOW_CC = "PAYFLOW_CC";
const PAYJUNC_CC = "PAYJUNC_CC";
const PAYONE_CC = "PAYONE_CC";
const PAYZEN_CC = "PAYZEN_CC";
const PLUGNPL_CC = "PLUGNPL_CC";
const PP_WSPP_CC = "PP_WSPP_CC";
const PSIGATE_CC = "PSIGATE_CC";
const PSL_CC = "PSL_CC";
const PXPAY_CC = "PXPAY_CC";
const QUIKPAY_CC = "QUIKPAY_CC";
const REALEX_CC = "REALEX_CC";
const SAGEPAY_CC = "SAGEPAY_CC";
const SAGE_CC = "SAGE_CC";
const SAMURAI_CC = "SAMURAI_CC";
const SCPTECH_CC = "SCPTECH_CC";
const SCP_AU_CC = "SCP_AU_CC";
const SECPAY_CC = "SECPAY_CC";
const SG_CC = "SG_CC";
const SIX_CC = "SIX_CC";
const SKIPJCK_CC = "SKIPJCK_CC";
const SKRILL_CC = "SKRILL_CC";
const STRIPE_CC = "STRIPE_CC";
const TELECSH_CC = "TELECSH_CC";
const TRNSFST_CC = "TRNSFST_CC";
const TRUSTCM_CC = "TRUSTCM_CC";
const USAEPAY_CC = "USAEPAY_CC";
const VALITOR_CC = "VALITOR_CC";
const VERIFI_CC = "VERIFI_CC";
const VIAKLIX_CC = "VIAKLIX_CC";
const WCARDS_CC = "WCARDS_CC";
const WIRECRD_CC = "WIRECRD_CC";
const WLDPDIR_CC = "WLDPDIR_CC";
const WLDPOFF_CC = "WLDPOFF_CC";
const CC = 'CC';
const AUTHN_CC = 'AUTHN_CC';
const BCLEPDQ_CC = 'BCLEPDQ_CC';
const BNSTRM_CC = 'BNSTRM_CC';
const BRAINTR_CC = 'BRAINTR_CC';
const CHASE_CC = 'CHASE_CC';
const CMPTOP_CC = 'CMPTOP_CC';
const CONCAR_CC = 'CONCAR_CC';
const CRDSTRM_CC = 'CRDSTRM_CC';
const CREDITCARD = 'CREDITCARD';
const CYBRSRC_CC = 'CYBRSRC_CC';
const DRCPAY_CC = 'DRCPAY_CC';
const DTCASH_CC = 'DTCASH_CC';
const DT_CC = 'DT_CC';
const EFSNET_CC = 'EFSNET_CC';
const ELAVON_CC = 'ELAVON_CC';
const EPAY_CC = 'EPAY_CC';
const EWAY_CC = 'EWAY_CC';
const EXACT_CC = 'EXACT_CC';
const FRSTDAT_CC = 'FRSTDAT_CC';
const GAMEDAY_CC = 'GAMEDAY_CC';
const GARANTI_CC = 'GARANTI_CC';
const GESTPAY_CC = 'GESTPAY_CC';
const HDLPAY_CC = 'HDLPAY_CC';
const HIPAY = 'HIPAY';
const HITRUST_CC = 'HITRUST_CC';
const INSPIRE_CC = 'INSPIRE_CC';
const INSTAP_CC = 'INSTAP_CC';
const INTUIT_CC = 'INTUIT_CC';
const IRIDIUM_CC = 'IRIDIUM_CC';
const LITLE_CC = 'LITLE_CC';
const MASTPAY_CC = 'MASTPAY_CC';
const MERESOL_CC = 'MERESOL_CC';
const MERWARE_CC = 'MERWARE_CC';
const MODRPAY_CC = 'MODRPAY_CC';
const MONERIS_CC = 'MONERIS_CC';
const MSTPAY_CC = 'MSTPAY_CC';
const NELTRAX_CC = 'NELTRAX_CC';
const NETBILL_CC = 'NETBILL_CC';
const NETREGS_CC = 'NETREGS_CC';
const NOCHEX_CC = 'NOCHEX_CC';
const OGONE_CC = 'OGONE_CC';
const OPTIMAL_CC = 'OPTIMAL_CC';
const PAY4ONE_CC = 'PAY4ONE_CC';
const PAYBOX_CC = 'PAYBOX_CC';
const PAYEXPR_CC = 'PAYEXPR_CC';
const PAYFAST_CC = 'PAYFAST_CC';
const PAYFLOW_CC = 'PAYFLOW_CC';
const PAYJUNC_CC = 'PAYJUNC_CC';
const PAYONE_CC = 'PAYONE_CC';
const PAYZEN_CC = 'PAYZEN_CC';
const PLUGNPL_CC = 'PLUGNPL_CC';
const PP_WSPP_CC = 'PP_WSPP_CC';
const PSIGATE_CC = 'PSIGATE_CC';
const PSL_CC = 'PSL_CC';
const PXPAY_CC = 'PXPAY_CC';
const QUIKPAY_CC = 'QUIKPAY_CC';
const REALEX_CC = 'REALEX_CC';
const SAGEPAY_CC = 'SAGEPAY_CC';
const SAGE_CC = 'SAGE_CC';
const SAMURAI_CC = 'SAMURAI_CC';
const SCPTECH_CC = 'SCPTECH_CC';
const SCP_AU_CC = 'SCP_AU_CC';
const SECPAY_CC = 'SECPAY_CC';
const SG_CC = 'SG_CC';
const SIX_CC = 'SIX_CC';
const SKIPJCK_CC = 'SKIPJCK_CC';
const SKRILL_CC = 'SKRILL_CC';
const STRIPE_CC = 'STRIPE_CC';
const TELECSH_CC = 'TELECSH_CC';
const TRNSFST_CC = 'TRNSFST_CC';
const TRUSTCM_CC = 'TRUSTCM_CC';
const USAEPAY_CC = 'USAEPAY_CC';
const VALITOR_CC = 'VALITOR_CC';
const VERIFI_CC = 'VERIFI_CC';
const VIAKLIX_CC = 'VIAKLIX_CC';
const WCARDS_CC = 'WCARDS_CC';
const WIRECRD_CC = 'WIRECRD_CC';
const WLDPDIR_CC = 'WLDPDIR_CC';
const WLDPOFF_CC = 'WLDPOFF_CC';

// ClickandBuy
const CNB = "CNB";
const SG_CNB = "SG_CNB";
const CNB = 'CNB';
const SG_CNB = 'SG_CNB';

const MCM = "MCM";
const UPAID_MCM = "UPAID_MCM";
const MCM = 'MCM';
const UPAID_MCM = 'UPAID_MCM';

const PAYU = "PAYU";
const PAYU = 'PAYU';

const REDIRECTCC = "REDIRECTCC";
const WORLDLINE = "WORLDLINE";
const REDIRECTCC = 'REDIRECTCC';
const WORLDLINE = 'WORLDLINE';

// SOFORT Überweisung
const SUE = "SUE";
const HDLPAY_SUE = "HDLPAY_SUE";
const MSTPAY_SUE = "MSTPAY_SUE";
const PAYONE_SUE = "PAYONE_SUE";
const SG_SUE = "SG_SUE";
const SKRILL_SUE = "SKRILL_SUE";
const WCARD_SUE = "WCARD_SUE";
const SUE = 'SUE';
const HDLPAY_SUE = 'HDLPAY_SUE';
const MSTPAY_SUE = 'MSTPAY_SUE';
const PAYONE_SUE = 'PAYONE_SUE';
const SG_SUE = 'SG_SUE';
const SKRILL_SUE = 'SKRILL_SUE';
const WCARD_SUE = 'WCARD_SUE';

// Giropay
const PAYONE_GP = "PAYONE_GP";
const PAYONE_GP = 'PAYONE_GP';

// iDEAL
const PAYONE_IDL = "PAYONE_IDL";
const SIX_IDEAL = "SIX_IDEAL";
const SKRILL_IDL = "SKRILL_IDL";
const PAYONE_IDL = 'PAYONE_IDL';
const SIX_IDEAL = 'SIX_IDEAL';
const SKRILL_IDL = 'SKRILL_IDL';

const AMAZON_PAYMENT = "MWS";
const AMAZON_PAYMENT = 'MWS';

// MERCHANT_PAYMENT
const MERCH_PM = 'MERCH_PM';
const MERCH_PM_2 = 'MERCH_PM_2';
const MERCH_PM_3 = 'MERCH_PM_3';

protected $customer_number;
protected $customer_ip;
Expand Down
Loading