diff --git a/composer.json b/composer.json
index f4a0691..677ad52 100644
--- a/composer.json
+++ b/composer.json
@@ -25,14 +25,16 @@
"ext-curl": "*",
"ext-mbstring": "*",
"ext-bcmath": "*",
+ "ext-gettext": "*",
"ingenico/ogone-sdk-php": "^3.1.0",
- "monolog/monolog": "*",
"league/iso3166": "*",
- "graylog2/gelf-php": "~1.5",
- "symfony/translation": "~4.2",
"mobiledetect/mobiledetectlib": "~2.8.0",
"viison/address-splitter": "~0.3.4"
},
+ "require-dev": {
+ "phpunit/phpunit": "^9.5",
+ "phpunit/php-code-coverage": "^9.2"
+ },
"autoload": {
"psr-4": {
"IngenicoClient\\": "src/"
diff --git a/error-codes.json b/error-codes.json
new file mode 100644
index 0000000..d51df81
--- /dev/null
+++ b/error-codes.json
@@ -0,0 +1,473 @@
+{
+ "0020001001": "Authorization failed, please retry",
+ "0020001002": "Authorization failed, please retry",
+ "0020001003": "Authorization failed, please retry",
+ "0020001004": "Authorization failed, please retry",
+ "0020001005": "Authorization failed, please retry",
+ "0020001006": "Authorization failed, please retry",
+ "0020001007": "Authorization failed, please retry",
+ "0020001008": "Authorization failed, please retry",
+ "0020001009": "Authorization failed, please retry",
+ "0020001010": "Authorization failed, please retry",
+ "0030001999": "Our payment system is currently under maintenance, please try later",
+ "0050001005": "Expiry date error",
+ "0050001007": "Requested Operation code not allowed",
+ "0050001008": "Invalid delay value",
+ "0050001010": "Input date in invalid format",
+ "0050001013": "Unable to parse socket input stream",
+ "0050001014": "Error in parsing stream content",
+ "0050001015": "Currency error",
+ "0050001016": "Transaction still posted at end of wait",
+ "0050001017": "Sync value not compatible with delay value",
+ "0050001019": "Transaction duplicate of a pre-existing transaction",
+ "0050001020": "Acceptation code empty while required for the transaction",
+ "0050001024": "Maintenance acquirer differs from original transaction acquirer",
+ "0050001025": "Maintenance merchant differs from original transaction merchant",
+ "0050001028": "Maintenance operation not accurate for the original transaction",
+ "0050001031": "Host application unknown for the transaction",
+ "0050001032": "Unable to perform requested operation with requested currency",
+ "0050001033": "Maintenance card number differs from original transaction card number",
+ "0050001034": "Operation code not allowed",
+ "0050001035": "Exception occurred in socket input stream treatment",
+ "0050001036": "Card length does not correspond to an acceptable value for the brand",
+ "0050001068": "A technical problem occurred, please contact helpdesk",
+ "0050001069": "Invalid check for CardID and Brand",
+ "0050001070": "A technical problem occurred, please contact helpdesk",
+ "0050001116": "Unknown origin IP",
+ "0050001117": "No origin IP detected",
+ "0050001118": "Merchant configuration problem, please contact support",
+ "10001001": "Communication failure",
+ "10001002": "Communication failure",
+ "10001003": "Communication failure",
+ "10001004": "Communication failure",
+ "10001005": "Communication failure",
+ "20001001": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001002": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001003": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001004": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001005": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001006": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001007": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001008": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001009": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001010": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001101": "A technical problem occurred, please contact helpdesk",
+ "20001105": "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
+ "20001111": "A technical problem occurred, please contact helpdesk",
+ "20002001": "Origin for the response of the bank can not be checked",
+ "20002002": "Beneficiary account number has been modified during processing",
+ "20002003": "Amount has been modified during processing",
+ "20002004": "Currency has been modified during processing",
+ "20002005": "No feedback from the bank server has been detected",
+ "30001001": "Payment refused by the acquirer",
+ "30001002": "Duplicate request",
+ "30001010": "A technical problem occurred, please contact helpdesk",
+ "30001011": "A technical problem occurred, please contact helpdesk",
+ "30001012": "Card black listed - Contact acquirer",
+ "30001015": "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
+ "30001051": "A technical problem occurred, please contact helpdesk",
+ "30001054": "A technical problem occurred, please contact helpdesk",
+ "30001057": "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
+ "30001058": "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
+ "30001060": "Aquirer indicates that a failure occured during payment processing",
+ "30001070": "RATEPAY Invalid Response Type (Failure)",
+ "30001071": "RATEPAY Missing Mandatory status code field (failure)",
+ "30001072": "RATEPAY Missing Mandatory Result code field (failure)",
+ "30001073": "RATEPAY Response parsing Failed",
+ "30001090": "CVC check required by front end and returned invalid by acquirer",
+ "30001091": "ZIP check required by front end and returned invalid by acquirer",
+ "30001092": "Address check required by front end and returned as invalid by acquirer.",
+ "30001100": "Unauthorized buyer's country",
+ "30001101": "IP country <> card country",
+ "30001102": "Number of different countries too high",
+ "30001103": "unauthorized card country",
+ "30001104": "unauthorized ip address country",
+ "30001105": "Anonymous proxy",
+ "30001110": "If the problem persists, please contact Support, or go to paysafecard's card balance page (https:\/\/customer.cc.at.paysafecard.com\/psccustomer\/GetWelcomePanelServlet?language=en) to see when the amount reserved on your card will be available again.",
+ "30001120": "IP address in merchant's black list",
+ "30001130": "BIN in merchant's black list",
+ "30001131": "Wrong BIN for 3xCB",
+ "30001140": "Card in merchant's card blacklist",
+ "30001141": "Email in blacklist",
+ "30001142": "Passenger name in blacklist",
+ "30001143": "Card holder name in blacklist",
+ "30001144": "Passenger name different from owner name",
+ "30001145": "Time to departure too short",
+ "30001149": "Card Configured in Card Supplier Limit for another relation (CSL)",
+ "30001150": "Card not configured in the system for this customer (CSL)",
+ "30001151": "REF1 not allowed for this relationship (Contract number",
+ "30001152": "Card\/Supplier Amount limit reached (CSL)",
+ "30001153": "Card not allowed for this supplier (Date out of contract bounds)",
+ "30001154": "You have reached the usage limit allowed",
+ "30001155": "You have reached the usage limit allowed",
+ "30001156": "You have reached the usage limit allowed",
+ "30001157": "Unauthorized IP country for itinerary",
+ "30001158": "email usage limit reached",
+ "30001159": "Unauthorized card country\/IP country combination",
+ "30001160": "Postcode in highrisk group",
+ "30001161": "generic blacklist match",
+ "30001162": "Billing Address is a PO Box",
+ "30001180": "maximum scoring reached",
+ "30001997": "Authorization canceled by simulation",
+ "30001998": "A technical problem occurred, please try again.",
+ "30001999": "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
+ "30002001": "Payment refused by the financial institution",
+ "30021001": "Call acquirer support call number.",
+ "30022001": "Payment must be approved by the acquirer before execution.",
+ "30031001": "Invalid merchant number.",
+ "30041001": "Retain card.",
+ "30051001": "Authorization declined",
+ "30071001": "Retain card - special conditions.",
+ "30121001": "Invalid transaction",
+ "30131001": "Invalid amount",
+ "30131002": "You have reached the total amount allowed",
+ "30141001": "Invalid card number",
+ "30151001": "Unknown acquiring institution.",
+ "30171001": "Payment method cancelled by the buyer",
+ "30171002": "The maximum time allowed is elapsed.",
+ "30191001": "Try again later.",
+ "30201001": "A technical problem occurred, please contact helpdesk",
+ "30301001": "Invalid format",
+ "30311001": "Unknown acquirer ID.",
+ "30331001": "Card expired.",
+ "30341001": "Suspicion of fraud.",
+ "30341002": "Suspicion of fraud (3rdMan)",
+ "30341003": "Suspicion of fraud (Perseuss)",
+ "30341004": "Suspicion of fraud (ETHOCA)",
+ "30381001": "A technical problem occurred, please contact helpdesk",
+ "30401001": "Invalid function.",
+ "30411001": "Lost card.",
+ "30431001": "Stolen card, pick up",
+ "30511001": "Insufficient funds.",
+ "30521001": "No Authorization. Contact the issuer of your card.",
+ "30541001": "Card expired.",
+ "30551001": "Invalid PIN.",
+ "30561001": "Card not in authorizer's database.",
+ "30571001": "Transaction not permitted on card.",
+ "30581001": "Transaction not allowed on this terminal",
+ "30591001": "Suspicion of fraud.",
+ "30601001": "The merchant must contact the acquirer.",
+ "30611001": "Amount exceeds card ceiling.",
+ "30621001": "Restricted card.",
+ "30631001": "Security policy not respected.",
+ "30641001": "Amount changed from ref. trn.",
+ "30681001": "Tardy response.",
+ "30751001": "PIN entered incorrectly too often",
+ "30761001": "Card holder already contesting.",
+ "30771001": "PIN entry required.",
+ "30811001": "Message flow error.",
+ "30821001": "Authorization center unavailable",
+ "30831001": "Authorization center unavailable",
+ "30901001": "Temporary system shutdown.",
+ "30911001": "Acquirer unavailable.",
+ "30921001": "Invalid card type for acquirer.",
+ "30941001": "Duplicate transaction",
+ "30961001": "Processing temporarily not possible",
+ "30971001": "A technical problem occurred, please contact helpdesk",
+ "30981001": "A technical problem occurred, please contact helpdesk",
+ "31011001": "Unknown acceptance code",
+ "31021001": "Invalid currency",
+ "31031001": "Acceptance code missing",
+ "31041001": "Inactive card",
+ "31051001": "Merchant not active",
+ "31061001": "Invalid expiration date",
+ "31071001": "Interrupted host communication",
+ "31081001": "Card refused",
+ "31091001": "Invalid password",
+ "31101001": "Plafond transaction (major\u00e9 du bonus) d\u00e9pass\u00e9",
+ "31111001": "Plafond mensuel (major\u00e9 du bonus) d\u00e9pass\u00e9",
+ "31121001": "Plafond centre de facturation d\u00e9pass\u00e9",
+ "31131001": "Plafond entreprise d\u00e9pass\u00e9",
+ "31141001": "Code MCC du fournisseur non autoris\u00e9 pour la carte",
+ "31151001": "Num\u00e9ro SIRET du fournisseur non autoris\u00e9 pour la carte",
+ "31161001": "This is not a valid online banking account",
+ "32001004": "A technical problem occurred, please try again.",
+ "34011001": "Bezahlung mit RatePAY nicht m\u00f6glich.",
+ "39991001": "A technical problem occurred, please contact the helpdesk of your acquirer",
+ "40001001": "A technical problem occurred, please try again.",
+ "40001002": "A technical problem occurred, please try again.",
+ "40001003": "A technical problem occurred, please try again.",
+ "40001004": "A technical problem occurred, please try again.",
+ "40001005": "A technical problem occurred, please try again.",
+ "40001006": "A technical problem occurred, please try again.",
+ "40001007": "A technical problem occurred, please try again.",
+ "40001008": "A technical problem occurred, please try again.",
+ "40001009": "A technical problem occurred, please try again.",
+ "40001010": "A technical problem occurred, please try again.",
+ "40001011": "A technical problem occurred, please contact helpdesk",
+ "40001012": "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
+ "40001013": "A technical problem occurred, please contact helpdesk",
+ "40001016": "A technical problem occurred, please contact helpdesk",
+ "40001018": "A technical problem occurred, please try again.",
+ "40001019": "Sorry, an error occurred during processing. Please retry the operation (use back button of the browser). If problem persists, contact your merchant's helpdesk.",
+ "40001020": "Sorry, an error occurred during processing. Please retry the operation (use back button of the browser). If problem persists, contact your merchant's helpdesk.",
+ "40001050": "A technical problem occurred, please contact helpdesk",
+ "40001133": "Authentication failed, the signature of your bank access control server is incorrect",
+ "40001134": "Authentication failed, please retry or cancel.",
+ "40001135": "Authentication temporary unavailable, please retry or cancel.",
+ "40001136": "Technical problem with your browser, please retry or cancel",
+ "40001137": "Your bank access control server is temporary unavailable, please retry or cancel",
+ "40001998": "Temporary technical problem. Please retry a little bit later.",
+ "50001001": "Unknown card type",
+ "50001002": "Card number format check failed for given card number.",
+ "50001003": "Merchant data error",
+ "50001004": "Merchant identification missing",
+ "50001005": "Expiry date error",
+ "50001006": "Amount is not a number",
+ "50001007": "A technical problem occurred, please contact helpdesk",
+ "50001008": "A technical problem occurred, please contact helpdesk",
+ "50001009": "A technical problem occurred, please contact helpdesk",
+ "50001010": "A technical problem occurred, please contact helpdesk",
+ "50001011": "Brand not supported for that merchant",
+ "50001012": "A technical problem occurred, please contact helpdesk",
+ "50001013": "A technical problem occurred, please contact helpdesk",
+ "50001014": "A technical problem occurred, please contact helpdesk",
+ "50001015": "Invalid currency code",
+ "50001016": "A technical problem occurred, please contact helpdesk",
+ "50001017": "A technical problem occurred, please contact helpdesk",
+ "50001018": "A technical problem occurred, please contact helpdesk",
+ "50001019": "A technical problem occurred, please contact helpdesk",
+ "50001020": "A technical problem occurred, please contact helpdesk",
+ "50001021": "A technical problem occurred, please contact helpdesk",
+ "50001022": "A technical problem occurred, please contact helpdesk",
+ "50001023": "A technical problem occurred, please contact helpdesk",
+ "50001024": "A technical problem occurred, please contact helpdesk",
+ "50001025": "A technical problem occurred, please contact helpdesk",
+ "50001026": "A technical problem occurred, please contact helpdesk",
+ "50001027": "A technical problem occurred, please contact helpdesk",
+ "50001028": "A technical problem occurred, please contact helpdesk",
+ "50001029": "A technical problem occurred, please contact helpdesk",
+ "50001030": "A technical problem occurred, please contact helpdesk",
+ "50001031": "A technical problem occurred, please contact helpdesk",
+ "50001032": "A technical problem occurred, please contact helpdesk",
+ "50001033": "A technical problem occurred, please contact helpdesk",
+ "50001034": "A technical problem occurred, please contact helpdesk",
+ "50001035": "A technical problem occurred, please contact helpdesk",
+ "50001036": "Card length does not correspond to an acceptable value for the brand",
+ "50001037": "Purchasing card number for a regular merchant",
+ "50001038": "Non Purchasing card for a Purchasing card merchant",
+ "50001039": "Details sent for a non-Purchasing card merchant, please contact helpdesk",
+ "50001040": "Details not sent for a Purchasing card transaction, please contact helpdesk",
+ "50001041": "Payment detail validation failed",
+ "50001042": "Given transactions amounts (tax,discount,shipping,net,etc\u2026) do not compute correctly together",
+ "50001043": "A technical problem occurred, please contact helpdesk",
+ "50001044": "No acquirer configured for this operation",
+ "50001045": "No UID configured for this operation",
+ "50001046": "Operation not allowed for the merchant",
+ "50001047": "A technical problem occurred, please contact helpdesk",
+ "50001048": "A technical problem occurred, please contact helpdesk",
+ "50001049": "A technical problem occurred, please contact helpdesk",
+ "50001050": "A technical problem occurred, please contact helpdesk",
+ "50001051": "A technical problem occurred, please contact helpdesk",
+ "50001052": "A technical problem occurred, please contact helpdesk",
+ "50001053": "A technical problem occurred, please contact helpdesk",
+ "50001054": "Card number incorrect or incompatible",
+ "50001055": "A technical problem occurred, please contact helpdesk",
+ "50001056": "A technical problem occurred, please contact helpdesk",
+ "50001057": "A technical problem occurred, please contact helpdesk",
+ "50001058": "A technical problem occurred, please contact helpdesk",
+ "50001059": "A technical problem occurred, please contact helpdesk",
+ "50001060": "A technical problem occurred, please contact helpdesk",
+ "50001061": "A technical problem occurred, please contact helpdesk",
+ "50001062": "A technical problem occurred, please contact helpdesk",
+ "50001063": "Card Issue Number does not correspond to range or not present",
+ "50001064": "Start Date not valid or not present",
+ "50001066": "Format of CVC code invalid",
+ "50001067": "The merchant is not enrolled for 3D-Secure",
+ "50001068": "The card number or account number (PAN) is invalid",
+ "50001069": "Invalid check for CardID and Brand",
+ "50001070": "The ECI value given is either not supported, or in conflict with other data in the transaction",
+ "50001071": "Incomplete TRN demat",
+ "50001072": "Incomplete PAY demat",
+ "50001073": "No demat APP",
+ "50001074": "Authorisation too old",
+ "50001075": "VERRes was an error message",
+ "50001076": "DCP amount greater than authorisation amount",
+ "50001077": "Details negative amount",
+ "50001078": "Details negative quantity",
+ "50001079": "Could not decode\/decompress received PARes (3D-Secure)",
+ "50001080": "Received PARes was an erereor message from ACS (3D-Secure)",
+ "50001081": "Received PARes format was invalid according to the 3DS specifications (3D-Secure)",
+ "50001082": "PAReq\/PARes reconciliation failure (3D-Secure)",
+ "50001084": "Maximum amount reached",
+ "50001087": "The transaction type requires authentication, please check with your bank.",
+ "50001090": "CVC missing at input, but CVC check asked",
+ "50001091": "ZIP missing at input, but ZIP check asked",
+ "50001092": "Address missing at input, but Address check asked",
+ "50001095": "Invalid date of birth",
+ "50001096": "Invalid commodity code",
+ "50001097": "The requested currency and brand are incompatible.",
+ "50001111": "Data validation error",
+ "50001113": "This order has already been processed",
+ "50001114": "Error pre-payment check page access",
+ "50001115": "Request not received in secure mode",
+ "50001116": "Unknown IP address origin",
+ "50001117": "NO IP address origin",
+ "50001118": "Pspid not found or not correct",
+ "50001119": "Password incorrect or disabled due to numbers of errors",
+ "50001120": "Invalid currency",
+ "50001121": "Invalid number of decimals for the currency",
+ "50001122": "Currency not accepted by the merchant",
+ "50001123": "Card type not active",
+ "50001124": "Number of lines don't match with number of payments",
+ "50001125": "Format validation error",
+ "50001126": "Overflow in data capture requests for the original order",
+ "50001127": "The original order is not in a correct status",
+ "50001128": "missing authorization code for unauthorized order",
+ "50001129": "Overflow in refunds requests",
+ "50001130": "Error access to original order",
+ "50001131": "Error access to original history item",
+ "50001132": "The Selected Catalog is empty",
+ "50001133": "Duplicate request",
+ "50001134": "Authentication failed, please retry or cancel.",
+ "50001135": "Authentication temporary unavailable, please retry or cancel.",
+ "50001136": "Technical problem with your browser, please retry or cancel",
+ "50001137": "Your bank access control server is temporary unavailable, please retry or cancel",
+ "50001150": "Fraud Detection, Technical error (IP not valid)",
+ "50001151": "Fraud detection => technical error (IPCTY unknown or error)",
+ "50001152": "Fraud detection => technical error (CCCTY unknown or error)",
+ "50001153": "Overflow in redo-authorisation requests",
+ "50001170": "Dynamic BIN check failed",
+ "50001171": "Dynamic country check failed",
+ "50001172": "Error in Amadeus signature",
+ "50001174": "Card Holder Name is too long",
+ "50001175": "Name contains invalid characters",
+ "50001176": "Card number is too long",
+ "50001177": "Card number contains non-numeric info",
+ "50001178": "Card Number Empty",
+ "50001179": "CVC too long",
+ "50001180": "CVC contains non-numeric info",
+ "50001181": "Expiration date contains non-numeric info",
+ "50001182": "Invalid expiration month",
+ "50001183": "Expiration date must be in the future",
+ "50001184": "SHA Mismatch",
+ "50001205": "Missing mandatory fields for billing address.",
+ "50001206": "Missing mandatory field date of birth.",
+ "50001207": "Missing required shopping basket details.",
+ "50001208": "Missing social security number",
+ "50001209": "Invalid country code",
+ "50001210": "Missing yearly salary",
+ "50001211": "Missing gender",
+ "50001212": "Missing email",
+ "50001213": "Missing IP address",
+ "50001214": "Missing part payment campaign ID",
+ "50001215": "Missing invoice number",
+ "50001216": "The alias must be different than the card number",
+ "60000001": "account number unknown",
+ "60000003": "not credited dd-mm-yy",
+ "60000005": "name\/number do not correspond",
+ "60000007": "account number blocked",
+ "60000008": "specific direct debit block",
+ "60000009": "account number WKA",
+ "60000010": "administrative reason",
+ "60000011": "account number expired",
+ "60000012": "no direct debit authorisation given",
+ "60000013": "debit not approved",
+ "60000014": "double payment",
+ "60000018": "name\/address\/city not entered",
+ "60001001": "no original direct debit for revocation",
+ "60001002": "payer\u2019s account number format error",
+ "60001004": "payer\u2019s account at different bank",
+ "60001005": "payee\u2019s account at different bank",
+ "60001006": "payee\u2019s account number format error",
+ "60001007": "payer\u2019s account number blocked",
+ "60001008": "payer\u2019s account number expired",
+ "60001009": "payee\u2019s account number expired",
+ "60001010": "direct debit not possible",
+ "60001011": "creditor payment not possible",
+ "60001012": "payer\u2019s account number unknown WKA-number",
+ "60001013": "payee\u2019s account number unknown WKA-number",
+ "60001014": "impermissible WKA transaction",
+ "60001015": "period for revocation expired",
+ "60001017": "reason for revocation not correct",
+ "60001018": "original run number not numeric",
+ "60001019": "payment ID incorrect",
+ "60001020": "amount not numeric",
+ "60001021": "amount zero not permitted",
+ "60001022": "negative amount not permitted",
+ "60001023": "payer and payee giro account number",
+ "60001025": "processing code (verwerkingscode) incorrect",
+ "60001028": "revocation not permitted",
+ "60001029": "guaranteed direct debit on giro account number",
+ "60001030": "NBC transaction type incorrect",
+ "60001031": "description too large",
+ "60001032": "book account number not issued",
+ "60001034": "book account number incorrect",
+ "60001035": "payer\u2019s account number not numeric",
+ "60001036": "payer\u2019s account number not eleven-proof",
+ "60001037": "payer\u2019s account number not issued",
+ "60001039": "payer\u2019s account number of DNB\/BGC\/BLA",
+ "60001040": "payee\u2019s account number not numeric",
+ "60001041": "payee\u2019s account number not eleven-proof",
+ "60001042": "payee\u2019s account number not issued",
+ "60001044": "payee\u2019s account number unknown",
+ "60001050": "payee\u2019s name missing",
+ "60001051": "indicate payee\u2019s bank account number instead of 3102",
+ "60001052": "no direct debit contract",
+ "60001053": "amount beyond bounds",
+ "60001054": "selective direct debit block",
+ "60001055": "original run number unknown",
+ "60001057": "payer\u2019s name missing",
+ "60001058": "payee\u2019s account number missing",
+ "60001059": "restore not permitted",
+ "60001060": "bank\u2019s reference (navraaggegeven) missing",
+ "60001061": "BEC\/GBK number incorrect",
+ "60001062": "BEC\/GBK code incorrect",
+ "60001087": "book account number not numeric",
+ "60001090": "cancelled on request",
+ "60001091": "cancellation order executed",
+ "60001092": "cancelled instead of bended",
+ "60001093": "book account number is a shortened account number",
+ "60001094": "instructing party account number not identical with payer",
+ "60001095": "payee unknown GBK acceptor",
+ "60001097": "instructing party account number not identical with payee",
+ "60001099": "clearing not permitted",
+ "60001101": "payer\u2019s account number not spaces",
+ "60001102": "PAN length not numeric",
+ "60001103": "PAN length outside limits",
+ "60001104": "track number not numeric",
+ "60001105": "track number not valid",
+ "60001106": "PAN sequence number not numeric",
+ "60001107": "domestic PAN not numeric",
+ "60001108": "domestic PAN not eleven-proof",
+ "60001109": "domestic PAN not issued",
+ "60001110": "foreign PAN not numeric",
+ "60001111": "card valid date not numeric",
+ "60001112": "book period number (boekperiodenr) not numeric",
+ "60001113": "transaction number not numeric",
+ "60001114": "transaction time not numeric",
+ "60001115": "transaction no valid time",
+ "60001116": "transaction date not numeric",
+ "60001117": "transaction no valid date",
+ "60001118": "STAN not numeric",
+ "60001119": "instructing party\u2019s name missing",
+ "60001120": "foreign amount (bedrag-vv) not numeric",
+ "60001122": "rate (verrekenkoers) not numeric",
+ "60001125": "number of decimals (aantaldecimalen) incorrect",
+ "60001126": "tariff (tarifering) not B\/O\/S",
+ "60001127": "domestic costs (kostenbinnenland) not numeric",
+ "60001128": "domestic costs (kostenbinnenland) not higher than zero",
+ "60001129": "foreign costs (kostenbuitenland) not numeric",
+ "60001130": "foreign costs (kostenbuitenland) not higher than zero",
+ "60001131": "domestic costs (kostenbinnenland) not zero",
+ "60001132": "foreign costs (kostenbuitenland) not zero",
+ "60001134": "Euro record not fully filled in",
+ "60001135": "Client currency incorrect",
+ "60001136": "Amount NLG not numeric",
+ "60001137": "Amount NLG not higher than zero",
+ "60001138": "Amount NLG not equal to Amount",
+ "60001139": "Amount NLG incorrectly converted",
+ "60001140": "Amount EUR not numeric",
+ "60001141": "Amount EUR not greater than zero",
+ "60001142": "Amount EUR not equal to Amount",
+ "60001143": "Amount EUR incorrectly converted",
+ "60001144": "Client currency not NLG",
+ "60001145": "rate euro-vv (Koerseuro-vv) not numeric",
+ "60001146": "comma rate euro-vv (Kommakoerseuro-vv) incorrect",
+ "60001147": "acceptgiro distributor not valid",
+ "60001148": "Original run number and\/or BRN are missing",
+ "60001149": "Amount\/Account number\/ BRN different",
+ "60001150": "Direct debit already revoked\/restored",
+ "60001151": "Direct debit already reversed\/revoked\/restored",
+ "60001153": "Payer\u2019s account number not known"
+}
\ No newline at end of file
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index d2725ab..c84ad59 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -5,14 +5,17 @@
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
- bootstrap="vendor/autoload.php"
+ bootstrap="tests/bootstrap.php"
>
-
+
+
+
+
@@ -27,7 +30,7 @@
-
+
diff --git a/src/Client.php b/src/Client.php
index abf6b59..c6d804d 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -2,22 +2,20 @@
namespace IngenicoClient;
-use Psr\Log\LoggerInterface;
-
/**
* Class Client.
*/
class Client
{
- /** @var LoggerInterface|null */
- protected $logger;
+ /** @var Logger */
+ private $logger;
/**
* Request constructor.
*
- * @param LoggerInterface $logger
+ * @param Logger $logger
*/
- public function __construct(LoggerInterface $logger = null)
+ public function __construct(Logger $logger)
{
$this->logger = $logger;
}
@@ -61,17 +59,15 @@ public function post(array $params, $url, $shaSign)
curl_close($ch);
- if ($this->logger) {
- $this->logger->debug(sprintf('Post request to: %s', $url), [
- 'url' => $url,
- 'shasign' => $shaSign,
- 'params' => $body,
- 'response' => $response,
- 'http_code' => $info['http_code'],
- 'error' => $error,
- 'errno' => $errno
- ]);
- }
+ $this->logger->debug(sprintf('Post request to: %s', $url), [
+ 'url' => $url,
+ 'shasign' => $shaSign,
+ 'params' => $body,
+ 'response' => $response,
+ 'http_code' => $info['http_code'],
+ 'error' => $error,
+ 'errno' => $errno
+ ]);
return $response;
}
diff --git a/src/DirectLink.php b/src/DirectLink.php
index 96159d4..545e270 100644
--- a/src/DirectLink.php
+++ b/src/DirectLink.php
@@ -2,7 +2,6 @@
namespace IngenicoClient;
-use Psr\Log\LoggerInterface;
use Ogone\DirectLink\DirectLinkQueryRequest;
use Ogone\DirectLink\DirectLinkQueryResponse;
use Ogone\DirectLink\DirectLinkMaintenanceRequest;
@@ -19,32 +18,22 @@ class DirectLink
const ITEM_PRICE = 'itemprice';
const ITEM_VATCODE = 'itemvatcode';
- /** @var LoggerInterface|null */
+ /** @var Logger */
private $logger;
/**
* Set Logger.
*
- * @param LoggerInterface|null $logger
+ * @param Logger $logger
* @return $this
*/
- public function setLogger(LoggerInterface $logger = null)
+ public function setLogger(Logger $logger)
{
$this->logger = $logger;
return $this;
}
- /**
- * Get Logger.
- *
- * @return LoggerInterface|null
- */
- public function getLogger()
- {
- return $this->logger;
- }
-
/**
* Create Refund Request.
*
diff --git a/src/DirectLinkPayment.php b/src/DirectLinkPayment.php
index d30894b..9aa5549 100644
--- a/src/DirectLinkPayment.php
+++ b/src/DirectLinkPayment.php
@@ -26,7 +26,7 @@ public function executePayment($orderId, Alias $alias)
$dlPaymentRequest = $this->getDirectLinkPaymentRequest($order, $alias);
- $client = new Client($this->getLogger());
+ $client = new Client($this->logger);
$response = $client->post(
$dlPaymentRequest->toArray(),
$dlPaymentRequest->getOgoneUri(),
diff --git a/src/IngenicoCoreLibrary.php b/src/IngenicoCoreLibrary.php
index 71e89a4..004302e 100644
--- a/src/IngenicoCoreLibrary.php
+++ b/src/IngenicoCoreLibrary.php
@@ -14,11 +14,11 @@
use IngenicoClient\PaymentMethod\FacilyPay3xnf;
use IngenicoClient\PaymentMethod\FacilyPay4x;
use IngenicoClient\PaymentMethod\FacilyPay4xnf;
-use Psr\Log\LoggerInterface;
-use Symfony\Component\Translation\Translator;
-use Symfony\Component\Translation\Loader\PoFileLoader;
use VIISON\AddressSplitter\AddressSplitter;
use VIISON\AddressSplitter\Exceptions\SplittingException;
+use IngenicoClient\Logger\AdapterInterface;
+use IngenicoClient\Logger\MonologAdapter;
+use IngenicoClient\Logger\FileAdapter;
class IngenicoCoreLibrary implements
IngenicoCoreLibraryInterface,
@@ -151,484 +151,6 @@ class IngenicoCoreLibrary implements
'se_SE' => 'Swedish', 'sk_SK' => 'Slovak', 'tr_TR' => 'Turkish',
];
- /**
- * Ingenico Error Codes
- * @var array
- */
- public static $errorCodes = [
- '0020001001' => "Authorization failed, please retry",
- '0020001002' => "Authorization failed, please retry",
- '0020001003' => "Authorization failed, please retry",
- '0020001004' => "Authorization failed, please retry",
- '0020001005' => "Authorization failed, please retry",
- '0020001006' => "Authorization failed, please retry",
- '0020001007' => "Authorization failed, please retry",
- '0020001008' => "Authorization failed, please retry",
- '0020001009' => "Authorization failed, please retry",
- '0020001010' => "Authorization failed, please retry",
- '0030001999' => "Our payment system is currently under maintenance, please try later",
- '0050001005' => "Expiry date error",
- '0050001007' => "Requested Operation code not allowed",
- '0050001008' => "Invalid delay value",
- '0050001010' => "Input date in invalid format",
- '0050001013' => "Unable to parse socket input stream",
- '0050001014' => "Error in parsing stream content",
- '0050001015' => "Currency error",
- '0050001016' => "Transaction still posted at end of wait",
- '0050001017' => "Sync value not compatible with delay value",
- '0050001019' => "Transaction duplicate of a pre-existing transaction",
- '0050001020' => "Acceptation code empty while required for the transaction",
- '0050001024' => "Maintenance acquirer differs from original transaction acquirer",
- '0050001025' => "Maintenance merchant differs from original transaction merchant",
- '0050001028' => "Maintenance operation not accurate for the original transaction",
- '0050001031' => "Host application unknown for the transaction",
- '0050001032' => "Unable to perform requested operation with requested currency",
- '0050001033' => "Maintenance card number differs from original transaction card number",
- '0050001034' => "Operation code not allowed",
- '0050001035' => "Exception occurred in socket input stream treatment",
- '0050001036' => "Card length does not correspond to an acceptable value for the brand",
- '0050001068' => "A technical problem occurred, please contact helpdesk",
- '0050001069' => "Invalid check for CardID and Brand",
- '0050001070' => "A technical problem occurred, please contact helpdesk",
- '0050001116' => "Unknown origin IP",
- '0050001117' => "No origin IP detected",
- '0050001118' => "Merchant configuration problem, please contact support",
- '10001001' => "Communication failure",
- '10001002' => "Communication failure",
- '10001003' => "Communication failure",
- '10001004' => "Communication failure",
- '10001005' => "Communication failure",
- '20001001' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001002' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001003' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001004' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001005' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001006' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001007' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001008' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001009' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001010' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001101' => "A technical problem occurred, please contact helpdesk",
- '20001105' => "We received an unknown status for the transaction. We will contact your acquirer and update the status of the transaction within one working day. Please check the status later.",
- '20001111' => "A technical problem occurred, please contact helpdesk",
- '20002001' => "Origin for the response of the bank can not be checked",
- '20002002' => "Beneficiary account number has been modified during processing",
- '20002003' => "Amount has been modified during processing",
- '20002004' => "Currency has been modified during processing",
- '20002005' => "No feedback from the bank server has been detected",
- '30001001' => "Payment refused by the acquirer",
- '30001002' => "Duplicate request",
- '30001010' => "A technical problem occurred, please contact helpdesk",
- '30001011' => "A technical problem occurred, please contact helpdesk",
- '30001012' => "Card black listed - Contact acquirer",
- '30001015' => "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
- '30001051' => "A technical problem occurred, please contact helpdesk",
- '30001054' => "A technical problem occurred, please contact helpdesk",
- '30001057' => "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
- '30001058' => "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
- '30001060' => "Aquirer indicates that a failure occured during payment processing",
- '30001070' => "RATEPAY Invalid Response Type (Failure)",
- '30001071' => "RATEPAY Missing Mandatory status code field (failure)",
- '30001072' => "RATEPAY Missing Mandatory Result code field (failure)",
- '30001073' => "RATEPAY Response parsing Failed",
- '30001090' => "CVC check required by front end and returned invalid by acquirer",
- '30001091' => "ZIP check required by front end and returned invalid by acquirer",
- '30001092' => "Address check required by front end and returned as invalid by acquirer.",
- '30001100' => "Unauthorized buyer's country",
- '30001101' => "IP country <> card country",
- '30001102' => "Number of different countries too high",
- '30001103' => "unauthorized card country",
- '30001104' => "unauthorized ip address country",
- '30001105' => "Anonymous proxy",
- '30001110' => "If the problem persists, please contact Support, or go to paysafecard's card balance page (https://customer.cc.at.paysafecard.com/psccustomer/GetWelcomePanelServlet?language=en) to see when the amount reserved on your card will be available again.",
- '30001120' => "IP address in merchant's black list",
- '30001130' => "BIN in merchant's black list",
- '30001131' => "Wrong BIN for 3xCB",
- '30001140' => "Card in merchant's card blacklist",
- '30001141' => "Email in blacklist",
- '30001142' => "Passenger name in blacklist",
- '30001143' => "Card holder name in blacklist",
- '30001144' => "Passenger name different from owner name",
- '30001145' => "Time to departure too short",
- '30001149' => "Card Configured in Card Supplier Limit for another relation (CSL)",
- '30001150' => "Card not configured in the system for this customer (CSL)",
- '30001151' => "REF1 not allowed for this relationship (Contract number",
- '30001152' => "Card/Supplier Amount limit reached (CSL)",
- '30001153' => "Card not allowed for this supplier (Date out of contract bounds)",
- '30001154' => "You have reached the usage limit allowed",
- '30001155' => "You have reached the usage limit allowed",
- '30001156' => "You have reached the usage limit allowed",
- '30001157' => "Unauthorized IP country for itinerary",
- '30001158' => "email usage limit reached",
- '30001159' => "Unauthorized card country/IP country combination",
- '30001160' => "Postcode in highrisk group",
- '30001161' => "generic blacklist match",
- '30001162' => "Billing Address is a PO Box",
- '30001180' => "maximum scoring reached",
- '30001997' => "Authorization canceled by simulation",
- '30001998' => "A technical problem occurred, please try again.",
- '30001999' => "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
- '30002001' => "Payment refused by the financial institution",
- '30021001' => "Call acquirer support call number.",
- '30022001' => "Payment must be approved by the acquirer before execution.",
- '30031001' => "Invalid merchant number.",
- '30041001' => "Retain card.",
- '30051001' => "Authorization declined",
- '30071001' => "Retain card - special conditions.",
- '30121001' => "Invalid transaction",
- '30131001' => "Invalid amount",
- '30131002' => "You have reached the total amount allowed",
- '30141001' => "Invalid card number",
- '30151001' => "Unknown acquiring institution.",
- '30171001' => "Payment method cancelled by the buyer",
- '30171002' => "The maximum time allowed is elapsed.",
- '30191001' => "Try again later.",
- '30201001' => "A technical problem occurred, please contact helpdesk",
- '30301001' => "Invalid format",
- '30311001' => "Unknown acquirer ID.",
- '30331001' => "Card expired.",
- '30341001' => "Suspicion of fraud.",
- '30341002' => "Suspicion of fraud (3rdMan)",
- '30341003' => "Suspicion of fraud (Perseuss)",
- '30341004' => "Suspicion of fraud (ETHOCA)",
- '30381001' => "A technical problem occurred, please contact helpdesk",
- '30401001' => "Invalid function.",
- '30411001' => "Lost card.",
- '30431001' => "Stolen card, pick up",
- '30511001' => "Insufficient funds.",
- '30521001' => "No Authorization. Contact the issuer of your card.",
- '30541001' => "Card expired.",
- '30551001' => "Invalid PIN.",
- '30561001' => "Card not in authorizer's database.",
- '30571001' => "Transaction not permitted on card.",
- '30581001' => "Transaction not allowed on this terminal",
- '30591001' => "Suspicion of fraud.",
- '30601001' => "The merchant must contact the acquirer.",
- '30611001' => "Amount exceeds card ceiling.",
- '30621001' => "Restricted card.",
- '30631001' => "Security policy not respected.",
- '30641001' => "Amount changed from ref. trn.",
- '30681001' => "Tardy response.",
- '30751001' => "PIN entered incorrectly too often",
- '30761001' => "Card holder already contesting.",
- '30771001' => "PIN entry required.",
- '30811001' => "Message flow error.",
- '30821001' => "Authorization center unavailable",
- '30831001' => "Authorization center unavailable",
- '30901001' => "Temporary system shutdown.",
- '30911001' => "Acquirer unavailable.",
- '30921001' => "Invalid card type for acquirer.",
- '30941001' => "Duplicate transaction",
- '30961001' => "Processing temporarily not possible",
- '30971001' => "A technical problem occurred, please contact helpdesk",
- '30981001' => "A technical problem occurred, please contact helpdesk",
- '31011001' => "Unknown acceptance code",
- '31021001' => "Invalid currency",
- '31031001' => "Acceptance code missing",
- '31041001' => "Inactive card",
- '31051001' => "Merchant not active",
- '31061001' => "Invalid expiration date",
- '31071001' => "Interrupted host communication",
- '31081001' => "Card refused",
- '31091001' => "Invalid password",
- '31101001' => "Plafond transaction (majoré du bonus) dépassé",
- '31111001' => "Plafond mensuel (majoré du bonus) dépassé",
- '31121001' => "Plafond centre de facturation dépassé",
- '31131001' => "Plafond entreprise dépassé",
- '31141001' => "Code MCC du fournisseur non autorisé pour la carte",
- '31151001' => "Numéro SIRET du fournisseur non autorisé pour la carte",
- '31161001' => "This is not a valid online banking account",
- '32001004' => "A technical problem occurred, please try again.",
- '34011001' => "Bezahlung mit RatePAY nicht möglich.",
- '39991001' => "A technical problem occurred, please contact the helpdesk of your acquirer",
- '40001001' => "A technical problem occurred, please try again.",
- '40001002' => "A technical problem occurred, please try again.",
- '40001003' => "A technical problem occurred, please try again.",
- '40001004' => "A technical problem occurred, please try again.",
- '40001005' => "A technical problem occurred, please try again.",
- '40001006' => "A technical problem occurred, please try again.",
- '40001007' => "A technical problem occurred, please try again.",
- '40001008' => "A technical problem occurred, please try again.",
- '40001009' => "A technical problem occurred, please try again.",
- '40001010' => "A technical problem occurred, please try again.",
- '40001011' => "A technical problem occurred, please contact helpdesk",
- '40001012' => "Your merchant's acquirer is temporarily unavailable, please try later or choose another payment method.",
- '40001013' => "A technical problem occurred, please contact helpdesk",
- '40001016' => "A technical problem occurred, please contact helpdesk",
- '40001018' => "A technical problem occurred, please try again.",
- '40001019' => "Sorry, an error occurred during processing. Please retry the operation (use back button of the browser). If problem persists, contact your merchant's helpdesk.",
- '40001020' => "Sorry, an error occurred during processing. Please retry the operation (use back button of the browser). If problem persists, contact your merchant's helpdesk.",
- '40001050' => "A technical problem occurred, please contact helpdesk",
- '40001133' => "Authentication failed, the signature of your bank access control server is incorrect",
- '40001134' => "Authentication failed, please retry or cancel.",
- '40001135' => "Authentication temporary unavailable, please retry or cancel.",
- '40001136' => "Technical problem with your browser, please retry or cancel",
- '40001137' => "Your bank access control server is temporary unavailable, please retry or cancel",
- '40001998' => "Temporary technical problem. Please retry a little bit later.",
- '50001001' => "Unknown card type",
- '50001002' => "Card number format check failed for given card number.",
- '50001003' => "Merchant data error",
- '50001004' => "Merchant identification missing",
- '50001005' => "Expiry date error",
- '50001006' => "Amount is not a number",
- '50001007' => "A technical problem occurred, please contact helpdesk",
- '50001008' => "A technical problem occurred, please contact helpdesk",
- '50001009' => "A technical problem occurred, please contact helpdesk",
- '50001010' => "A technical problem occurred, please contact helpdesk",
- '50001011' => "Brand not supported for that merchant",
- '50001012' => "A technical problem occurred, please contact helpdesk",
- '50001013' => "A technical problem occurred, please contact helpdesk",
- '50001014' => "A technical problem occurred, please contact helpdesk",
- '50001015' => "Invalid currency code",
- '50001016' => "A technical problem occurred, please contact helpdesk",
- '50001017' => "A technical problem occurred, please contact helpdesk",
- '50001018' => "A technical problem occurred, please contact helpdesk",
- '50001019' => "A technical problem occurred, please contact helpdesk",
- '50001020' => "A technical problem occurred, please contact helpdesk",
- '50001021' => "A technical problem occurred, please contact helpdesk",
- '50001022' => "A technical problem occurred, please contact helpdesk",
- '50001023' => "A technical problem occurred, please contact helpdesk",
- '50001024' => "A technical problem occurred, please contact helpdesk",
- '50001025' => "A technical problem occurred, please contact helpdesk",
- '50001026' => "A technical problem occurred, please contact helpdesk",
- '50001027' => "A technical problem occurred, please contact helpdesk",
- '50001028' => "A technical problem occurred, please contact helpdesk",
- '50001029' => "A technical problem occurred, please contact helpdesk",
- '50001030' => "A technical problem occurred, please contact helpdesk",
- '50001031' => "A technical problem occurred, please contact helpdesk",
- '50001032' => "A technical problem occurred, please contact helpdesk",
- '50001033' => "A technical problem occurred, please contact helpdesk",
- '50001034' => "A technical problem occurred, please contact helpdesk",
- '50001035' => "A technical problem occurred, please contact helpdesk",
- '50001036' => "Card length does not correspond to an acceptable value for the brand",
- '50001037' => "Purchasing card number for a regular merchant",
- '50001038' => "Non Purchasing card for a Purchasing card merchant",
- '50001039' => "Details sent for a non-Purchasing card merchant, please contact helpdesk",
- '50001040' => "Details not sent for a Purchasing card transaction, please contact helpdesk",
- '50001041' => "Payment detail validation failed",
- '50001042' => "Given transactions amounts (tax,discount,shipping,net,etc…) do not compute correctly together",
- '50001043' => "A technical problem occurred, please contact helpdesk",
- '50001044' => "No acquirer configured for this operation",
- '50001045' => "No UID configured for this operation",
- '50001046' => "Operation not allowed for the merchant",
- '50001047' => "A technical problem occurred, please contact helpdesk",
- '50001048' => "A technical problem occurred, please contact helpdesk",
- '50001049' => "A technical problem occurred, please contact helpdesk",
- '50001050' => "A technical problem occurred, please contact helpdesk",
- '50001051' => "A technical problem occurred, please contact helpdesk",
- '50001052' => "A technical problem occurred, please contact helpdesk",
- '50001053' => "A technical problem occurred, please contact helpdesk",
- '50001054' => "Card number incorrect or incompatible",
- '50001055' => "A technical problem occurred, please contact helpdesk",
- '50001056' => "A technical problem occurred, please contact helpdesk",
- '50001057' => "A technical problem occurred, please contact helpdesk",
- '50001058' => "A technical problem occurred, please contact helpdesk",
- '50001059' => "A technical problem occurred, please contact helpdesk",
- '50001060' => "A technical problem occurred, please contact helpdesk",
- '50001061' => "A technical problem occurred, please contact helpdesk",
- '50001062' => "A technical problem occurred, please contact helpdesk",
- '50001063' => "Card Issue Number does not correspond to range or not present",
- '50001064' => "Start Date not valid or not present",
- '50001066' => "Format of CVC code invalid",
- '50001067' => "The merchant is not enrolled for 3D-Secure",
- '50001068' => "The card number or account number (PAN) is invalid",
- '50001069' => "Invalid check for CardID and Brand",
- '50001070' => "The ECI value given is either not supported, or in conflict with other data in the transaction",
- '50001071' => "Incomplete TRN demat",
- '50001072' => "Incomplete PAY demat",
- '50001073' => "No demat APP",
- '50001074' => "Authorisation too old",
- '50001075' => "VERRes was an error message",
- '50001076' => "DCP amount greater than authorisation amount",
- '50001077' => "Details negative amount",
- '50001078' => "Details negative quantity",
- '50001079' => "Could not decode/decompress received PARes (3D-Secure)",
- '50001080' => "Received PARes was an erereor message from ACS (3D-Secure)",
- '50001081' => "Received PARes format was invalid according to the 3DS specifications (3D-Secure)",
- '50001082' => "PAReq/PARes reconciliation failure (3D-Secure)",
- '50001084' => "Maximum amount reached",
- '50001087' => "The transaction type requires authentication, please check with your bank.",
- '50001090' => "CVC missing at input, but CVC check asked",
- '50001091' => "ZIP missing at input, but ZIP check asked",
- '50001092' => "Address missing at input, but Address check asked",
- '50001095' => "Invalid date of birth",
- '50001096' => "Invalid commodity code",
- '50001097' => "The requested currency and brand are incompatible.",
- '50001111' => "Data validation error",
- '50001113' => "This order has already been processed",
- '50001114' => "Error pre-payment check page access",
- '50001115' => "Request not received in secure mode",
- '50001116' => "Unknown IP address origin",
- '50001117' => "NO IP address origin",
- '50001118' => "Pspid not found or not correct",
- '50001119' => "Password incorrect or disabled due to numbers of errors",
- '50001120' => "Invalid currency",
- '50001121' => "Invalid number of decimals for the currency",
- '50001122' => "Currency not accepted by the merchant",
- '50001123' => "Card type not active",
- '50001124' => "Number of lines don't match with number of payments",
- '50001125' => "Format validation error",
- '50001126' => "Overflow in data capture requests for the original order",
- '50001127' => "The original order is not in a correct status",
- '50001128' => "missing authorization code for unauthorized order",
- '50001129' => "Overflow in refunds requests",
- '50001130' => "Error access to original order",
- '50001131' => "Error access to original history item",
- '50001132' => "The Selected Catalog is empty",
- '50001133' => "Duplicate request",
- '50001134' => "Authentication failed, please retry or cancel.",
- '50001135' => "Authentication temporary unavailable, please retry or cancel.",
- '50001136' => "Technical problem with your browser, please retry or cancel",
- '50001137' => "Your bank access control server is temporary unavailable, please retry or cancel",
- '50001150' => "Fraud Detection, Technical error (IP not valid)",
- '50001151' => "Fraud detection => technical error (IPCTY unknown or error)",
- '50001152' => "Fraud detection => technical error (CCCTY unknown or error)",
- '50001153' => "Overflow in redo-authorisation requests",
- '50001170' => "Dynamic BIN check failed",
- '50001171' => "Dynamic country check failed",
- '50001172' => "Error in Amadeus signature",
- '50001174' => "Card Holder Name is too long",
- '50001175' => "Name contains invalid characters",
- '50001176' => "Card number is too long",
- '50001177' => "Card number contains non-numeric info",
- '50001178' => "Card Number Empty",
- '50001179' => "CVC too long",
- '50001180' => "CVC contains non-numeric info",
- '50001181' => "Expiration date contains non-numeric info",
- '50001182' => "Invalid expiration month",
- '50001183' => "Expiration date must be in the future",
- '50001184' => "SHA Mismatch",
- '50001205' => "Missing mandatory fields for billing address.",
- '50001206' => "Missing mandatory field date of birth.",
- '50001207' => "Missing required shopping basket details.",
- '50001208' => "Missing social security number",
- '50001209' => "Invalid country code",
- '50001210' => "Missing yearly salary",
- '50001211' => "Missing gender",
- '50001212' => "Missing email",
- '50001213' => "Missing IP address",
- '50001214' => "Missing part payment campaign ID",
- '50001215' => "Missing invoice number",
- '50001216' => "The alias must be different than the card number",
- '60000001' => "account number unknown",
- '60000003' => "not credited dd-mm-yy",
- '60000005' => "name/number do not correspond",
- '60000007' => "account number blocked",
- '60000008' => "specific direct debit block",
- '60000009' => "account number WKA",
- '60000010' => "administrative reason",
- '60000011' => "account number expired",
- '60000012' => "no direct debit authorisation given",
- '60000013' => "debit not approved",
- '60000014' => "double payment",
- '60000018' => "name/address/city not entered",
- '60001001' => "no original direct debit for revocation",
- '60001002' => "payer’s account number format error",
- '60001004' => "payer’s account at different bank",
- '60001005' => "payee’s account at different bank",
- '60001006' => "payee’s account number format error",
- '60001007' => "payer’s account number blocked",
- '60001008' => "payer’s account number expired",
- '60001009' => "payee’s account number expired",
- '60001010' => "direct debit not possible",
- '60001011' => "creditor payment not possible",
- '60001012' => "payer’s account number unknown WKA-number",
- '60001013' => "payee’s account number unknown WKA-number",
- '60001014' => "impermissible WKA transaction",
- '60001015' => "period for revocation expired",
- '60001017' => "reason for revocation not correct",
- '60001018' => "original run number not numeric",
- '60001019' => "payment ID incorrect",
- '60001020' => "amount not numeric",
- '60001021' => "amount zero not permitted",
- '60001022' => "negative amount not permitted",
- '60001023' => "payer and payee giro account number",
- '60001025' => "processing code (verwerkingscode) incorrect",
- '60001028' => "revocation not permitted",
- '60001029' => "guaranteed direct debit on giro account number",
- '60001030' => "NBC transaction type incorrect",
- '60001031' => "description too large",
- '60001032' => "book account number not issued",
- '60001034' => "book account number incorrect",
- '60001035' => "payer’s account number not numeric",
- '60001036' => "payer’s account number not eleven-proof",
- '60001037' => "payer’s account number not issued",
- '60001039' => "payer’s account number of DNB/BGC/BLA",
- '60001040' => "payee’s account number not numeric",
- '60001041' => "payee’s account number not eleven-proof",
- '60001042' => "payee’s account number not issued",
- '60001044' => "payee’s account number unknown",
- '60001050' => "payee’s name missing",
- '60001051' => "indicate payee’s bank account number instead of 3102",
- '60001052' => "no direct debit contract",
- '60001053' => "amount beyond bounds",
- '60001054' => "selective direct debit block",
- '60001055' => "original run number unknown",
- '60001057' => "payer’s name missing",
- '60001058' => "payee’s account number missing",
- '60001059' => "restore not permitted",
- '60001060' => "bank’s reference (navraaggegeven) missing",
- '60001061' => "BEC/GBK number incorrect",
- '60001062' => "BEC/GBK code incorrect",
- '60001087' => "book account number not numeric",
- '60001090' => "cancelled on request",
- '60001091' => "cancellation order executed",
- '60001092' => "cancelled instead of bended",
- '60001093' => "book account number is a shortened account number",
- '60001094' => "instructing party account number not identical with payer",
- '60001095' => "payee unknown GBK acceptor",
- '60001097' => "instructing party account number not identical with payee",
- '60001099' => "clearing not permitted",
- '60001101' => "payer’s account number not spaces",
- '60001102' => "PAN length not numeric",
- '60001103' => "PAN length outside limits",
- '60001104' => "track number not numeric",
- '60001105' => "track number not valid",
- '60001106' => "PAN sequence number not numeric",
- '60001107' => "domestic PAN not numeric",
- '60001108' => "domestic PAN not eleven-proof",
- '60001109' => "domestic PAN not issued",
- '60001110' => "foreign PAN not numeric",
- '60001111' => "card valid date not numeric",
- '60001112' => "book period number (boekperiodenr) not numeric",
- '60001113' => "transaction number not numeric",
- '60001114' => "transaction time not numeric",
- '60001115' => "transaction no valid time",
- '60001116' => "transaction date not numeric",
- '60001117' => "transaction no valid date",
- '60001118' => "STAN not numeric",
- '60001119' => "instructing party’s name missing",
- '60001120' => "foreign amount (bedrag-vv) not numeric",
- '60001122' => "rate (verrekenkoers) not numeric",
- '60001125' => "number of decimals (aantaldecimalen) incorrect",
- '60001126' => "tariff (tarifering) not B/O/S",
- '60001127' => "domestic costs (kostenbinnenland) not numeric",
- '60001128' => "domestic costs (kostenbinnenland) not higher than zero",
- '60001129' => "foreign costs (kostenbuitenland) not numeric",
- '60001130' => "foreign costs (kostenbuitenland) not higher than zero",
- '60001131' => "domestic costs (kostenbinnenland) not zero",
- '60001132' => "foreign costs (kostenbuitenland) not zero",
- '60001134' => "Euro record not fully filled in",
- '60001135' => "Client currency incorrect",
- '60001136' => "Amount NLG not numeric",
- '60001137' => "Amount NLG not higher than zero",
- '60001138' => "Amount NLG not equal to Amount",
- '60001139' => "Amount NLG incorrectly converted",
- '60001140' => "Amount EUR not numeric",
- '60001141' => "Amount EUR not greater than zero",
- '60001142' => "Amount EUR not equal to Amount",
- '60001143' => "Amount EUR incorrectly converted",
- '60001144' => "Client currency not NLG",
- '60001145' => "rate euro-vv (Koerseuro-vv) not numeric",
- '60001146' => "comma rate euro-vv (Kommakoerseuro-vv) incorrect",
- '60001147' => "acceptgiro distributor not valid",
- '60001148' => "Original run number and/or BRN are missing",
- '60001149' => "Amount/Account number/ BRN different",
- '60001150' => "Direct debit already revoked/restored",
- '60001151' => "Direct debit already reversed/revoked/restored",
- '60001153' => "Payer’s account number not known",
- ];
-
/**
* @var ConnectorInterface
*/
@@ -639,7 +161,9 @@ class IngenicoCoreLibrary implements
*/
private $configuration;
- /** @var LoggerInterface */
+ /**
+ * @var Logger
+ */
private $logger;
/**
@@ -647,11 +171,6 @@ class IngenicoCoreLibrary implements
*/
private $request;
- /**
- * @var Translator
- */
- private $translator;
-
/**
* @var string
*/
@@ -724,7 +243,7 @@ class IngenicoCoreLibrary implements
*/
public function __construct(ConnectorInterface $extension)
{
- $this->logger = new \Psr\Log\NullLogger();
+ $this->logger = new Logger(new FileAdapter(['file' => sys_get_temp_dir() . '/ingenico_core.log']));
$this->extension = $extension;
// Initialize settings
@@ -733,33 +252,6 @@ public function __construct(ConnectorInterface $extension)
$this->request = new Request($_REQUEST);
- // Initialize translations
- $locale = $this->extension->getLocale();
- $this->translator = new Translator($locale);
- $this->translator->addLoader('po', new PoFileLoader());
- $this->translator->setFallbackLocales(['en_US']);
- $this->translator->setLocale($locale);
-
- // Load translations
- $directory = __DIR__ . '/../translations';
- $files = scandir($directory);
- foreach ($files as $file) {
- $file = $directory . DIRECTORY_SEPARATOR . $file;
- $info = pathinfo($file);
- if ($info['extension'] !== 'po') {
- continue;
- }
-
- $filename = $info['filename'];
- list($domain, $locale) = explode('.', $filename);
- $this->translator->addResource(
- 'po',
- $directory . DIRECTORY_SEPARATOR . $info['basename'],
- $locale,
- $domain
- );
- }
-
// Load environment
$env = parse_ini_file(__DIR__ . '/../environments.ini', true);
$environment = $env[$extension->getPlatformEnvironment()];
@@ -791,27 +283,38 @@ public function __construct(ConnectorInterface $extension)
/**
* Gets Logger.
+ * @deprecated
*
- * @return LoggerInterface|null
+ * @return null
*/
public function getLogger()
{
- return $this->logger;
+ return null;
}
/**
* Sets Logger.
*
- * @param LoggerInterface|null $logger
+ * @param AdapterInterface $logger
*
* @return $this
*/
- public function setLogger(LoggerInterface $logger = null)
+ public function setLogger($logger)
{
- if ($logger) {
- $this->logger = $logger;
+ if (interface_exists('\Psr\Log\LoggerInterface') &&
+ $logger instanceof \Psr\Log\LoggerInterface
+ ) {
+ $this->logger = new Logger(
+ new MonologAdapter(['logger' => $logger])
+ );
}
+ if (!$logger instanceof AdapterInterface) {
+ throw new \Exception('Argument $logger must be instance of AdapterInterface.');
+ }
+
+ $this->logger = new Logger($logger);
+
return $this;
}
@@ -826,7 +329,46 @@ public function setLogger(LoggerInterface $logger = null)
*/
public function __($id, array $parameters = [], $domain = null, $locale = null)
{
- return $this->translator->trans($id, $parameters, $domain, $locale);
+ if (!$locale) {
+ $locale = 'en_US';
+ }
+
+ if (!$domain) {
+ $domain = 'messages';
+ }
+
+ // Get current locale
+ $currentLocale = setlocale(LC_MESSAGES, 0);
+
+ putenv('LC_MESSAGES=' . $locale);
+ $result = setlocale(LC_MESSAGES, $locale);
+ if (!$result && !stristr(PHP_OS, 'WIN')) {
+ // Unable to set locale, so unable to use gettext
+ // Use failback mode
+ $message = $id;
+ $messages = $this->getAllTranslations($locale, $domain);
+ if (isset($messages[$id])) {
+ $message = $messages[$id];
+ }
+ } else {
+ bindtextdomain($domain, realpath(__DIR__ . '/../translations'));
+ bind_textdomain_codeset($domain, 'UTF-8');
+ textdomain($domain);
+
+ // Translate
+ $message = gettext($id);
+
+ // Set previous locale
+ putenv('LC_MESSAGES=' . $currentLocale);
+ setlocale(LC_ALL, $currentLocale);
+ }
+
+ if (count($parameters) > 0) {
+ // Format
+ $message = str_replace(array_keys($parameters), array_values($parameters), $id);
+ }
+
+ return $message;
}
/**
@@ -839,16 +381,57 @@ public function __($id, array $parameters = [], $domain = null, $locale = null)
public function getAllTranslations($locale, $domain = null)
{
if (!$domain) {
- $result = [];
- $catalogue = $this->translator->getCatalogue($locale)->all();
- foreach ($catalogue as $domain => $translations) {
- $result = array_merge($result, $translations);
+ $translations = [];
+
+ // Scan po files
+ $domains = glob(__DIR__ . '/../translations/' . $locale . '/LC_MESSAGES/*.po');
+ foreach ($domains as $domain) {
+ $domain = basename($domain, '.po');
+ $translations = array_merge(
+ $translations,
+ $this->getAllTranslations($locale, $domain)
+ );
}
- return $result;
+ return $translations;
+ }
+
+ // Parse po file and extract translations
+ $messages = [];
+ $file = __DIR__ . '/../translations/' . $locale . '/LC_MESSAGES/' . $domain . '.po';
+ if (!file_exists($file)) {
+ return $messages;
+ }
+
+ $id = null;
+ $stream = fopen($file, 'r');
+ while ($line = fgets($stream)) {
+ $line = trim($line);
+
+ if ('' === $line) {
+ // Skip it
+ } elseif ('#,' === substr($line, 0, 2)) {
+ // Skip it
+ } elseif ('msgid "' === substr($line, 0, 7)) {
+ $id = substr($line, 7, -1);
+ } elseif ('msgstr "' === substr($line, 0, 8)) {
+ if ($id) {
+ $messages[$id] = substr($line, 8, -1);
+ }
+
+ $id = null;
+ } elseif ('"' === $line[0]) {
+ // Skip it
+ } elseif ('msgid_plural "' === substr($line, 0, 14)) {
+ // Skip it
+ } elseif ('msgstr[' === substr($line, 0, 7)) {
+ // Skip it
+ }
}
- return $this->translator->getCatalogue($locale)->all($domain);
+ fclose($stream);
+
+ return $messages;
}
/**
@@ -859,8 +442,13 @@ public function getAllTranslations($locale, $domain = null)
*/
public static function getErrorDescription($errorCode)
{
- if (isset(self::$errorCodes[$errorCode])) {
- return self::$errorCodes[$errorCode];
+ $errorCodes = json_decode(
+ file_get_contents(__DIR__ . '/../error-codes.json'),
+ true
+ );
+
+ if (isset($errorCodes[$errorCode])) {
+ return $errorCodes[$errorCode];
}
return 'Unknown';
@@ -1835,7 +1423,7 @@ private function getInlinePaymentMethods($orderId, Alias $alias)
public function getPaymentInfo($orderId, $payId = null, $payIdSub = null)
{
$directLink = new DirectLink();
- $directLink->setLogger($this->getLogger());
+ $directLink->setLogger($this->logger);
$paymentResult = $directLink->createStatusRequest($this->configuration, $orderId, $payId, $payIdSub);
if ($paymentResult) {
@@ -2823,7 +2411,7 @@ public function cancel($orderId, $payId = null, $amount = null)
}
$directLink = new DirectLink();
- $directLink->setLogger($this->getLogger());
+ $directLink->setLogger($this->logger);
$response = $directLink->createVoid($this->configuration, $orderId, $payId, $amount, $isPartially);
if (!$response->isTransactionSuccessful()) {
@@ -2870,7 +2458,7 @@ public function capture($orderId, $payId = null, $amount = null)
}
$directLink = new DirectLink();
- $directLink->setLogger($this->getLogger());
+ $directLink->setLogger($this->logger);
$response = $directLink->createCapture($this->configuration, $orderId, $payId, $amount, $isPartially);
if (!$response->isTransactionSuccessful()) {
@@ -2917,7 +2505,7 @@ public function refund($orderId, $payId = null, $amount = null)
}
$directLink = new DirectLink();
- $directLink->setLogger($this->getLogger());
+ $directLink->setLogger($this->logger);
$response = $directLink->createRefund($this->configuration, $orderId, $payId, $amount, $isPartially);
if (!$response->isTransactionSuccessful()) {
diff --git a/src/IngenicoCoreLibraryInterface.php b/src/IngenicoCoreLibraryInterface.php
index 0e98970..2e4c2b2 100644
--- a/src/IngenicoCoreLibraryInterface.php
+++ b/src/IngenicoCoreLibraryInterface.php
@@ -2,8 +2,8 @@
namespace IngenicoClient;
+use IngenicoClient\Logger\AdapterInterface;
use Ogone\Ecommerce\EcommercePaymentRequest;
-use Psr\Log\LoggerInterface;
interface IngenicoCoreLibraryInterface
{
@@ -666,16 +666,9 @@ public function cronHandler();
/**
* Set Logger.
*
- * @param LoggerInterface $logger
+ * @param Logger $logger
*
* @return $this
*/
- public function setLogger(LoggerInterface $logger = null);
-
- /**
- * Gets Logger.
- *
- * @return LoggerInterface|null
- */
- public function getLogger();
+ public function setLogger($logger);
}
diff --git a/src/Logger.php b/src/Logger.php
new file mode 100644
index 0000000..7bf29c7
--- /dev/null
+++ b/src/Logger.php
@@ -0,0 +1,130 @@
+adapter = $adapter;
+ }
+
+ /**
+ * Logs with emergency level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function emergency($message, array $context = [])
+ {
+ $this->log(self::EMERGENCY, $message, $context);
+ }
+
+ /**
+ * Logs with error level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function alert($message, array $context = [])
+ {
+ $this->log(self::ALERT, $message, $context);
+ }
+
+ /**
+ * Logs with critical level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function critical($message, array $context = [])
+ {
+ $this->log(self::CRITICAL, $message, $context);
+ }
+
+ /**
+ * Logs with error level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function error($message, array $context = [])
+ {
+ $this->log(self::ERROR, $message, $context);
+ }
+
+ /**
+ * Logs with warning level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function warning($message, array $context = [])
+ {
+ $this->log(self::WARNING, $message, $context);
+ }
+
+ /**
+ * Logs with notice level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function notice($message, array $context = [])
+ {
+ $this->log(self::NOTICE, $message, $context);
+ }
+
+ /**
+ * Logs with info level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function info($message, array $context = [])
+ {
+ $this->log(self::INFO, $message, $context);
+ }
+
+ /**
+ * Logs with debug level.
+ *
+ * @param string $message
+ * @param array $context
+ */
+ public function debug($message, array $context = [])
+ {
+ $this->log(self::DEBUG, $message, $context);
+ }
+
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string $message
+ * @param array $context
+ */
+ public function log($level, $message, array $context = [])
+ {
+ $this->adapter->log($level, $message, $context);
+ }
+}
\ No newline at end of file
diff --git a/src/Logger/AdapterInterface.php b/src/Logger/AdapterInterface.php
new file mode 100644
index 0000000..83c4d29
--- /dev/null
+++ b/src/Logger/AdapterInterface.php
@@ -0,0 +1,15 @@
+file = $options['file'];
+ } else {
+ $this->file = sys_get_temp_dir() . '/ingenico_core.log';
+ }
+ }
+
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string $message
+ * @param array $context
+ */
+ public function log($level, $message, array $context = [])
+ {
+ if ($this->file) {
+ $message = sprintf(
+ '[%s] %s %s %s',
+ date('Y-m-d H:i:s'),
+ $level,
+ $message,
+ count($context) > 0 ? var_export($context, true) : ''
+ );
+
+ file_put_contents($this->file, $message . "\n", FILE_APPEND);
+ }
+ }
+}
diff --git a/src/Logger/MonologAdapter.php b/src/Logger/MonologAdapter.php
new file mode 100644
index 0000000..f11c016
--- /dev/null
+++ b/src/Logger/MonologAdapter.php
@@ -0,0 +1,37 @@
+logger = $options['logger'];
+ }
+ }
+
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string $message
+ * @param array $context
+ */
+ public function log($level, $message, array $context = [])
+ {
+ if ($this->logger) {
+ $this->logger->log($level, $message, $context);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Logger/NullAdapter.php b/src/Logger/NullAdapter.php
new file mode 100644
index 0000000..4ddbca7
--- /dev/null
+++ b/src/Logger/NullAdapter.php
@@ -0,0 +1,19 @@
+__('exceptions.access_denied', [], 'messages', 'en_US');
+ $this->assertEquals('Access denied.', $result);
+ }
+
+ public function testLogAdapter()
+ {
+ $logFile = sys_get_temp_dir() . '/ingenico_core.log';
+
+ $adapter = new FileAdapter(['file' => $logFile]);
+ $this->assertInstanceOf(AdapterInterface::class, $adapter);
+
+ $logger = new Logger($adapter);
+ $this->assertInstanceOf(Logger::class, $logger);
+
+ $logger->log($logger::INFO, 'Test');
+ $this->assertEquals(true, file_exists($logFile));
+
+ $logger->emergency('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::EMERGENCY) !== false);
+
+ $logger->alert('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::ALERT) !== false);
+
+ $logger->critical('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::CRITICAL) !== false);
+
+ $logger->error('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::ERROR) !== false);
+
+ $logger->warning('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::WARNING) !== false);
+
+ $logger->notice('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::NOTICE) !== false);
+
+ $logger->info('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::INFO) !== false);
+
+ $logger->debug('Test');
+ $this->assertEquals(true, stripos(file_get_contents($logFile), $logger::DEBUG) !== false);
+
+ $adapter = new MonologAdapter(['logger' => null]);
+ $this->assertInstanceOf(AdapterInterface::class, $adapter);
+ $this->assertNull($adapter->log($logger::INFO, 'Test'));
+
+ return $this;
+ }
+
+ public function testErrorDescription()
+ {
+ $result = IngenicoCoreLibrary::getErrorDescription('0050001005');
+ $this->assertEquals('Expiry date error', $result);
+
+ $result = IngenicoCoreLibrary::getErrorDescription('WRONG');
+ $this->assertEquals('Unknown', $result);
+ }
+}
diff --git a/tests/TestConnector.php b/tests/TestConnector.php
new file mode 100644
index 0000000..5fb9f88
--- /dev/null
+++ b/tests/TestConnector.php
@@ -0,0 +1,1054 @@
+mode = $this->requestSettingsMode() ? 'live' : 'test';
+ }
+
+ /**
+ * Returns Shopping Cart Extension Id.
+ *
+ * @return string
+ */
+ public function requestShoppingCartExtensionId()
+ {
+ return sprintf(
+ 'TEST_APP%sV%s',
+ str_replace('.', '', '1.0.0'),
+ str_replace('.', '', '1.0.0')
+ );
+ }
+
+ /**
+ * Returns activated Ingenico environment mode.
+ * False for Test (transactions will go through the Ingenico sandbox).
+ * True for Live (transactions will be real).
+ *
+ * @return bool
+ */
+ public function requestSettingsMode()
+ {
+ // Always should be Test mode
+ return false;
+ }
+
+ /**
+ * Returns the complete list of all settings as an array.
+ *
+ * @param bool $mode False for Test. True for Live.
+ *
+ * @return array
+ */
+ public function requestSettings($mode)
+ {
+ return \IngenicoClient\Configuration::getDefault();
+ }
+
+ /**
+ * Returns an array with the order details in a standardised way for all connectors.
+ * Matches platform specific fields to the fields that are understood by the CL.
+ *
+ * @param mixed $orderId
+ * @return array
+ */
+ public function requestOrderInfo($orderId = null)
+ {
+ // Get order items
+ $items = [];
+ $items[] = [
+ OrderItem::ITEM_TYPE => OrderItem::TYPE_PRODUCT,
+ OrderItem::ITEM_ID => 'test',
+ OrderItem::ITEM_NAME => 'Test name',
+ OrderItem::ITEM_DESCRIPTION => 'Test description',
+ OrderItem::ITEM_UNIT_PRICE => 125,
+ OrderItem::ITEM_QTY => 1,
+ OrderItem::ITEM_UNIT_VAT => 25,
+ OrderItem::ITEM_VATCODE => 25,
+ OrderItem::ITEM_VAT_INCLUDED => 1 // VAT included
+ ];
+
+ // @codingStandardsIgnoreStart
+ return [
+ OrderField::ORDER_ID => $this->requestOrderId(),
+ OrderField::PAY_ID => $this->getIngenicoPayIdByOrderId($this->requestOrderId()),
+ OrderField::AMOUNT => 125,
+ OrderField::TOTAL_CAPTURED => 0,
+ OrderField::TOTAL_REFUNDED => 0,
+ OrderField::TOTAL_CANCELLED => 0,
+ OrderField::CURRENCY => 'EUR',
+ OrderField::STATUS => IngenicoCoreLibrary::STATUS_AUTHORIZED,
+ OrderField::CREATED_AT => (new \DateTime())->format('Y-m-d H:i:s'), // Y-m-d H:i:s
+ OrderField::BILLING_CUSTOMER_TITLE => 'Mr.',
+ OrderField::BILLING_COUNTRY => 'France',
+ OrderField::BILLING_COUNTRY_CODE => 'FR',
+ OrderField::BILLING_ADDRESS1 => '74 rue de la Mare aux Carats',
+ OrderField::BILLING_ADDRESS2 => null,
+ OrderField::BILLING_ADDRESS3 => null,
+ OrderField::BILLING_STREET_NUMBER => null,
+ OrderField::BILLING_CITY => 'Montpellier',
+ OrderField::BILLING_STATE => 'Languedoc-Roussillon',
+ OrderField::BILLING_POSTCODE => '34070',
+ OrderField::BILLING_PHONE => '0440575930',
+ OrderField::BILLING_EMAIL => 'test@example.com',
+ OrderField::BILLING_FIRST_NAME => 'Test',
+ OrderField::BILLING_LAST_NAME => 'Test',
+ OrderField::BILLING_FAX => null,
+ OrderField::IS_SHIPPING_SAME => false,
+ OrderField::SHIPPING_CUSTOMER_TITLE => 'Mr.',
+ OrderField::SHIPPING_COUNTRY => 'France',
+ OrderField::SHIPPING_COUNTRY_CODE => 'FR',
+ OrderField::SHIPPING_ADDRESS1 => '74 rue de la Mare aux Carats',
+ OrderField::SHIPPING_ADDRESS2 => null,
+ OrderField::SHIPPING_ADDRESS3 => null,
+ OrderField::SHIPPING_STREET_NUMBER => null,
+ OrderField::SHIPPING_CITY => 'Montpellier',
+ OrderField::SHIPPING_STATE => 'Languedoc-Roussillon',
+ OrderField::SHIPPING_POSTCODE => '34070',
+ OrderField::SHIPPING_PHONE => '0440575930',
+ OrderField::SHIPPING_EMAIL => 'test@example.com',
+ OrderField::SHIPPING_FIRST_NAME => 'Test',
+ OrderField::SHIPPING_LAST_NAME => 'Test',
+ OrderField::SHIPPING_FAX => null,
+ OrderField::CUSTOMER_ID => 1,
+ OrderField::CUSTOMER_IP => '127.0.0.1',
+ OrderField::CUSTOMER_DOB => (new \DateTime(strtotime('-20 years')))->getTimestamp(), //null or timestamp
+ OrderField::IS_VIRTUAL => false,
+ OrderField::ITEMS => $items,
+ OrderField::LOCALE => 'en_US',
+ OrderField::SHIPPING_METHOD => 'Standard delivery',
+ OrderField::SHIPPING_AMOUNT => 125,
+ OrderField::SHIPPING_TAX_AMOUNT => 25,
+ OrderField::SHIPPING_TAX_CODE => 25,
+ OrderField::COMPANY_NAME => '',
+ OrderField::COMPANY_VAT => null,
+ OrderField::CHECKOUT_TYPE => \IngenicoClient\Checkout::TYPE_B2C,
+ OrderField::SHIPPING_COMPANY => 'One day shipping',
+ OrderField::CUSTOMER_CIVILITY => null,
+ OrderField::CUSTOMER_GENDER => 'M', // M or F or null
+ OrderField::ADDITIONAL_DATA => []
+ ];
+ // @codingStandardsIgnoreEnd
+ }
+
+ /**
+ * Same As requestOrderInfo()
+ * But Order Object Cannot Be Used To Fetch The Required Info
+ *
+ * @param mixed $reservedOrderId
+ * @return array
+ */
+ public function requestOrderInfoBeforePlaceOrder($reservedOrderId)
+ {
+ return $this->requestOrderInfo(1);
+ }
+
+ /**
+ * Save Platform's setting (key-value couple depending on the mode).
+ *
+ * @param bool $mode
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ * @SuppressWarnings("all")
+ */
+ public function saveSetting($mode, $key, $value)
+ {
+ //
+ }
+
+ /**
+ * Retrieves orderId from checkout session.
+ *
+ * @return mixed
+ */
+ public function requestOrderId()
+ {
+ return uniqid('test_');
+ }
+
+ /**
+ * Retrieves Customer (buyer) ID on the platform side.
+ * Zero for guests.
+ * Needed for retrieving customer aliases (if saved any).
+ *
+ * @return int
+ */
+ public function requestCustomerId()
+ {
+ return 1; // Logged-in user
+ }
+
+ /**
+ * Returns callback URLs where Ingenico must call after the payment processing. Depends on the context of the callback.
+ * Following cases are required:
+ * CONTROLLER_TYPE_PAYMENT
+ * CONTROLLER_TYPE_SUCCESS
+ * CONTROLLER_TYPE_ORDER_SUCCESS
+ * CONTROLLER_TYPE_ORDER_CANCELLED
+ *
+ * @param $type
+ * @param array $params
+ * @return string
+ */
+ public function buildPlatformUrl($type, array $params = [])
+ {
+ switch ($type) {
+ case IngenicoCoreLibrary::CONTROLLER_TYPE_PAYMENT:
+ return 'https://example.com?act=ingenico_payment';
+ case IngenicoCoreLibrary::CONTROLLER_TYPE_SUCCESS:
+ return 'https://example.com?act=ingenico_success';
+ case IngenicoCoreLibrary::CONTROLLER_TYPE_ORDER_SUCCESS:
+ return 'https://example.com?act=checkout_success';
+ case IngenicoCoreLibrary::CONTROLLER_TYPE_ORDER_CANCELLED:
+ return 'https://example.com?act=ingenico_cancel';
+ default:
+ throw new \Exception('Unknown page type.');
+ }
+ }
+
+ /**
+ * This method is a generic callback gate.
+ * Depending on the URI it redirects to the corresponding action which is done already on the CL level.
+ * CL takes responsibility for the data processing and initiates rendering of the matching GUI (template, page etc.).
+ *
+ * @return void
+ */
+ public function processSuccessUrls()
+ {
+ //
+ }
+
+ /**
+ * Executed on the moment when a buyer submits checkout form with an intention to start the payment process.
+ * Depending on the payment mode (Inline vs. Redirect) CL will initiate the right processes and render the corresponding GUI.
+ *
+ * @return void
+ */
+ public function processPayment()
+ {
+ //
+ }
+
+ /**
+ * Executed on the moment when customer's alias saved, and we're should charge payment.
+ * Used in Inline payment mode.
+ *
+ * @return array
+ */
+ public function finishReturnInline()
+ {
+ //
+ }
+
+ /**
+ * Matches Ingenico payment statuses to the platform's order statuses.
+ *
+ * @param mixed $orderId
+ * @param string $paymentStatus
+ * @param string|null $message
+ * @return void
+ * @throws \Exception
+ */
+ public function updateOrderStatus($orderId, $paymentStatus, $message = null)
+ {
+ //
+ }
+
+ /**
+ * Check if Shopping Cart has orders that were paid (via other payment integrations, i.e. PayPal module)
+ * It's to cover the case where payment was initiated through Ingenico but at the end, user went back and paid by other
+ * payment provider. In this case we know not to send order reminders etc.
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function isCartPaid($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Sends an e-mail using platform's email engine.
+ *
+ * @param \IngenicoClient\MailTemplate $template
+ * @param string $to
+ * @param string $toName
+ * @param string $from
+ * @param string $fromName
+ * @param string $subject
+ * @param array $attachedFiles Array like [['name' => 'attached.txt', 'mime' => 'plain/text', 'content' => 'Body']]
+ * @return bool|int
+ * @throws \Exception
+ */
+ public function sendMail(
+ $template,
+ $to,
+ $toName,
+ $from,
+ $fromName,
+ $subject,
+ array $attachedFiles = []
+ ) {
+ if (!$template instanceof \IngenicoClient\MailTemplate) {
+ throw new \Exception('Template variable must be instance of MailTemplate');
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the platform's actual locale code.
+ * Returns code in a format: en_US.
+ *
+ * @param int|null $orderId
+ * @return string
+ */
+ public function getLocale($orderId = null)
+ {
+ // Obtain customer locale by Order
+ return 'en_US';
+ }
+
+ /**
+ * Adds cancelled amount to the order which is used for identifying full or partial operation.
+ *
+ * @param $orderId
+ * @param $canceledAmount
+ * @return void
+ */
+ public function addCancelledAmount($orderId, $canceledAmount)
+ {
+ //
+ }
+
+ /**
+ * Adds captured amount to the order which is used for identifying full or partial operation.
+ *
+ * @param $orderId
+ * @param $capturedAmount
+ * @return void
+ */
+ public function addCapturedAmount($orderId, $capturedAmount)
+ {
+ //
+ }
+
+ /**
+ * Adds refunded amount to the order which is used for identifying full or partial operation.
+ *
+ * @param $orderId
+ * @param $refundedAmount
+ * @return void
+ */
+ public function addRefundedAmount($orderId, $refundedAmount)
+ {
+ //
+ }
+
+ /**
+ * Send "Order paid" email to the buyer (customer).
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendOrderPaidCustomerEmail($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Send "Order paid" email to the merchant.
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendOrderPaidAdminEmail($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Send "Payment Authorized" email to the buyer (customer).
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendNotificationAuthorization($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Send "Payment Authorized" email to the merchant.
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendNotificationAdminAuthorization($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Sends payment reminder email to the buyer (customer).
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendReminderNotificationEmail($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Send "Refund failed" email to the buyer (customer).
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendRefundFailedCustomerEmail($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Send "Refund failed" email to the merchant.
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function sendRefundFailedAdminEmail($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Send "Request Support" email to Ingenico Support
+ * @param $email
+ * @param $subject
+ * @param array $fields
+ * @param null $file
+ * @return bool
+ * @throws Exception
+ */
+ public function sendSupportEmail(
+ $email,
+ $subject,
+ array $fields = [],
+ $file = null
+ ) {
+ return true;
+ }
+
+
+ /**
+ * Returns categories of the payment methods.
+ *
+ * @return array
+ */
+ public function getPaymentCategories()
+ {
+ return [];
+ }
+
+ /**
+ * Returns all payment methods with the indicated category
+ *
+ * @param $category
+ * @return array
+ */
+ public function getPaymentMethodsByCategory($category)
+ {
+ return [];
+ }
+
+ /**
+ * Returns all supported countries with their popular payment methods mapped
+ * Returns array like ['DE' => 'Germany']
+ *
+ * @return array
+ */
+ public function getAllCountries()
+ {
+ return [];
+ }
+
+ /**
+ * Get Country by Code.
+ *
+ * @param $code
+ * @return string|false
+ */
+ public function getCountryByCode($code)
+ {
+ return $code;
+ }
+
+ /**
+ * Returns all payment methods as PaymentMethod objects.
+ *
+ * @return array
+ */
+ public function getPaymentMethods()
+ {
+ return [];
+ }
+
+ /**
+ * Get Unused Payment Methods (not selected ones).
+ * Returns an array with PaymentMethod objects.
+ * Used in the modal window in the plugin Settings in order to list Payment methods that are not yet added.
+ *
+ * @return array
+ */
+ public function getUnusedPaymentMethods()
+ {
+ return [];
+ }
+
+ /**
+ * Filters countries based on the search string.
+ *
+ * @param $query
+ * @param $selected_countries array of selected countries iso codes
+ * @return array
+ */
+ public function filterCountries($query, $selected_countries)
+ {
+ return [];
+ }
+
+ /**
+ * Filters payment methods based on the search string.
+ *
+ * @param $query
+ * @return array
+ */
+ public function filterPaymentMethods($query)
+ {
+ return [];
+ }
+
+ /**
+ * Retrieves payment method by Brand value.
+ *
+ * @param $brand
+ * @return PaymentMethod|false
+ */
+ public function getPaymentMethodByBrand($brand)
+ {
+ //return $this->coreLibrary->getPaymentMethodByBrand($brand);
+ }
+
+ /**
+ * Save Payment data.
+ * This data helps to avoid constant pinging of Ingenico to get PAYID and other information
+ *
+ * @param $orderId
+ * @param \IngenicoClient\Payment $data
+ *
+ * @return bool
+ */
+ public function logIngenicoPayment($orderId, \IngenicoClient\Payment $data)
+ {
+ return true;
+ }
+
+ /**
+ * Retrieves payment log for the specified order ID.
+ *
+ * @param $orderId
+ *
+ * @return \IngenicoClient\Payment
+ */
+ public function getIngenicoPaymentLog($orderId)
+ {
+ return new \IngenicoClient\Payment([]);
+ }
+
+ /**
+ * Retrieves payment log entry by the specified Pay ID (PAYID).
+ *
+ * @param $payId
+ *
+ * @return \IngenicoClient\Payment
+ */
+ public function getIngenicoPaymentById($payId)
+ {
+ return new \IngenicoClient\Payment([]);
+ }
+
+ /**
+ * Retrieves Ingenico Pay ID by the specified platform order ID.
+ *
+ * @param $orderId
+ * @return string|false
+ */
+ public function getIngenicoPayIdByOrderId($orderId)
+ {
+ return false;
+ }
+
+ /**
+ * Retrieves buyer (customer) aliases by the platform's customer ID.
+ *
+ * @param $customerId
+ * @return array
+ */
+ public function getCustomerAliases($customerId)
+ {
+ return [];
+ }
+
+ /**
+ * Retrieves an Alias object with the fields as an array by the Alias ID (platform's entity identifier).
+ * Fields list: alias_id, customer_id, ALIAS, ED, BRAND, CARDNO, BIN, PM.
+ *
+ * @param $aliasId
+ * @return array|false
+ */
+ public function getAlias($aliasId)
+ {
+ return false;
+ }
+
+ /**
+ * Saves the buyer (customer) Alias entity.
+ * Important fields that are provided by Ingenico: ALIAS, BRAND, CARDNO, BIN, PM, ED.
+ *
+ * @param int $customerId
+ * @param array $data
+ * @return bool
+ */
+ public function saveAlias($customerId, array $data)
+ {
+ return true;
+ }
+
+ /**
+ * Delegates cron jobs handling to the CL.
+ *
+ * @return void
+ */
+ public function cronHandler()
+ {
+ $this->coreLibrary->cronHandler();
+ }
+
+ /**
+ * Retrieves the list of orders that have no payment status at all or have an error payment status.
+ * Used for the cron job that is proactively updating orders statuses.
+ * Returns an array with order IDs.
+ *
+ * @return array
+ */
+ public function getNonactualisedOrdersPaidWithIngenico()
+ {
+ return [];
+ }
+
+ /**
+ * Sets PaymentStatus.Actualised Flag.
+ * Used for the cron job that is proactively updating orders statuses.
+ *
+ * @param $orderId
+ * @param bool $value
+ * @return bool
+ */
+ public function setIsPaymentStatusActualised($orderId, $value)
+ {
+ return true;
+ }
+
+ /**
+ * Checks if PaymentStatus is actualised (up to date)
+ *
+ * @param $orderId
+ * @return bool
+ */
+ private function isPaymentStatusActualised($orderId)
+ {
+ return true;
+ }
+
+ /**
+ * Retrieves the list of orders for the reminder email.
+ *
+ * @return array
+ */
+ public function getPendingReminders()
+ {
+ return [];
+ }
+
+ /**
+ * Sets order reminder flag as "Sent".
+ *
+ * @param $orderId
+ *
+ * @return void
+ */
+ public function setReminderSent($orderId)
+ {
+ //
+ }
+
+ /**
+ * Enqueues the reminder for the specified order.
+ * Used for the cron job that is sending payment reminders.
+ *
+ * @param mixed $orderId
+ * @return void
+ */
+ public function enqueueReminder($orderId)
+ {
+ //
+ }
+
+ /**
+ * Retrieves the list of orders that are candidates for the reminder email.
+ * Returns an array with orders IDs.
+ *
+ * @return array
+ */
+ public function getOrdersForReminding()
+ {
+ return [];
+ }
+
+ /**
+ * Delegates to the CL the complete processing of the onboarding data and dispatching email to the corresponding
+ * Ingenico sales representative.
+ *
+ * @param string $companyName
+ * @param string $email
+ * @param string $countryCode
+ *
+ * @throws \IngenicoClient\Exception
+ */
+ public function submitOnboardingRequest($companyName, $email, $countryCode)
+ {
+ //
+ }
+
+ /**
+ * Renders page with Inline's Loader template.
+ * This template should include code that allow charge payment asynchronous.
+ *
+ * @param array $fields
+ * @return void
+ */
+ public function showInlineLoaderTemplate(array $fields)
+ {
+ //
+ }
+
+ /**
+ * Renders the template of the payment success page.
+ *
+ * @param array $fields
+ * @param Payment $payment
+ *
+ * @return void
+ */
+ public function showSuccessTemplate(array $fields, Payment $payment)
+ {
+ //
+ }
+
+ /**
+ * Renders the template with 3Ds Security Check.
+ *
+ * @param array $fields
+ * @param Payment $payment
+ *
+ * @return void
+ */
+ public function showSecurityCheckTemplate(array $fields, Payment $payment)
+ {
+ //
+ }
+
+ /**
+ * Renders the template with the order cancellation.
+ *
+ * @param array $fields
+ * @param Payment $payment
+ *
+ * @return void
+ */
+ public function showCancellationTemplate(array $fields, Payment $payment)
+ {
+ //
+ }
+
+ /**
+ * Renders the template with the payment error.
+ *
+ * @param array $fields
+ * @param Payment $payment
+ *
+ * @return void
+ */
+ public function showPaymentErrorTemplate(array $fields, Payment $payment)
+ {
+ //
+ }
+
+ /**
+ * Renders the template of payment methods list for the redirect mode.
+ *
+ * @param array $fields
+ *
+ * @return void
+ */
+ public function showPaymentListRedirectTemplate(array $fields)
+ {
+ //
+ }
+
+ /**
+ * Renders the template with the payment methods list for the inline mode.
+ *
+ * @param array $fields
+ *
+ * @return void
+ */
+ public function showPaymentListInlineTemplate(array $fields)
+ {
+ //
+ }
+
+ /**
+ * Renders the template with the payment methods list for the alias selection.
+ * It does require by CoreLibrary.
+ *
+ * @param array $fields
+ *
+ * @return void
+ */
+ public function showPaymentListAliasTemplate(array $fields)
+ {
+ //
+ }
+
+ /**
+ * In case of error, display error page.
+ *
+ * @param $message
+ * @return void
+ */
+ public function setOrderErrorPage($message)
+ {
+ //
+ }
+
+ /**
+ * Handles incoming requests from Ingenico.
+ * Passes execution to CL.
+ * From there it updates order's statuses.
+ * This method must return HTTP status 200/400.
+ *
+ * @return void
+ */
+ public function webhookListener()
+ {
+ //
+ }
+
+ /**
+ * Initiates payment page from the reminder email link.
+ *
+ *
+ * @return void
+ */
+ public function showReminderPayOrderPage()
+ {
+ //
+ }
+
+ /**
+ * Empty Shopping Cart and reset session.
+ *
+ * @return void
+ */
+ public function emptyShoppingCart()
+ {
+ //
+ }
+
+ /**
+ * Restore Shopping Cart.
+ */
+ public function restoreShoppingCart()
+ {
+ //
+ }
+
+ /**
+ * Restore Cart
+ * @param $orderId
+ */
+ private function restoreCart($orderId)
+ {
+ //
+ }
+
+ /**
+ * Retrieve Missing or Invalid Order's fields
+ * @param mixed $orderId
+ * @param PaymentMethod $pm
+ * @return array
+ */
+ public function retrieveMissingFields($orderId, PaymentMethod $pm)
+ {
+ //
+ }
+
+ /**
+ * Get Payment Method Code of Order.
+ *
+ * @param mixed $orderId
+ *
+ * @return string|false
+ */
+ public function getOrderPaymentMethod($orderId)
+ {
+ return false;
+ }
+
+ /**
+ * Get Payment Method Code of Quote/Cart.
+ *
+ * @param mixed $quoteId
+ *
+ * @return string|false
+ */
+ public function getQuotePaymentMethod($quoteId = null)
+ {
+ return false;
+ }
+
+ /**
+ * Get all Session values in a key => value format
+ *
+ * @return array
+ */
+ public function getSessionValues()
+ {
+ return [];
+ }
+
+ /**
+ * Get value from Session.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function getSessionValue($key)
+ {
+ return false;
+ }
+
+ /**
+ * Store value in Session.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function setSessionValue($key, $value)
+ {
+ //
+ }
+
+ /**
+ * Remove value from Session.
+ *
+ * @param $key
+ * @return void
+ */
+ public function unsetSessionValue($key)
+ {
+ //
+ }
+
+ /**
+ * Get Field Label
+ *
+ * @param string $field
+ * @return string
+ */
+ public function getOrderFieldLabel($field)
+ {
+ switch ($field) {
+ case OrderField::CUSTOMER_DOB:
+ return 'Date of Birth';
+ default:
+ return ucfirst(str_replace('_', ' ', $field));
+ }
+ }
+
+ /**
+ * Process OpenInvoice Payment.
+ *
+ * @param mixed $orderId
+ * @param \IngenicoClient\Alias $alias
+ * @param array $fields Form fields
+ * @return void
+ */
+ public function processOpenInvoicePayment($orderId, \IngenicoClient\Alias $alias, array $fields = [])
+ {
+ // @see Connector::showPaymentListRedirectTemplate()
+ // @see Connector::clarifyOpenInvoiceAdditionalFields()
+ }
+
+ /**
+ * Process if have invalid fields of OpenInvoice.
+ *
+ * @param $orderId
+ * @param \IngenicoClient\Alias $alias
+ * @param array $fields
+ */
+ public function clarifyOpenInvoiceAdditionalFields($orderId, \IngenicoClient\Alias $alias, array $fields)
+ {
+ //
+ }
+
+ /**
+ * Get Platform Environment.
+ *
+ * @return string
+ */
+ public function getPlatformEnvironment()
+ {
+ return \IngenicoClient\IngenicoCoreLibrary::PLATFORM_INGENICO;
+ }
+
+ /**
+ * Check whether an order with given ID is created in Magento
+ *
+ * @param $orderId
+ * @return bool
+ */
+ public function isOrderCreated($orderId)
+ {
+ return true;
+ }
+}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
new file mode 100644
index 0000000..59f9526
--- /dev/null
+++ b/tests/bootstrap.php
@@ -0,0 +1,29 @@
+__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../templates\n"
diff --git a/translations/de_DE/LC_MESSAGES/messages.mo b/translations/de_DE/LC_MESSAGES/messages.mo
new file mode 100644
index 0000000..6bdbb9b
Binary files /dev/null and b/translations/de_DE/LC_MESSAGES/messages.mo differ
diff --git a/translations/messages.de_DE.po b/translations/de_DE/LC_MESSAGES/messages.po
similarity index 98%
rename from translations/messages.de_DE.po
rename to translations/de_DE/LC_MESSAGES/messages.po
index d62c7fc..28f104d 100644
--- a/translations/messages.de_DE.po
+++ b/translations/de_DE/LC_MESSAGES/messages.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T16:14:20+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:18+0600\n"
+"PO-Revision-Date: 2022-02-15 09:29+0600\n"
"Language: de_DE\n"
"X-Domain: messages\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $this->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../src\n"
diff --git a/translations/en_US/LC_MESSAGES/email.mo b/translations/en_US/LC_MESSAGES/email.mo
new file mode 100644
index 0000000..8d8dc99
Binary files /dev/null and b/translations/en_US/LC_MESSAGES/email.mo differ
diff --git a/translations/email.en_US.po b/translations/en_US/LC_MESSAGES/email.po
similarity index 98%
rename from translations/email.en_US.po
rename to translations/en_US/LC_MESSAGES/email.po
index 93faebf..bd6b7c1 100644
--- a/translations/email.en_US.po
+++ b/translations/en_US/LC_MESSAGES/email.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T15:46:29+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:09+0600\n"
+"PO-Revision-Date: 2022-02-15 09:29+0600\n"
"Language: en_US\n"
"X-Domain: email\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $view->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../templates\n"
diff --git a/translations/en_US/LC_MESSAGES/messages.mo b/translations/en_US/LC_MESSAGES/messages.mo
new file mode 100644
index 0000000..b635685
Binary files /dev/null and b/translations/en_US/LC_MESSAGES/messages.mo differ
diff --git a/translations/messages.en_US.po b/translations/en_US/LC_MESSAGES/messages.po
similarity index 97%
rename from translations/messages.en_US.po
rename to translations/en_US/LC_MESSAGES/messages.po
index e694e65..565ab76 100644
--- a/translations/messages.en_US.po
+++ b/translations/en_US/LC_MESSAGES/messages.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T16:14:20+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:18+0600\n"
+"PO-Revision-Date: 2022-02-15 09:29+0600\n"
"Language: en_US\n"
"X-Domain: messages\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $this->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../src\n"
diff --git a/translations/es_ES/LC_MESSAGES/email.mo b/translations/es_ES/LC_MESSAGES/email.mo
new file mode 100644
index 0000000..599ca63
Binary files /dev/null and b/translations/es_ES/LC_MESSAGES/email.mo differ
diff --git a/translations/email.es_ES.po b/translations/es_ES/LC_MESSAGES/email.po
similarity index 98%
rename from translations/email.es_ES.po
rename to translations/es_ES/LC_MESSAGES/email.po
index 22ded3b..ac3f280 100644
--- a/translations/email.es_ES.po
+++ b/translations/es_ES/LC_MESSAGES/email.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T15:46:29+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:09+0600\n"
+"PO-Revision-Date: 2022-02-15 09:30+0600\n"
"Language: es_ES\n"
"X-Domain: email\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $view->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../templates\n"
diff --git a/translations/es_ES/LC_MESSAGES/messages.mo b/translations/es_ES/LC_MESSAGES/messages.mo
new file mode 100644
index 0000000..d0d3214
Binary files /dev/null and b/translations/es_ES/LC_MESSAGES/messages.mo differ
diff --git a/translations/messages.es_ES.po b/translations/es_ES/LC_MESSAGES/messages.po
similarity index 98%
rename from translations/messages.es_ES.po
rename to translations/es_ES/LC_MESSAGES/messages.po
index c16f444..f9295f5 100644
--- a/translations/messages.es_ES.po
+++ b/translations/es_ES/LC_MESSAGES/messages.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T16:14:20+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:18+0600\n"
+"PO-Revision-Date: 2022-02-14 22:52+0600\n"
"Language: es_ES\n"
"X-Domain: messages\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $this->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../src\n"
diff --git a/translations/fr_FR/LC_MESSAGES/email.mo b/translations/fr_FR/LC_MESSAGES/email.mo
new file mode 100644
index 0000000..1df7252
Binary files /dev/null and b/translations/fr_FR/LC_MESSAGES/email.mo differ
diff --git a/translations/email.fr_FR.po b/translations/fr_FR/LC_MESSAGES/email.po
similarity index 98%
rename from translations/email.fr_FR.po
rename to translations/fr_FR/LC_MESSAGES/email.po
index b94429b..c81523b 100644
--- a/translations/email.fr_FR.po
+++ b/translations/fr_FR/LC_MESSAGES/email.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T15:46:29+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:09+0600\n"
+"PO-Revision-Date: 2022-02-15 09:31+0600\n"
"Language: fr_FR\n"
"X-Domain: email\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $view->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../templates\n"
diff --git a/translations/fr_FR/LC_MESSAGES/messages.mo b/translations/fr_FR/LC_MESSAGES/messages.mo
new file mode 100644
index 0000000..6ebdd26
Binary files /dev/null and b/translations/fr_FR/LC_MESSAGES/messages.mo differ
diff --git a/translations/messages.fr_FR.po b/translations/fr_FR/LC_MESSAGES/messages.po
similarity index 98%
rename from translations/messages.fr_FR.po
rename to translations/fr_FR/LC_MESSAGES/messages.po
index 7df6798..3b6ded8 100644
--- a/translations/messages.fr_FR.po
+++ b/translations/fr_FR/LC_MESSAGES/messages.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T16:14:20+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:18+0600\n"
+"PO-Revision-Date: 2022-02-15 09:31+0600\n"
"Language: fr_FR\n"
"X-Domain: messages\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $this->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../src\n"
diff --git a/translations/it_IT/LC_MESSAGES/email.mo b/translations/it_IT/LC_MESSAGES/email.mo
new file mode 100644
index 0000000..f3e5007
Binary files /dev/null and b/translations/it_IT/LC_MESSAGES/email.mo differ
diff --git a/translations/email.it_IT.po b/translations/it_IT/LC_MESSAGES/email.po
similarity index 98%
rename from translations/email.it_IT.po
rename to translations/it_IT/LC_MESSAGES/email.po
index 3c69138..cd3845c 100644
--- a/translations/email.it_IT.po
+++ b/translations/it_IT/LC_MESSAGES/email.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T15:46:29+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:09+0600\n"
+"PO-Revision-Date: 2022-02-15 09:31+0600\n"
"Language: it_IT\n"
"X-Domain: email\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $view->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../templates\n"
diff --git a/translations/it_IT/LC_MESSAGES/messages.mo b/translations/it_IT/LC_MESSAGES/messages.mo
new file mode 100644
index 0000000..ac67331
Binary files /dev/null and b/translations/it_IT/LC_MESSAGES/messages.mo differ
diff --git a/translations/messages.it_IT.po b/translations/it_IT/LC_MESSAGES/messages.po
similarity index 98%
rename from translations/messages.it_IT.po
rename to translations/it_IT/LC_MESSAGES/messages.po
index 60b468f..6efe9a5 100644
--- a/translations/messages.it_IT.po
+++ b/translations/it_IT/LC_MESSAGES/messages.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T16:14:20+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:18+0600\n"
+"PO-Revision-Date: 2022-02-15 09:31+0600\n"
"Language: it_IT\n"
"X-Domain: messages\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $this->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../src\n"
diff --git a/translations/nl_NL/LC_MESSAGES/email.mo b/translations/nl_NL/LC_MESSAGES/email.mo
new file mode 100644
index 0000000..39411fc
Binary files /dev/null and b/translations/nl_NL/LC_MESSAGES/email.mo differ
diff --git a/translations/email.nl_NL.po b/translations/nl_NL/LC_MESSAGES/email.po
similarity index 98%
rename from translations/email.nl_NL.po
rename to translations/nl_NL/LC_MESSAGES/email.po
index f355cd9..441354a 100644
--- a/translations/email.nl_NL.po
+++ b/translations/nl_NL/LC_MESSAGES/email.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T15:46:29+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:09+0600\n"
+"PO-Revision-Date: 2022-02-15 09:31+0600\n"
"Language: nl_NL\n"
"X-Domain: email\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $view->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../templates\n"
diff --git a/translations/nl_NL/LC_MESSAGES/messages.mo b/translations/nl_NL/LC_MESSAGES/messages.mo
new file mode 100644
index 0000000..afde87b
Binary files /dev/null and b/translations/nl_NL/LC_MESSAGES/messages.mo differ
diff --git a/translations/messages.nl_NL.po b/translations/nl_NL/LC_MESSAGES/messages.po
similarity index 98%
rename from translations/messages.nl_NL.po
rename to translations/nl_NL/LC_MESSAGES/messages.po
index 59bc376..d5460bd 100644
--- a/translations/messages.nl_NL.po
+++ b/translations/nl_NL/LC_MESSAGES/messages.po
@@ -8,11 +8,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-04-08T16:14:20+00:00\n"
-"PO-Revision-Date: 2019-04-08 22:18+0600\n"
+"PO-Revision-Date: 2022-02-15 09:32+0600\n"
"Language: nl_NL\n"
"X-Domain: messages\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.0\n"
"X-Poedit-KeywordsList: $this->__;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../src\n"