git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7522 b9a71923-0436-4b27-9f14-aed3839534dd
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>hipay</name>
|
||||
<displayName>Hipay</displayName>
|
||||
<version>1</version>
|
||||
<description>Secure payement Visa Mastercard and european solutions.</description>
|
||||
<author></author>
|
||||
<tab>payments_gateways</tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{hipay}prestashop>hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Secure payement Visa Mastercard und europäische Lösungen.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Fehler: kann keine PaymentParams erstellen ';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Warenkorb';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Fehler: kann \"Warenkorb\" Produkt nicht erstellen';
|
||||
$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Gesamt Bestellung';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Fehler: kann Bestellung nicht erstellen';
|
||||
$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Fehler:';
|
||||
$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguration aktualisiert';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'Sie sind nicht berechtigt, externe URLs (allow_url_fopen) zu öffnen';
|
||||
$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'cURL ist nicht aktiviert';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL ist nicht aktiviert';
|
||||
$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Kann nicht auf Zahlungs-Gateway zugreifen';
|
||||
$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'überprüfen Sie Ihre Firewall';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Ihr Shop ist nicht online';
|
||||
$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'Hipay Kategorien nicht für jede Seiten-ID eingestellt';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'Unmöglich, Hipay Kategorien abzurufen. Bitte beziehen Sie sich auf Ihr Fehlerprotokoll für weitere Details.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_8f19eb452ad0295c45ca62a099f10dc6'] = 'Hipay ist eine sichere elektronische Geldbörse, die Händlern ein komplettes Service-Paket für Online-Business-Transaktionen bietet: ob für digitale Inhalte, Software, Musik, Abonnements, physische Güter ... ohne mit einer Bank zu verhandeln und ohne technische Kosten.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_e5ac60a0713182096ea3f9590f101b25'] = 'Free & Easy, die Hipay-Implementierung ist ein echtes Plus für E-Commerce-Webseite, die sich in Europa ausbreiten wollen: sichere Zahlungen durch internationale Karten, Local Payment-Lösungen, Überweisungen ...';
|
||||
$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Hinweis: Wenn Sie eine Zahlung erstatten möchten, melden Sie sich auf Ihrem Hipay-Konto an, dann gehen Sie zu Merchant Management> Verkaufsmanagement.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Konfiguration';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Melden Sie sich bei Ihrem Händler-Konto an';
|
||||
$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Erstellen Sie ein hipay-Konto ';
|
||||
$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Konto';
|
||||
$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'Echtzeit/ Betrieb';
|
||||
$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'Sandbox / Test';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Konfiguration im';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Kontonummer';
|
||||
$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Händler-Kennwort';
|
||||
$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'Seiten-ID';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Kategorie';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Test Kontonummer';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Autorisierte Altersgruppe';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Für alle Altersstufen';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = 'Ab 12 Jahren und älter';
|
||||
$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = 'Ab 16 Jahren und älter';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = 'Ab 18 Jahren und älter';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Hinweis: Bitte sicherstellen, dass der Währungsmodus, den Sie im Zahlungs-Tab gewählt haben, mit Ihrem Hipay Konto (en) kompatibel ist.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Konfiguration aktualisieren';
|
||||
$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Bezahlen Sie mit Hipay';
|
||||
$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'erforderlicher Minimalbetrag , um mit Hipay bezahlen:';
|
||||
$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = '(Sandbox / Test-Modus)';
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{hipay}prestashop>hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Asegure los pagos de Visa Mastercard y soluciones europeas.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Error: imposible crear PaymentParams';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrito';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Error: imposible crear el Producto \"Carrito\"';
|
||||
$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Total pedido';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Error: imposible crear el pedido';
|
||||
$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Error:';
|
||||
$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuración actualizada';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'La directiva allow_url_fopen está desactivada';
|
||||
$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'La librería cURL no está activada';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL no está activado';
|
||||
$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Imposible acceder al servicio de pago';
|
||||
$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'vérifiez le firewall de votre serveur pour le port 443';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Su tienda no está en línea';
|
||||
$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'La categoría de productos Hipay no está configurada para cada ID del sitio web';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'imposible recuperar las categorías Hipay. Vea el diario de errores para más información.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_74e0ddca931daefcd88f3c118e8eb0f1'] = 'Hipay es un monedero electrónico seguro que tiene el aval bancario europeo. Hipay le ofrece muchas posibilidades, sin necesidad de negociar con un banco. Fácil y de uso gratuito, la solución Hipay constituye una real ventaja para los sitios de venta en línea que desean expandirse por Europa: pagos seguros con tarjetas internacionales, soluciones locales de pago, transferencias bancarias ...';
|
||||
$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Nota : Para reenbolsar integramente una transacción, vaya al sitio www.hipay.com, en la gestión de venta Hipay/gestión de las ventas.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Configuración';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d86590564b22be4d3b242472722bf969'] = 'La configuración de Hipay es muy fácil y funciona en 3 pasos';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Acceder a su espacio de venta Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Crear una cuenta Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_04c85eb0ee32a3a352e80c9bce37b038'] = 'Activar la solución Hipay en su PrestaShop, ¡es gratis!';
|
||||
$_MODULE['<{hipay}prestashop>hipay_b7ce0a1dce723a074049b88fb22dbb4d'] = 'Disfrutar de precios especiales en las transacciones a través de PrestaShop ';
|
||||
$_MODULE['<{hipay}prestashop>hipay_7667c2b31b9980267cb526ed2f0d235d'] = 'poniéndose en contacto con nuestro departamento de ventas';
|
||||
$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Cuenta Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'real / producción';
|
||||
$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'test';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Configuración en';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Número de cuenta';
|
||||
$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Contraseña vendedor';
|
||||
$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'ID del sitio web';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoría';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Prueba número de cuenta';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Edad mínima';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Para todas las edades';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = '12 años y más';
|
||||
$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = '16 años y más';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = '18 años y más';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Nota : Compruebe, por favor, que el modo de gestión de las divisas que ha elegido en la pestaña Pago es compatible con su/sus cuenta(s) Hipay.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Guardar las modificaciones';
|
||||
$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Pagar con Hipay';
|
||||
$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'Importe mínimo para pagar con Hipay:';
|
||||
$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = 'sandbox / modo test';
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{hipay}prestashop>hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Paiement sécurisé Visa Mastercard et solutions européennes.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Erreur: impossible de créer PaymentParams';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Erreur : impossible de créer le produit \"panier\"';
|
||||
$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Total commande';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Erreur : impossible de créer la commande';
|
||||
$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Erreur :';
|
||||
$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuration mise à jour';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'La directive allow_url_fopen est désactivée';
|
||||
$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'La librairie cURL n\'est pas activée';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL n\'est pas activé';
|
||||
$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Impossible d\'accéder au service de paiement';
|
||||
$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'vérifiez le firewall de votre serveur pour le port 443';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Votre boutique n\'est pas en ligne';
|
||||
$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'La catégorie de produits Hipay n\'est pas configurée pour chaque ID site';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'Impossible de récupérer les catégories Hipay. Merci de vous référer à votre journal des erreurs pour plus de détails.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_74e0ddca931daefcd88f3c118e8eb0f1'] = 'Hipay est un portefeuille électronique sécurisé et possédant l\'agrément bancaire européen. Hipay vous offre de nombreuses possibilités sans avoir besoin de négocier avec une banque. Facile et gratuite, l’implémentation de la solution Hipay constitue un véritable atout pour un site e-commerce qui souhaite se développer en Europe : paiements sécurisés par cartes internationales, solutions de paiement locales, virements bancaires...';
|
||||
$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Note : Pour rembourser intégralement une transaction, veuillez vous rendre sur le site www.hipay.com, dans la gestion marchande Hipay/gestion des ventes.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Configuration';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d86590564b22be4d3b242472722bf969'] = 'La configuration de Hipay est vraiment facile et fonctionne en 3 étapes';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Accédez à votre espace marchand Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Créez un compte Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_04c85eb0ee32a3a352e80c9bce37b038'] = 'Activer la solution Hipay dans votre PrestaShop, c\'est gratuit !';
|
||||
$_MODULE['<{hipay}prestashop>hipay_b7ce0a1dce723a074049b88fb22dbb4d'] = 'Profitez de tarifs préférentiels sur les transactions via Prestashop en';
|
||||
$_MODULE['<{hipay}prestashop>hipay_7667c2b31b9980267cb526ed2f0d235d'] = 'contactant notre département des ventes';
|
||||
$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Compte Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'réel / production';
|
||||
$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'test';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Configuration en';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Numéro de compte';
|
||||
$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Mot de passe marchand';
|
||||
$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'ID du site';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Catégorie';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Numéro de compte Test';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Âge minimum';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Pour tous les âges';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = '12 ans et plus';
|
||||
$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = '16 ans et plus';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = '18 ans et plus';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Note : Merci de vérifier que le mode de gestion des devises que vous avez choisi dans l\'onglet Paiement est compatible avec votre/vos compte(s) Hipay.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Enregistrer les modifications';
|
||||
$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Payer avec Hipay';
|
||||
$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'Montant minimum pour payer avec Hipay :';
|
||||
$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = '(bac à sable / mode test)';
|
||||
|
Before Width: | Height: | Size: 787 B |
@@ -1,514 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class Hipay extends PaymentModule
|
||||
{
|
||||
private $arrayCategories;
|
||||
private $prod;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'hipay';
|
||||
$this->tab = 'payments_gateways';
|
||||
$this->version = 1.0;
|
||||
|
||||
$this->currencies = true;
|
||||
$this->currencies_mode = 'radio';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Hipay');
|
||||
$this->description = $this->l('Secure payement Visa Mastercard and european solutions.');
|
||||
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
SELECT iso_code
|
||||
FROM '._DB_PREFIX_.'country as c
|
||||
LEFT JOIN '._DB_PREFIX_.'zone as z
|
||||
ON z.id_zone = c.id_zone
|
||||
WHERE z.id_zone = 1');
|
||||
|
||||
foreach ($result as $num => $iso)
|
||||
$this->limited_countries[] = $iso['iso_code'];
|
||||
|
||||
if ($this->id)
|
||||
{
|
||||
$this->prod = (int)Tools::getValue('HIPAY_PROD', Configuration::get('HIPAY_PROD'));
|
||||
// Define extracted from mapi/mapi_defs.php
|
||||
if (!defined('HIPAY_GATEWAY_URL'))
|
||||
define('HIPAY_GATEWAY_URL','https://'.($this->prod ? '' : 'test.').'payment.hipay.com/order/');
|
||||
}
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
Configuration::updateValue('HIPAY_SALT', uniqid());
|
||||
// Force using Prod mod
|
||||
Configuration::updateValue('HIPAY_PROD', 1);
|
||||
|
||||
if (!Configuration::get('HIPAY_UNIQID'))
|
||||
Configuration::updateValue('HIPAY_UNIQID', uniqid());
|
||||
if (!Configuration::get('HIPAY_RATING'))
|
||||
Configuration::updateValue('HIPAY_RATING', 'ALL');
|
||||
|
||||
if (!(parent::install() AND $this->registerHook('payment')))
|
||||
return false;
|
||||
// Check only the European country for the country restrictions
|
||||
Db::getInstance()->Execute('
|
||||
DELETE FROM '._DB_PREFIX_.'module_country
|
||||
WHERE id_module = '.$this->id.'
|
||||
AND id_country NOT IN
|
||||
(SELECT id_country FROM '._DB_PREFIX_.'country WHERE id_zone = 1)');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hookPayment($params)
|
||||
{
|
||||
global $smarty, $cart;
|
||||
|
||||
$currency = new Currency($this->getModuleCurrency($cart));
|
||||
$hipayAccount = ($this->prod ? Configuration::get('HIPAY_ACCOUNT_'.$currency->iso_code) : Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency->iso_code));
|
||||
$hipayPassword = ($this->prod ? Configuration::get('HIPAY_PASSWORD_'.$currency->iso_code) : Configuration::get('HIPAY_PASSWORD_TEST_'.$currency->iso_code));
|
||||
$hipaySiteId = ($this->prod ? Configuration::get('HIPAY_SITEID_'.$currency->iso_code) : Configuration::get('HIPAY_SITEID_TEST_'.$currency->iso_code));
|
||||
$hipayCategory = ($this->prod ? Configuration::get('HIPAY_CATEGORY_'.$currency->iso_code) : Configuration::get('HIPAY_CATEGORY_TEST_'.$currency->iso_code));
|
||||
if ($hipayAccount AND $hipayPassword AND $hipaySiteId AND $hipayCategory AND Configuration::get('HIPAY_RATING'))
|
||||
{
|
||||
$smarty->assign('hipay_prod', $this->prod);
|
||||
$smarty->assign(array('this_path' => $this->_path, 'this_path_ssl' => self::getHttpHost(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/'));
|
||||
return $this->display(__FILE__, 'payment.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
private function getModuleCurrency($cart)
|
||||
{
|
||||
$id_currency = (int)self::MysqlGetValue('SELECT id_currency FROM `'._DB_PREFIX_.'module_currency` WHERE id_module = '.(int)$this->id);
|
||||
if (!$id_currency OR $id_currency == -2)
|
||||
$id_currency = Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
elseif ($id_currency == -1)
|
||||
$id_currency = $cart->id_currency;
|
||||
return $id_currency;
|
||||
}
|
||||
|
||||
public function payment()
|
||||
{
|
||||
global $cookie, $cart;
|
||||
|
||||
$id_currency = $this->getModuleCurrency($cart);
|
||||
// If the currency is forced to a different one than the current one, then the cart must be updated
|
||||
if ($cart->id_currency != $id_currency)
|
||||
if (Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'cart SET id_currency = '.(int)$id_currency.' WHERE id_cart = '.(int)$cart->id))
|
||||
$cart->id_currency = $id_currency;
|
||||
|
||||
$currency = new Currency($id_currency);
|
||||
$language = new Language($cart->id_lang);
|
||||
$customer = new Customer($cart->id_customer);
|
||||
$carrier = new Carrier($cart->id_carrier, $cart->id_lang);
|
||||
$id_zone = self::MysqlGetValue('SELECT id_zone FROM '._DB_PREFIX_.'address a INNER JOIN '._DB_PREFIX_.'country c ON a.id_country = c.id_country WHERE id_address = '.(int)$cart->id_address_delivery);
|
||||
|
||||
require_once(dirname(__FILE__).'/mapi/mapi_package.php');
|
||||
|
||||
$hipayAccount = ($this->prod ? Configuration::get('HIPAY_ACCOUNT_'.$currency->iso_code) : Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency->iso_code));
|
||||
$hipayPassword = ($this->prod ? Configuration::get('HIPAY_PASSWORD_'.$currency->iso_code) : Configuration::get('HIPAY_PASSWORD_TEST_'.$currency->iso_code));
|
||||
$hipaySiteId = ($this->prod ? Configuration::get('HIPAY_SITEID_'.$currency->iso_code) : Configuration::get('HIPAY_SITEID_TEST_'.$currency->iso_code));
|
||||
$hipaycategory = ($this->prod ? Configuration::get('HIPAY_CATEGORY_'.$currency->iso_code) : Configuration::get('HIPAY_CATEGORY_TEST_'.$currency->iso_code));
|
||||
|
||||
$paymentParams = new HIPAY_MAPI_PaymentParams();
|
||||
$paymentParams->setLogin($hipayAccount, $hipayPassword);
|
||||
$paymentParams->setAccounts($hipayAccount, $hipayAccount);
|
||||
$paymentParams->setDefaultLang(strtolower($language->iso_code).'_'.strtoupper($language->iso_code));
|
||||
$paymentParams->setMedia('WEB');
|
||||
$paymentParams->setRating(Configuration::get('HIPAY_RATING'));
|
||||
$paymentParams->setPaymentMethod(HIPAY_MAPI_METHOD_SIMPLE);
|
||||
$paymentParams->setCaptureDay(HIPAY_MAPI_CAPTURE_IMMEDIATE);
|
||||
$paymentParams->setCurrency(strtoupper($currency->iso_code));
|
||||
$paymentParams->setIdForMerchant($cart->id);
|
||||
$paymentParams->setMerchantSiteId($hipaySiteId);
|
||||
$paymentParams->setUrlCancel(self::getHttpHost(true, true).__PS_BASE_URI__.'order.php?step=3');
|
||||
$paymentParams->setUrlNok(self::getHttpHost(true, true).__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key);
|
||||
$paymentParams->setUrlOk(self::getHttpHost(true, true).__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key);
|
||||
$paymentParams->setUrlAck(self::getHttpHost(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/validation.php?token='.$cart->secure_key);
|
||||
$paymentParams->setBackgroundColor('#FFFFFF');
|
||||
|
||||
if (!$paymentParams->check())
|
||||
return $this->l('[Hipay] Error: cannot create PaymentParams');
|
||||
|
||||
$item = new HIPAY_MAPI_Product();
|
||||
$item->setName($this->l('Cart'));
|
||||
$item->setInfo('');
|
||||
$item->setquantity(1);
|
||||
$item->setRef($cart->id);
|
||||
$item->setCategory($hipaycategory);
|
||||
$item->setPrice($cart->getOrderTotal());
|
||||
try {
|
||||
if (!$item->check())
|
||||
return $this->l('[Hipay] Error: cannot create "Cart" Product');
|
||||
} catch (Exception $e) {
|
||||
return $this->l('[Hipay] Error: cannot create "Cart" Product');
|
||||
}
|
||||
$items = array($item);
|
||||
|
||||
$order = new HIPAY_MAPI_Order();
|
||||
$order->setOrderTitle($this->l('Order total'));
|
||||
$order->setOrderCategory($hipaycategory);
|
||||
|
||||
if (!$order->check())
|
||||
return $this->l('[Hipay] Error: cannot create Order');
|
||||
|
||||
try {
|
||||
$commande = new HIPAY_MAPI_SimplePayment($paymentParams, $order, $items);
|
||||
} catch (Exception $e) {
|
||||
return $this->l('[Hipay] Error:').' '.$e->getMessage();
|
||||
}
|
||||
|
||||
$xmlTx = $commande->getXML();
|
||||
//d(htmlentities($xmlTx));
|
||||
$output = HIPAY_MAPI_SEND_XML::sendXML($xmlTx);
|
||||
$reply = HIPAY_MAPI_COMM_XML::analyzeResponseXML($output, $url, $err_msg, $err_keyword, $err_value, $err_code);
|
||||
|
||||
if ($reply === true)
|
||||
Tools::redirectLink($url);
|
||||
else
|
||||
{
|
||||
global $smarty;
|
||||
include(dirname(__FILE__).'/../../header.php');
|
||||
$smarty->assign('errors', array('[Hipay] '.strval($err_msg).' ('.$output.')'));
|
||||
$_SERVER['HTTP_REFERER'] = self::getHttpHost(true, true).__PS_BASE_URI__.'order.php?step=3';
|
||||
$smarty->display(_PS_THEME_DIR_.'errors.tpl');
|
||||
include(dirname(__FILE__).'/../../footer.php');
|
||||
}
|
||||
}
|
||||
|
||||
public function validation()
|
||||
{
|
||||
if (!array_key_exists('xml', $_POST))
|
||||
return;
|
||||
|
||||
if (_PS_MAGIC_QUOTES_GPC_)
|
||||
$_POST['xml'] = stripslashes($_POST['xml']);
|
||||
|
||||
require_once(dirname(__FILE__).'/mapi/mapi_package.php');
|
||||
|
||||
if (HIPAY_MAPI_COMM_XML::analyzeNotificationXML($_POST['xml'], $operation, $status, $date, $time, $transid, $amount, $currency, $id_cart, $data) === false)
|
||||
{
|
||||
file_put_contents('logs'.Configuration::get('HIPAY_UNIQID').'.txt', '['.date('Y-m-d H:i:s').'] Analysis error: '.$_POST['xml']."\n", FILE_APPEND);
|
||||
return false;
|
||||
}
|
||||
|
||||
$cart = new Cart((int)$id_cart);
|
||||
if ($cart->secure_key != Tools::getValue('token'))
|
||||
file_put_contents('logs'.Configuration::get('HIPAY_UNIQID').'.txt', '['.date('Y-m-d H:i:s').'] Token error: '.$_POST['xml']."\n", FILE_APPEND);
|
||||
else
|
||||
{
|
||||
if (trim($operation) == 'capture' AND trim(strtolower($status)) == 'ok')
|
||||
{
|
||||
/* Paiement capturé sur Hipay = Paiement accepté sur Prestashop */
|
||||
$orderMessage = $operation.': '.$status."\n".'date: '.$date.' '.$time."\n".'transaction: '.$transid."\n".'amount: '.(float)$amount.' '.$currency."\n".'id_cart: '.(int)$id_cart;
|
||||
$this->validateOrder((int)$id_cart, _PS_OS_PAYMENT_, (float)$amount, $this->displayName, $orderMessage, array(), NULL, false, Tools::getValue('token'));
|
||||
}
|
||||
elseif (trim($operation) == 'refund' AND trim(strtolower($status)) == 'ok')
|
||||
{
|
||||
/* Paiement remboursé sur Hipay */
|
||||
if (!($id_order = Order::getOrderByCartId((int)($id_cart))))
|
||||
die(Tools::displayError());
|
||||
$order = new Order((int)($id_order));
|
||||
if (!$order->valid OR $order->getCurrentState() === _PS_OS_REFUND_)
|
||||
die(Tools::displayError());
|
||||
$orderHistory = new OrderHistory();
|
||||
$orderHistory->id_order = (int)($order->id);
|
||||
$orderHistory->changeIdOrderState((int)(_PS_OS_REFUND_), (int)($id_order));
|
||||
$orderHistory->addWithemail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
global $currentIndex, $cookie;
|
||||
|
||||
$currencies = DB::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT c.iso_code, c.name, c.sign FROM '._DB_PREFIX_.'currency c');
|
||||
|
||||
if (Tools::isSubmit('submitHipay'))
|
||||
{
|
||||
Configuration::updateValue('HIPAY_PROD', Tools::getValue('HIPAY_PROD'));
|
||||
$this->prod = (int)Tools::getValue('HIPAY_PROD', Configuration::get('HIPAY_PROD'));
|
||||
$accounts = array();
|
||||
foreach ($currencies as $currency)
|
||||
{
|
||||
if (Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) != Tools::getValue('HIPAY_SITEID_'.$currency['iso_code']))
|
||||
Configuration::updateValue('HIPAY_CATEGORY_'.$currency['iso_code'], false);
|
||||
if (Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) != Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code']))
|
||||
Configuration::updateValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], false);
|
||||
|
||||
Configuration::updateValue('HIPAY_ACCOUNT_'.$currency['iso_code'], Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code']));
|
||||
Configuration::updateValue('HIPAY_PASSWORD_'.$currency['iso_code'], Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code']));
|
||||
Configuration::updateValue('HIPAY_SITEID_'.$currency['iso_code'], Tools::getValue('HIPAY_SITEID_'.$currency['iso_code']));
|
||||
Configuration::updateValue('HIPAY_CATEGORY_'.$currency['iso_code'], Tools::getValue('HIPAY_CATEGORY_'.$currency['iso_code']));
|
||||
if ($this->prod AND Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code']))
|
||||
$accounts[Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'])] = 1;
|
||||
|
||||
Configuration::updateValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']));
|
||||
Configuration::updateValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code']));
|
||||
Configuration::updateValue('HIPAY_SITEID_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code']));
|
||||
Configuration::updateValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], Tools::getValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code']));
|
||||
if (!$this->prod AND Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']))
|
||||
$accounts[Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])] = 1;
|
||||
|
||||
|
||||
}
|
||||
$i = 1;
|
||||
$dataSync = 'http://www.prestashop.com/modules/hipay.png?mode='.($this->prod ? 'prod' : 'test');
|
||||
foreach ($accounts as $account => $null)
|
||||
$dataSync .= '&account'.($i++).'='.urlencode($account);
|
||||
Configuration::updateValue('HIPAY_RATING', Tools::getValue('HIPAY_RATING'));
|
||||
echo $this->displayConfirmation($this->l('Configuration updated').'<img src="'.$dataSync.'" style="float:right" />');
|
||||
}
|
||||
|
||||
// Check configuration
|
||||
$allow_url_fopen = ini_get('allow_url_fopen');
|
||||
$openssl = extension_loaded('openssl');
|
||||
$curl = extension_loaded('curl');
|
||||
$ping = ($allow_url_fopen AND $openssl AND $fd = fsockopen('payment.hipay.com', 443) AND fclose($fd));
|
||||
$online = (in_array(Tools::getRemoteAddr(), array('127.0.0.1', '::1')) ? false : true);
|
||||
$categories = true;
|
||||
$categoryRetrieval = true;
|
||||
foreach ($currencies as $currency)
|
||||
{
|
||||
if (($hipaySiteId = Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND $hipayAccountId = Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code']) AND !count($this->getHipayCategories(true, $hipaySiteId, $hipayAccountId)))
|
||||
OR ($hipaySiteIdTest = Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) AND $hipayAccountIdTest = Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']) AND !count($this->getHipayCategories(false, $hipaySiteIdTest, $hipayAccountIdTest))))
|
||||
$categoryRetrieval = false;
|
||||
if ((Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND !Configuration::get('HIPAY_CATEGORY_'.$currency['iso_code']))
|
||||
OR (Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) AND !Configuration::get('HIPAY_CATEGORY_TEST_'.$currency['iso_code'])))
|
||||
$categories = false;
|
||||
}
|
||||
if (!$allow_url_fopen OR !$openssl OR !$curl OR !$ping OR !$categories OR !$categoryRetrieval OR !$online)
|
||||
{
|
||||
echo '
|
||||
<div class="warning warn">
|
||||
'.($allow_url_fopen ? '' : '<h3>'.$this->l('You are not allowed to open external URLs').'</h3>').'
|
||||
'.($curl ? '' : '<h3>'.$this->l('cURL is not enabled').'</h3>').'
|
||||
'.($openssl ? '' : '<h3>'.$this->l('OpenSSL is not enabled').'</h3>').'
|
||||
'.(($allow_url_fopen AND $openssl AND !$ping) ? '<h3>'.$this->l('Cannot access payment gateway').' '.HIPAY_GATEWAY_URL.' ('.$this->l('check your firewall').')</h3>' : '').'
|
||||
'.($online ? '' : '<h3>'.$this->l('Your shop is not online').'</h3>').'
|
||||
'.($categories ? '' : '<h3>'.$this->l('Hipay categories not set for every Site ID').'</h3>').'
|
||||
'.($categoryRetrieval ? '' : '<h3>'.$this->l('Impossible to retrieve Hipay categories. Please refer to your error log for more details.').'</h3>').'
|
||||
</div>';
|
||||
}
|
||||
|
||||
$link = $currentIndex.'&configure='.$this->name.'&token='.Tools::getValue('token');
|
||||
$form = '
|
||||
<style>
|
||||
.hipay_label {float:none;font-weight:normal;padding:0;text-align:left;width:100%;line-height:30px}
|
||||
.hipay_help {vertical-align:middle}
|
||||
#hipay_table {border:1px solid #383838;}
|
||||
#hipay_table td {border:1px solid #383838; width:250px; padding-left;8px; text-align:center;}
|
||||
#hipay_table td.hipay_end {border-top:none}
|
||||
#hipay_table td.hipay_block {border-bottom:none}
|
||||
#hipay_steps_infos {border:none; margin-bottom:20px;}
|
||||
#hipay_steps_infos td {border:none; width:70px; height:60px;padding-left;8px; text-align:left;}
|
||||
#hipay_steps_infos td.tab2 {border:none; width:700px;; height:60px;padding-left;8px; text-align:left;}
|
||||
#hipay_steps_infos td.hipay_end {border-top:none}
|
||||
#hipay_steps_infos td.hipay_block {border-bottom:none}
|
||||
|
||||
</style>
|
||||
<fieldset><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->l('Hipay').'</legend>
|
||||
'.$this->l('Hipay is a secure electronic wallet which has the European Bank approval. Hipay offer you many opportunities without need to negotiate with a bank. Easy and free to use, Hipay\'s solution of the implementation is a real asset for an e-commerce website that wants to expand in Europe: secure payment by international card, local payment solutions, bank transfers...').'
|
||||
<br />
|
||||
<!-- <br />'.$this->l('Notice: if you want to refund a payment, please log in to your Hipay account then go to Merchant Management > Sales management.').'-->
|
||||
</fieldset>
|
||||
<div class="clear"> </div>
|
||||
<fieldset><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->l('Configuration').'</legend>
|
||||
'.$this->l('The configuration of Hipay is really easy and runs into 3 steps').'<br /><br />
|
||||
<table id="hipay_steps_infos" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><img src="../modules/'.$this->name.'/1.png" alt="step 1" /></td>
|
||||
<td class="tab2">'.(Configuration::get('HIPAY_SITEID')
|
||||
? '<a href="https://www.hipay.com/auth" style="color:#D9263F;font-weight:700">'.$this->l('Log in to your merchant account').'</a><br />'
|
||||
: '<a href="https://www.hipay.com/registration/register" style="color:#D9263F;font-weight:700"><img src="../modules/'.$this->name.'/create.jpg" alt="'.$this->l('Create a Hipay account').'" title="'.$this->l('Create a Hipay account').'" border="0" /></a><br />').'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="../modules/'.$this->name.'/2.png" alt="step 2" /></td>
|
||||
<td class="tab2">'.$this->l('Active theHipay solution in you Prestashop, it\'s free !').'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="../modules/'.$this->name.'/3.png" alt="step 3" /></td>
|
||||
<td class="tab2">'.$this->l('Enjoy preferred pricing on transactions via Prestashop by').'
|
||||
<a style="color:blue; text-decoration:underline;" href="mailto:commercial@hipay.com">'
|
||||
.$this->l('contacting our sales department').'</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<form action="'.$link.'" method="post">
|
||||
<table id="hipay_table" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style=""> </td>
|
||||
<td style="height:40px;">Compte Hipay</td>
|
||||
</tr>';
|
||||
/*<tr style="height:40px">
|
||||
<td style="padding-left:20px"><b>'.$this->l('Account').'</b></td>
|
||||
<td class="hipay_prod" style="width:250px;padding-left:8px">
|
||||
<input type="radio" name="HIPAY_PROD" value="1" '.((int)$this->prod ? 'checked="checked"' : '').'
|
||||
onclick="switchHipayAccount(1);" />
|
||||
<span class="hipay_prod_span">'.$this->l('real / production').'</span>
|
||||
</td>';
|
||||
/*<td class="hipay_test" style="width:250px;padding-left:8px">
|
||||
<input type="radio" name="HIPAY_PROD" value="0" '.((int)$this->prod ? '' : 'checked="checked"').'
|
||||
onclick="switchHipayAccount(0);" />
|
||||
<span class="hipay_test_span">'.$this->l('sandbox / test').'</span><br />
|
||||
</td>
|
||||
$form .= '</tr>';*/
|
||||
foreach ($currencies as $currency)
|
||||
{
|
||||
$form .= '<tr>
|
||||
<td class="hipay_block"><b>'.$this->l('Configuration in').' '.$currency['name'].' '.$currency['sign'].'</b></td>
|
||||
<td class="hipay_prod hipay_block" style="padding-left:10px">
|
||||
<label class="hipay_label" for="HIPAY_ACCOUNT_'.$currency['iso_code'].'">'.$this->l('Account number').' <a href="../modules/'.$this->name.'/screenshots/accountnumber.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
|
||||
<input type="text" id="HIPAY_ACCOUNT_'.$currency['iso_code'].'" name="HIPAY_ACCOUNT_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'], Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code'])).'" /><br />
|
||||
<label class="hipay_label" for="HIPAY_PASSWORD_'.$currency['iso_code'].'">'.$this->l('Merchant password').' <a href="../modules/'.$this->name.'/screenshots/merchantpassword.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
|
||||
<input type="text" id="HIPAY_PASSWORD_'.$currency['iso_code'].'" name="HIPAY_PASSWORD_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code'], Configuration::get('HIPAY_PASSWORD_'.$currency['iso_code'])).'" /><br />
|
||||
<label class="hipay_label" for="HIPAY_SITEID_'.$currency['iso_code'].'">'.$this->l('Site ID').' <a href="../modules/'.$this->name.'/screenshots/siteid.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
|
||||
<input type="text" id="HIPAY_SITEID_'.$currency['iso_code'].'" name="HIPAY_SITEID_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_SITEID_'.$currency['iso_code'], Configuration::get('HIPAY_SITEID_'.$currency['iso_code'])).'" /><br />';
|
||||
if ($ping AND $hipaySiteId = (int)Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND $hipayAccountId = (int)Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code']))
|
||||
{
|
||||
$form .= ' <label for="HIPAY_CATEGORY_'.$currency['iso_code'].'" class="hipay_label">'.$this->l('Category').'</label><br />
|
||||
<select id="HIPAY_CATEGORY_'.$currency['iso_code'].'" name="HIPAY_CATEGORY_'.$currency['iso_code'].'">';
|
||||
foreach ($this->getHipayCategories(true, $hipaySiteId, $hipayAccountId) as $id => $name)
|
||||
$form.= ' <option value="'.(int)$id.'" '.(Tools::getValue('HIPAY_CATEGORY_'.$currency['iso_code'], Configuration::get('HIPAY_CATEGORY_'.$currency['iso_code'])) == $id ? 'selected="selected"' : '').'>'.htmlentities($name, ENT_COMPAT, 'UTF-8').'</option>';
|
||||
$form .= ' </select><br />';
|
||||
}
|
||||
/* $form .= ' </td>
|
||||
<td class="hipay_test hipay_block" style="padding-left:10px">
|
||||
<label class="hipay_label" for="HIPAY_ACCOUNT_TEST_'.$currency['iso_code'].'">'.$this->l('Test account number').' <a href="../modules/'.$this->name.'/screenshots/accountnumber.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
|
||||
<input type="text" id="HIPAY_ACCOUNT_TEST_'.$currency['iso_code'].'" name="HIPAY_ACCOUNT_TEST_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'], Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency['iso_code'])).'" /><br />
|
||||
<label class="hipay_label" for="HIPAY_PASSWORD_TEST_'.$currency['iso_code'].'">'.$this->l('Merchant password').' <a href="../modules/'.$this->name.'/screenshots/merchantpassword.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
|
||||
<input type="text" id="HIPAY_PASSWORD_TEST_'.$currency['iso_code'].'" name="HIPAY_PASSWORD_TEST_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_PASSWORD_TEST_'.$currency['iso_code'], Configuration::get('HIPAY_PASSWORD_TEST_'.$currency['iso_code'])).'" /><br />
|
||||
<label class="hipay_label" for="HIPAY_SITEID_TEST_'.$currency['iso_code'].'">'.$this->l('Site ID').' <a href="../modules/'.$this->name.'/screenshots/siteid.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
|
||||
<input type="text" id="HIPAY_SITEID_TEST_'.$currency['iso_code'].'" name="HIPAY_SITEID_TEST_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_SITEID_TEST_'.$currency['iso_code'], Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code'])).'" /><br />';*/
|
||||
if ($ping AND $hipaySiteId = (int)Configuration::get('HIPAY_SITEID_TEST_'.$currency['iso_code']) AND $hipayAccountIdTest = (int)Configuration::get('HIPAY_ACCOUNT_TEST_'.$currency['iso_code']))
|
||||
{
|
||||
$form .= ' <label for="HIPAY_CATEGORY_TEST_'.$currency['iso_code'].'" class="hipay_label">'.$this->l('Category').'</label><br />
|
||||
<select id="HIPAY_CATEGORY_TEST_'.$currency['iso_code'].'" name="HIPAY_CATEGORY_TEST_'.$currency['iso_code'].'">';
|
||||
foreach ($this->getHipayCategories(true, $hipaySiteId, $hipayAccountIdTest) as $id => $name)
|
||||
$form.= ' <option value="'.(int)$id.'" '.(Tools::getValue('HIPAY_CATEGORY_TEST_'.$currency['iso_code'], Configuration::get('HIPAY_CATEGORY_TEST_'.$currency['iso_code'])) == $id ? 'selected="selected"' : '').'>'.htmlentities($name, ENT_COMPAT, 'UTF-8').'</option>';
|
||||
$form .= ' </select><br />';
|
||||
}
|
||||
$form .= ' </td>
|
||||
</tr>
|
||||
<tr><td class="hipay_end"> </td><td class="hipay_prod hipay_end"> </td>';
|
||||
/*<td class="hipay_test hipay_end"> </td>*/
|
||||
$form .= '</tr>';
|
||||
}
|
||||
$form .= '</table>
|
||||
<hr class="clear" />
|
||||
<label for="HIPAY_RATING">'.$this->l('Authorized age group').'</label>
|
||||
<div class="margin-form">
|
||||
<select id="HIPAY_RATING" name="HIPAY_RATING">
|
||||
<option value="ALL">'.$this->l('For all ages').'</option>
|
||||
<option value="+12" '.(Tools::getValue('HIPAY_RATING', Configuration::get('HIPAY_RATING')) == '+12' ? 'selected="selected"' : '').'>'.$this->l('For ages 12 and over').'</option>
|
||||
<option value="+16" '.(Tools::getValue('HIPAY_RATING', Configuration::get('HIPAY_RATING')) == '+16' ? 'selected="selected"' : '').'>'.$this->l('For ages 16 and over').'</option>
|
||||
<option value="+18" '.(Tools::getValue('HIPAY_RATING', Configuration::get('HIPAY_RATING')) == '+18' ? 'selected="selected"' : '').'>'.$this->l('For ages 18 and over').'</option>
|
||||
</select>
|
||||
</div>
|
||||
<hr class="clear" />
|
||||
<p>'.$this->l('Notice: please verify that the currency mode you have chosen in the payment tab is compatible with your Hipay account(s).').'</p>
|
||||
<input type="submit" name="submitHipay" value="'.$this->l('Update configuration').'" class="button" />
|
||||
</form>
|
||||
</fieldset>
|
||||
<script type="text/javascript">
|
||||
function switchHipayAccount(prod) {
|
||||
if (prod)
|
||||
{';
|
||||
foreach ($currencies as $currency)
|
||||
$form .= '
|
||||
$("#HIPAY_ACCOUNT_'.$currency['iso_code'].'").css("background-color", "#FFFFFF");
|
||||
$("#HIPAY_ACCOUNT_TEST_'.$currency['iso_code'].'").css("background-color", "#EEEEEE");
|
||||
$("#HIPAY_PASSWORD_'.$currency['iso_code'].'").css("background-color", "#FFFFFF");
|
||||
$("#HIPAY_PASSWORD_TEST_'.$currency['iso_code'].'").css("background-color", "#EEEEEE");
|
||||
$("#HIPAY_SITEID_'.$currency['iso_code'].'").css("background-color", "#FFFFFF");
|
||||
$("#HIPAY_SITEID_TEST_'.$currency['iso_code'].'").css("background-color", "#EEEEEE");';
|
||||
$form .= ' $(".hipay_prod").css("background-color", "#AADEAA");
|
||||
$(".hipay_test").css("background-color", "transparent");
|
||||
$(".hipay_prod_span").css("font-weight", "700");
|
||||
$(".hipay_test_span").css("font-weight", "200");
|
||||
}
|
||||
else
|
||||
{';
|
||||
foreach ($currencies as $currency)
|
||||
$form .= '
|
||||
$("#HIPAY_ACCOUNT_'.$currency['iso_code'].'").css("background-color", "#EEEEEE");
|
||||
$("#HIPAY_ACCOUNT_TEST_'.$currency['iso_code'].'").css("background-color", "#FFFFFF");
|
||||
$("#HIPAY_PASSWORD_'.$currency['iso_code'].'").css("background-color", "#EEEEEE");
|
||||
$("#HIPAY_PASSWORD_TEST_'.$currency['iso_code'].'").css("background-color", "#FFFFFF");
|
||||
$("#HIPAY_SITEID_'.$currency['iso_code'].'").css("background-color", "#EEEEEE");
|
||||
$("#HIPAY_SITEID_TEST_'.$currency['iso_code'].'").css("background-color", "#FFFFFF");';
|
||||
$form .= ' $(".hipay_prod").css("background-color", "transparent");
|
||||
$(".hipay_test").css("background-color", "#AADEAA");
|
||||
$(".hipay_prod_span").css("font-weight", "200");
|
||||
$(".hipay_test_span").css("font-weight", "700");
|
||||
}
|
||||
}
|
||||
switchHipayAccount('.(int)$this->prod.');
|
||||
</script>';
|
||||
return $form;
|
||||
}
|
||||
|
||||
private function getHipayCategories($prod, $hipaySiteId, $hipayAccountId)
|
||||
{
|
||||
if (!is_array($this->arrayCategories))
|
||||
{
|
||||
$this->arrayCategories = array();
|
||||
if ($xml = simplexml_load_string(file_get_contents('https://www.prestashop.com/partner/hipay/ws.php?site='.$hipaySiteId.'&accountId='.$hipayAccountId.($prod ? '&prod' : ''))))
|
||||
{
|
||||
foreach ($xml->children() as $categoriesList)
|
||||
foreach ($categoriesList->children() as $category)
|
||||
$this->arrayCategories[strval($category['id'])] = strval($category);
|
||||
}
|
||||
}
|
||||
return $this->arrayCategories;
|
||||
}
|
||||
|
||||
// Retro compatibility with 1.2.5
|
||||
static private function MysqlGetValue($query)
|
||||
{
|
||||
$row = Db::getInstance()->getRow($query);
|
||||
return array_shift($row);
|
||||
}
|
||||
|
||||
// Retro compatibility with 1.2.5
|
||||
static private function getHttpHost($http = false, $entities = false)
|
||||
{
|
||||
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']);
|
||||
if ($entities)
|
||||
$host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8');
|
||||
if ($http)
|
||||
$host = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$host;
|
||||
return $host;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{hipay}prestashop>hipay_50089d40ef4536271e8b16dbe5763c01'] = 'Hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3a630598b9817a76dbb984ba467f6400'] = 'Pagamento sicuro Visa Mastercard e soluzioni europee.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5063b1c7402ff93d09defb875fa0085b'] = '[Hipay] Errore: non è possibile creare PaymentParams';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrello';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d4126d0b64579211d37151ef9b5af754'] = '[Hipay] Errore: non è possibile creare prodotti \"Carrello\"';
|
||||
$_MODULE['<{hipay}prestashop>hipay_ac2e397ffc0808f909e9712ca575c121'] = 'Ordine totale';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f750bac4745ff32a0c4a4c663ae6b9f'] = '[Hipay] Errore: non può creare l\'Ordine';
|
||||
$_MODULE['<{hipay}prestashop>hipay_8eafa453be20eba610cc8f5a8170681c'] = '[Hipay] Errore:';
|
||||
$_MODULE['<{hipay}prestashop>hipay_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configurazione aggiornata';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0851f7a0844553fa1168718de0f87262'] = 'Non hai i permessi per aprire gli URL esterni (allow_url_fopen)';
|
||||
$_MODULE['<{hipay}prestashop>hipay_6401593f1412a6b385c8e645d1f056ac'] = 'cURL non è abilitato';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL non è abilitato';
|
||||
$_MODULE['<{hipay}prestashop>hipay_54457f20f1d9f9d7cf14d8e928cad1aa'] = 'Impossibile accedere al gateway di pagamento';
|
||||
$_MODULE['<{hipay}prestashop>hipay_527557971b02f68ead6a278fb96ac396'] = 'Controlla il tuo firewall';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1c5f361b20c116ab2324e28b1ac54e12'] = 'Il tuo negozio non è online';
|
||||
$_MODULE['<{hipay}prestashop>hipay_66170e45eb6eb71c35fc3b259a866ff7'] = 'categorie Hipay non impostate per ogni ID del sito';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1a1a01512e42b64541ed9b1f43a56036'] = 'Impossibile recuperare categorie Hipay. Consulta il log degli errori per ulteriori dettagli.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_8f19eb452ad0295c45ca62a099f10dc6'] = 'Hipay è un portafoglio elettronico sicuro che fornisce ai commercianti un pacchetto di servizi completo per le transazioni commerciali on-line: sia per i contenuti digitali, software, musica, abbonamenti, beni fisici ... senza dover negoziare con una banca e senza oneri tecnici.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_e5ac60a0713182096ea3f9590f101b25'] = 'Free & Easy, l\'attuazione Hipay è un bene reale per un sito di e-commerce che vuole espandersi in Europa: pagamenti sicuri con carte internazionali, soluzioni di pagamento locali, bonifici ...';
|
||||
$_MODULE['<{hipay}prestashop>hipay_01ad06b7c5887516f56ff824278feb67'] = 'Avviso: se vuoi rimborsare un pagamento, accedi al tuo account Hipay poi vai a Merchant Management > Sales management.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_254f642527b45bc260048e30704edb39'] = 'Configurazione';
|
||||
$_MODULE['<{hipay}prestashop>hipay_f21850b58e4866b30f7d3724cc29edb1'] = 'Accedi al tuo account commerciante';
|
||||
$_MODULE['<{hipay}prestashop>hipay_dc32882bf2b1893d53aeaaa862c46d5c'] = 'Crea un account hipay';
|
||||
$_MODULE['<{hipay}prestashop>hipay_08bd40c7543007ad06e4fce31618f6ec'] = 'Account';
|
||||
$_MODULE['<{hipay}prestashop>hipay_9596f310ab4657258496ab217d3b5d85'] = 'reale / produzione';
|
||||
$_MODULE['<{hipay}prestashop>hipay_aeda5c9c68fbc42071d76a8d2b3d73e8'] = 'sandbox / test';
|
||||
$_MODULE['<{hipay}prestashop>hipay_d08cf8ae06cc7e3151aad4618c6efe3a'] = 'Configurazione in';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0f26e4f64d58beb4d924627c707e43ad'] = 'Numero di account';
|
||||
$_MODULE['<{hipay}prestashop>hipay_315f3c78ea54c8dadb082acc328dd5bd'] = 'Password commerciante';
|
||||
$_MODULE['<{hipay}prestashop>hipay_b250a007769c7ffe655c74cfb8176b8c'] = 'ID sito';
|
||||
$_MODULE['<{hipay}prestashop>hipay_3adbdb3ac060038aa0e6e6c138ef9873'] = 'Categoria';
|
||||
$_MODULE['<{hipay}prestashop>hipay_5c5fe383c7a097fea1d804ddbc83f4c6'] = 'Numero account di prova';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4de3b490bff03a1e715d142cdd41d3f4'] = 'Gruppo di età autorizzato';
|
||||
$_MODULE['<{hipay}prestashop>hipay_a19a3f71c627a4bde1e016a46f313799'] = 'Per tutte le età';
|
||||
$_MODULE['<{hipay}prestashop>hipay_1ddfab06495a5d2dfcf174034546502d'] = 'Per 12 anni e oltre';
|
||||
$_MODULE['<{hipay}prestashop>hipay_524fefef83fd5b0b82292a5366b40cd2'] = 'Per 16 anni e oltre';
|
||||
$_MODULE['<{hipay}prestashop>hipay_4f47a2eb5f2af6c1419baa17794e5f03'] = 'Per 18 anni e oltre';
|
||||
$_MODULE['<{hipay}prestashop>hipay_0d10a9cae9827e30b09913c1ec6ef2db'] = 'Nota: verificare che la modalità di valuta che hai scelto nella scheda di pagamento sia compatibile con il tuo/i tuoi account Hipay.';
|
||||
$_MODULE['<{hipay}prestashop>hipay_c80a51a60c5ee43553c3881459b8f431'] = 'Aggiorna la configurazione';
|
||||
$_MODULE['<{hipay}prestashop>payment_cb047ebd77ec02c36fbac405f8c9922c'] = 'Paga con Hipay';
|
||||
$_MODULE['<{hipay}prestashop>payment_35d5d65e0fb908f81b8c36820ddd7cc6'] = 'importo minimo richiesto per pagare con Hipay:';
|
||||
$_MODULE['<{hipay}prestashop>payment_e755d43d98e3d597b4492d2e6493ffed'] = '(Sandbox / modalità di prova)';
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1,229 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Objet représentant un affilié
|
||||
* montant de base : montant à partir duquel est calculé le montant qui sera distribué à l'affilié
|
||||
* cible : si l'affiliation est un piurcentage, la cible indique sur quels montant de la transaction
|
||||
* s'applique ce pourcentage
|
||||
* montant calculé : montant reversé à l'affilié
|
||||
*
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Affiliate extends HIPAY_MAPI_lockable {
|
||||
/**
|
||||
* Numéro de client
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $customerId;
|
||||
|
||||
/**
|
||||
* Numéro de compte
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $accountId;
|
||||
|
||||
/**
|
||||
* Valeur de l'affiliation (montant fixe ou pourcentage)
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $val;
|
||||
|
||||
/**
|
||||
* Si >0, $val est un pourcentage et $percentageTarget détermine
|
||||
* sur quels montants appliquer le pourcentage
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $percentageTarget;
|
||||
|
||||
/**
|
||||
* Montant à reversé à l'affilié
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $_amount;
|
||||
|
||||
/**
|
||||
* Montant de base sur lequel est calculé le montant
|
||||
* reversé à l'affilié
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $_baseAmount;
|
||||
|
||||
|
||||
/**
|
||||
* Assigne le numéro de client
|
||||
*
|
||||
* @param int $customerId
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCustomerId($customerId) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$customerId = (int)$customerId;
|
||||
if ($customerId<=0)
|
||||
return false;
|
||||
$this->customerId = $customerId;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de client
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCustomerId() {
|
||||
return $this->customerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne le numéro de compte
|
||||
*
|
||||
* @param int $accountId
|
||||
* @return boolean
|
||||
*/
|
||||
public function setAccountId($accountId) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$accountId = (int)$accountId;
|
||||
if ($accountId<=0)
|
||||
return false;
|
||||
$this->accountId = $accountId;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de compte
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAccountId() {
|
||||
return $this->accountId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne le valeur de l'affiliation, qui est un montant fixe ou un pourcentage
|
||||
* S'il s'agit d'un pourcentage, $percentageTarget représente la cible, c'est à dire sur quels
|
||||
* montants est basé le montant de l'affiliation
|
||||
*
|
||||
* @param float $val
|
||||
* @param int $percentageTarget
|
||||
* @return boolean
|
||||
*/
|
||||
public function setValue($val,$percentageTarget=0) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$val = sprintf('%.02f',(float)$val);
|
||||
$percentageTarget = (int)$percentageTarget;
|
||||
if ($val<=0 || $percentageTarget<0)
|
||||
return false;
|
||||
if ($percentageTarget>0 && $val>100)
|
||||
return false;
|
||||
if ($percentageTarget>0 && $percentageTarget>HIPAY_MAPI_TTARGET_ALL)
|
||||
return false;
|
||||
$this->val = $val;
|
||||
$this->percentageTarget = $percentageTarget;
|
||||
$this->setAmount();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la valeur de l'affiliation
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getValue() {
|
||||
return $this->val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne sur quoi s'applique le pourcentage
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPercentageTarget() {
|
||||
return $this->percentageTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne le montant sur lequel sera calculé l'affiliation
|
||||
*
|
||||
* @param float $baseAmount
|
||||
* @return boolean
|
||||
*/
|
||||
public function setBaseAmount($baseAmount) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$baseAmount = sprintf('%.02f',(float)$baseAmount);
|
||||
|
||||
if ($baseAmount<0)
|
||||
return false;
|
||||
$this->_baseAmount = $baseAmount;
|
||||
$this->setAmount();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant sur lequel sera calculé l'affiliation
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBaseAmount() {
|
||||
return $this->_baseAmount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le montant calculé de l'affiliation
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne le montant calculé de l'affiliation
|
||||
*
|
||||
*/
|
||||
protected function setAmount() {
|
||||
if ($this->percentageTarget>0) {
|
||||
$this->_amount = sprintf('%.02f',($this->_baseAmount/100)*$this->val);
|
||||
} else {
|
||||
$this->_amount = sprintf('%.02f',$this->_baseAmount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie que l'objet est bien initialisé
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function check() {
|
||||
if ($this->customerId<=0 || $this->accountId<=0 || $this->val<=0 || $this->percentageTarget<0)
|
||||
throw new Exception('Numéro de client, numéro de compte, valeur ou cible incorrects');
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function init() {
|
||||
$this->customerId = 0;
|
||||
$this->accountId = 0;
|
||||
$this->_amount = 0;
|
||||
$this->_baseAmount = 0;
|
||||
$this->val = 0;
|
||||
$this->percentageTarget = 0;
|
||||
}
|
||||
|
||||
|
||||
function __construct() {
|
||||
$this->init();
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
<?php
|
||||
class HIPAY_MAPI_COMM_XML
|
||||
{
|
||||
/**
|
||||
* Traitement de la réponse de la plateforme après l'envoi du
|
||||
* flux représentant un paiement
|
||||
*
|
||||
* @param string $xml
|
||||
* @param string $url
|
||||
* @param string $err_msg
|
||||
* @param string $err_keyword
|
||||
* @param string $err_value
|
||||
* @param string $err_code
|
||||
* @return boolean
|
||||
*/
|
||||
public static function analyzeResponseXML($xml,&$url,&$err_msg,&$err_keyword,&$err_value,&$err_code)
|
||||
{
|
||||
$url='';
|
||||
$err_msg='';
|
||||
$err_keyword='';
|
||||
$err_value='';
|
||||
$err_code='';
|
||||
try {
|
||||
$obj = @new SimpleXMLElement(trim($xml));
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
if (isset($obj->result[0]->url)) {
|
||||
$url = $obj->result[0]->url;
|
||||
return true;
|
||||
}
|
||||
if (isset($obj->result[0]->message))
|
||||
$err_msg = $obj->result[0]->message;
|
||||
if (isset($obj->result[0]->keyword))
|
||||
$err_keyword = $obj->result[0]->keyword;
|
||||
if (isset($obj->result[0]->value))
|
||||
$err_value = $obj->result[0]->value;
|
||||
if (isset($obj->result[0]->code))
|
||||
$err_code = $obj->result[0]->code;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Traitement du flux XML envoyé par HiPay notifiant le résultat d'une action sur une transaction
|
||||
*
|
||||
* @param string $xml
|
||||
* @param unknown_type $status
|
||||
* @param string $date
|
||||
* @param string $time
|
||||
* @param string $transid
|
||||
* @param string $origAmount
|
||||
* @param string $origCurrency
|
||||
* @param string $idformerchant
|
||||
* @param array $merchantdatas
|
||||
* @return boolean
|
||||
*/
|
||||
public static function analyzeNotificationXML($xml,&$operation,&$status,&$date,&$time,&$transid,&$origAmount,&$origCurrency,&$idformerchant,&$merchantdatas)
|
||||
{
|
||||
$operation='';
|
||||
$status='';
|
||||
$date='';
|
||||
$time='';
|
||||
$transid='';
|
||||
$origAmount='';
|
||||
$origCurrency='';
|
||||
$idformerchant='';
|
||||
$merchantdatas=array();
|
||||
try {
|
||||
$obj = new SimpleXMLElement(trim($xml));
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
if (isset($obj->result[0]->operation))
|
||||
$operation=$obj->result[0]->operation;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->status))
|
||||
$status=$obj->result[0]->status;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->date))
|
||||
$date=$obj->result[0]->date;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->time))
|
||||
$time=$obj->result[0]->time;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->transid))
|
||||
$transid=$obj->result[0]->transid;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->origAmount))
|
||||
$origAmount=$obj->result[0]->origAmount;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->origCurrency))
|
||||
$origCurrency=$obj->result[0]->origCurrency;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->idForMerchant))
|
||||
$idformerchant=$obj->result[0]->idForMerchant;
|
||||
else return false;
|
||||
|
||||
if (isset($obj->result[0]->merchantDatas)) {
|
||||
$d = $obj->result[0]->merchantDatas->children();
|
||||
foreach($d as $xml2) {
|
||||
if (preg_match('#^_aKey_#i',$xml2->getName())) {
|
||||
$indice = substr($xml2->getName(),6);
|
||||
$xml2 = (array)$xml2;
|
||||
$valeur = (string)$xml2[0];
|
||||
$merchantdatas[$indice]=$valeur;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Définition des montants sur lesquels s'appliquent les taxes
|
||||
*
|
||||
*/
|
||||
define('HIPAY_MAPI_TTARGET_TAX', 1);
|
||||
define('HIPAY_MAPI_TTARGET_INSURANCE', 2);
|
||||
define('HIPAY_MAPI_TTARGET_FCOST', 4);
|
||||
define('HIPAY_MAPI_TTARGET_SHIPPING', 8);
|
||||
define('HIPAY_MAPI_TTARGET_ITEM', 16);
|
||||
define('HIPAY_MAPI_TTARGET_ALL',HIPAY_MAPI_TTARGET_TAX+HIPAY_MAPI_TTARGET_INSURANCE+HIPAY_MAPI_TTARGET_FCOST+HIPAY_MAPI_TTARGET_SHIPPING+HIPAY_MAPI_TTARGET_ITEM);
|
||||
|
||||
/**
|
||||
* Type de paiements possibles
|
||||
*
|
||||
*/
|
||||
define('HIPAY_MAPI_METHOD_SIMPLE',0);
|
||||
define('HIPAY_MAPI_METHOD_MULTI',1);
|
||||
|
||||
/**
|
||||
* Valeurs par défaut
|
||||
*
|
||||
*/
|
||||
define('HIPAY_MAPI_DEFLANG','FR_fr');
|
||||
define('HIPAY_MAPI_DEFMEDIA','WEB');
|
||||
|
||||
define('HIPAY_MAPI_MAX_INFO_LENGTH',200);
|
||||
define('HIPAY_MAPI_MAX_TITLE_LENGTH',80);
|
||||
|
||||
define('HIPAY_MAPI_MAX_LOGIN_LENGTH',20);
|
||||
define('HIPAY_MAPI_MAX_PASSWORD_LENGTH',20);
|
||||
|
||||
define('HIPAY_MAPI_MAX_RATING_LENGTH',8);
|
||||
|
||||
define('HIPAY_MAPI_MAX_MDATAS_LENGTH',200);
|
||||
|
||||
define('HIPAY_MAPI_MAX_ACKWD_LENGTH',8);
|
||||
|
||||
define('HIPAY_MAPI_MAX_ACKMAIL_LENGTH',64);
|
||||
|
||||
define('HIPAY_MAPI_MAX_PRODUCT_NAME_LENGTH',100);
|
||||
|
||||
define('HIPAY_MAPI_MAX_PRODUCT_INFO_LENGTH',100);
|
||||
|
||||
define('HIPAY_MAPI_MAX_PRODUCT_REF_LENGTH',35);
|
||||
|
||||
define('HIPAY_MAPI_MAX_TAX_NAME_LENGTH',32);
|
||||
|
||||
/**
|
||||
* Valeurs particulières pour le délai de capture
|
||||
*
|
||||
*/
|
||||
define('HIPAY_MAPI_CAPTURE_MANUAL',-1);
|
||||
define('HIPAY_MAPI_CAPTURE_IMMEDIATE',0);
|
||||
define('HIPAY_MAPI_CAPTURE_MAX_DAYS',7);
|
||||
|
||||
define('HIPAY_MAPI_OPE_PREAUTH','preauthorization');
|
||||
define('HIPAY_MAPI_OPE_AUTH','authorization');
|
||||
define('HIPAY_MAPI_OPE_CANCEL','cancellation');
|
||||
define('HIPAY_MAPI_OPE_REFUND','refund');
|
||||
define('HIPAY_MAPI_OPE_CAPTURE','capture');
|
||||
define('HIPAY_MAPI_OPE_REJECT','rejet');
|
||||
|
||||
define('HIPAY_MAPI_STATUS_OK','ok');
|
||||
define('HIPAY_MAPI_STATUS_NOK','nok');
|
||||
|
||||
// Nombre de secondes avant le timeout de curl avec le serveur Hipay
|
||||
// A régler en fonction de votre rapidité d'accès à la plate forme hipay
|
||||
define('HIPAY_MAPI_CURL_TIMEOUT', 30);
|
||||
|
||||
// Configuration d'un serveur proxy
|
||||
// activer cette option a true pour demander au curl de passer par un proxy
|
||||
define('HIPAY_MAPI_CURL_PROXY_ON', false);
|
||||
// Adresse du proxy
|
||||
define('HIPAY_MAPI_CURL_PROXY', 'http://');
|
||||
// port du proxy
|
||||
define('HIPAY_MAPI_CURL_PROXYPORT','');
|
||||
|
||||
// Configuration d'un fichier de log pour curl en cas de pb de connexion avec le serveur Hipay
|
||||
define('HIPAY_MAPI_CURL_LOG_ON', false);
|
||||
// fichier de log de curl (sous environnement windows, le chemin du fichier pourra être de type C:\tmp\mapicurl.log)
|
||||
define('HIPAY_MAPI_CURL_LOGFILE', '/tmp/curl.log');
|
||||
|
||||
define('MAPI_VERSION','1.0');
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
<?php
|
||||
define('MAPI_EXCEPTION_AFFILIATE_BASE_ERROR',101);
|
||||
define('MAPI_EXCEPTION_AFFILIATE_UNKNOWN_AFFILIATE',102);
|
||||
define('MAPI_EXCEPTION_AFFILIATE_INCORRECT_EU',103);
|
||||
define('MAPI_EXCEPTION_AFFILIATE_CUSTOMER_ID_ERROR',104);
|
||||
define('MAPI_EXCEPTION_AFFILIATE_ACCOUNT_ID_ERROR',105);
|
||||
define('MAPI_EXCEPTION_AFFILIATE_VALUE_ERROR',106);
|
||||
define('MAPI_EXCEPTION_AFFILIATE_INCORRECT_TAG',107);
|
||||
|
||||
|
||||
define('MAPI_EXCEPTION_INSTALLMENT_BASE_ERROR',201);
|
||||
define('MAPI_EXCEPTION_INSTALLMENT_SETFIRST_ERROR',202);
|
||||
define('MAPI_EXCEPTION_INSTALLMENT_FIRST_BOOLEAN',203);
|
||||
define('MAPI_EXCEPTION_INSTALLMENT_PRICE_ERROR',204);
|
||||
define('MAPI_EXCEPTION_INSTALLMENT_INCORRECT_TAG',205);
|
||||
define('MAPI_EXCEPTION_INSTALLMENT_TAX_ERROR',206);
|
||||
|
||||
|
||||
define('MAPI_EXCEPTION_MULTIPLEP_ORDER_TAG_CONTENT_ERROR',301);
|
||||
define('MAPI_EXCEPTION_MULTIPLEP_ORDER_TAG_TOO_MANY_OBJECTS',302);
|
||||
define('MAPI_EXCEPTION_MULTIPLEP_ITEMS_TAG_CONTENT_ERROR',303);
|
||||
define('MAPI_EXCEPTION_MULTIPLEP_ITEMS_TAG_TOO_MANY_OBJECTS',304);
|
||||
define('MAPI_EXCEPTION_MULTIPLEP_INCORRECT_TAG',305);
|
||||
define('MAPI_EXCEPTION_MULTIPLEP_CONSTRUCT_ERROR',306);
|
||||
|
||||
|
||||
define('MAPI_EXCEPTION_ORDER_BASE_ERROR',401);
|
||||
define('MAPI_EXCEPTION_ORDER_UNKNOWN_CATEGORY',402);
|
||||
define('MAPI_EXCEPTION_ORDER_TITLE_ERROR',403);
|
||||
define('MAPI_EXCEPTION_ORDER_INFO_ERROR',404);
|
||||
define('MAPI_EXCEPTION_ORDER_UNKNOWN_TAG',405);
|
||||
define('MAPI_EXCEPTION_ORDER_SHIPPING_ERROR',406);
|
||||
define('MAPI_EXCEPTION_ORDER_INSURANCE_ERROR',407);
|
||||
define('MAPI_EXCEPTION_ORDER_FCOST_ERROR',408);
|
||||
define('MAPI_EXCEPTION_ORDER_AFFILIATE_ERROR',409);
|
||||
|
||||
|
||||
define('MAPI_EXCEPTION_SIMPLEP_ORDER_TAG_CONTENT_ERROR',501);
|
||||
define('MAPI_EXCEPTION_SIMPLEP_ITEMS_TAG_CONTENT_ERROR',502);
|
||||
define('MAPI_EXCEPTION_SIMPLEP_INCORRECT_TAG',503);
|
||||
define('MAPI_EXCEPTION_SIMPLEP_CONSTRUCT_ERROR',504);
|
||||
|
||||
define('MAPI_EXCEPTION_PARAMS_BASE_ERROR',601);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_LOGIN',602);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_PASSWORD',603);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_LOGIN_2',604);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_ITEM_ACCT',605);
|
||||
define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_ITEM_ACCT',606);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_ITEM_ACCT_2',607);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_TAX_ACCT',608);
|
||||
define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_TAX_ACCT',609);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_TAX_ACCT_2',610);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_INS_ACCT',611);
|
||||
define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_INS_ACCT',612);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_INS_ACCT_2',613);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_FCOST_ACCT',614);
|
||||
define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_FCOST_ACCT',615);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_FCOST_ACCT_2',616);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_SHIP_ACCT',617);
|
||||
define('MAPI_EXCEPTION_PARAMS_FORBIDDEN_SHIP_ACCT',618);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_SHIP_ACCT_2',619);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_EU_ID',620);
|
||||
define('MAPI_EXCEPTION_PARAMS_NO_LANG_AVAILABLE',621);
|
||||
define('MAPI_EXCEPTION_PARAMS_LANG_NOT_SUPPORTED',622);
|
||||
define('MAPI_EXCEPTION_PARAMS_NO_MEDIA_AVAILABLE',623);
|
||||
define('MAPI_EXCEPTION_PARAMS_MEDIA_NOT_SUPPORTED',624);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_RATING',625);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_PAYMENT_METHOD',626);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_CURRENCY',627);
|
||||
define('MAPI_EXCEPTION_PARAMS_INCORRECT_MERCH_SITE_ID',628);
|
||||
define('MAPI_EXCEPTION_PARAMS_LANG_ERROR',629);
|
||||
define('MAPI_EXCEPTION_PARAMS_MEDIA_ERROR',630);
|
||||
define('MAPI_EXCEPTION_PARAMS_RATING_ERROR',631);
|
||||
define('MAPI_EXCEPTION_PARAMS_METHOD_ERROR',632);
|
||||
define('MAPI_EXCEPTION_PARAMS_CAPTURE_DAY_ERROR',633);
|
||||
define('MAPI_EXCEPTION_PARAMS_CURRENCY_ERROR',634);
|
||||
define('MAPI_EXCEPTION_PARAMS_ID_MERCHANT_ERROR',635);
|
||||
define('MAPI_EXCEPTION_PARAMS_SITE_ID_ERROR',636);
|
||||
define('MAPI_EXCEPTION_PARAMS_URLOK_ERROR',637);
|
||||
define('MAPI_EXCEPTION_PARAMS_URLNOK_ERROR',638);
|
||||
define('MAPI_EXCEPTION_PARAMS_URLCAN_ERROR',639);
|
||||
define('MAPI_EXCEPTION_PARAMS_URLACK_ERROR',640);
|
||||
define('MAPI_EXCEPTION_PARAMS_ACKWD_ERROR',641);
|
||||
define('MAPI_EXCEPTION_PARAMS_EMAILACK_ERROR',642);
|
||||
define('MAPI_EXCEPTION_PARAMS_BGCOLOR_ERROR',643);
|
||||
define('MAPI_EXCEPTION_PARAMS_URLLOGO_ERROR',644);
|
||||
define('MAPI_EXCEPTION_PARAMS_MDATAS_ERROR',645);
|
||||
define('MAPI_EXCEPTION_PARAMS_UNKNOWN_TAG',646);
|
||||
define('MAPI_EXCEPTION_PARAMS_LOGIN_ERROR',647);
|
||||
define('MAPI_EXCEPTION_PARAMS_ACCTS_ERROR',648);
|
||||
define('MAPI_EXCEPTION_PARAMS_ID_GROUP_ERROR',649);
|
||||
|
||||
|
||||
define('MAPI_EXCEPTION_PRODUCT_BASE_ERROR',701);
|
||||
define('MAPI_EXCEPTION_PRODUCT_NAME_ERROR',702);
|
||||
define('MAPI_EXCEPTION_PRODUCT_INFO_ERROR',703);
|
||||
define('MAPI_EXCEPTION_PRODUCT_QUANTITY_ERROR',704);
|
||||
define('MAPI_EXCEPTION_PRODUCT_REF_ERROR',705);
|
||||
define('MAPI_EXCEPTION_PRODUCT_CATEGORY_ERROR',706);
|
||||
define('MAPI_EXCEPTION_PRODUCT_PRICE_ERROR',707);
|
||||
define('MAPI_EXCEPTION_PRODUCT_INCORRECT_TAG',708);
|
||||
define('MAPI_EXCEPTION_PRODUCT_TAX_ERROR',709);
|
||||
|
||||
define('MAPI_EXCEPTION_TAX_BASE_ERROR',801);
|
||||
define('MAPI_EXCEPTION_TAX_NAME_ERROR',802);
|
||||
define('MAPI_EXCEPTION_TAX_ACCOUNT_ERROR',803);
|
||||
define('MAPI_EXCEPTION_TAX_PERCENTAGE_NOT_BOOLEAN_ERROR',804);
|
||||
define('MAPI_EXCEPTION_TAX_VALUE_ERROR',805);
|
||||
define('MAPI_EXCEPTION_TAX_INCORRECT_TAG',806);
|
||||
|
||||
class MAPI_Exception extends Exception {
|
||||
private $keyword;
|
||||
private $value;
|
||||
function __construct($keyword,$value,$msg,$code=0) {
|
||||
$this->keyword=$keyword;
|
||||
$this->value=$value;
|
||||
parent::__construct($msg,$code);
|
||||
}
|
||||
|
||||
public function getKeyword() {
|
||||
return $this->keyword;
|
||||
}
|
||||
public function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Représente la ligne de la commande pour un paiement récurrent
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Installment extends HIPAY_MAPI_Item {
|
||||
|
||||
/**
|
||||
* Montant HT
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $price;
|
||||
|
||||
/**
|
||||
* Taxes s'appliquant à ce paiement
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tax;
|
||||
|
||||
/**
|
||||
* Indique s'il s'agit du premier paiement (true) ou des suivants (false)
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $first;
|
||||
|
||||
/**
|
||||
* Délai avant le déclenchement du premier paiement (si $first=true),
|
||||
* ou interval entre les paiements suivants (si $first=false)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $paymentDelay;
|
||||
|
||||
/**
|
||||
* timestamp du premier paiement ou des paiements récurrents
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_delayTS;
|
||||
|
||||
|
||||
/**
|
||||
* Assigne le montant HT
|
||||
*
|
||||
* @param float $price
|
||||
* @return boolean
|
||||
*/
|
||||
public function setPrice($price) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$price = sprintf('%.02f',(float)$price);
|
||||
if ($price<0)
|
||||
return false;
|
||||
$this->price=$price;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant HT
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getPrice() {
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini s'il s'agit du premier paiement ou des suivants et le délai de déclenchement
|
||||
*
|
||||
* @param boolean $first
|
||||
* @param string $paymentDelay
|
||||
* @return boolean
|
||||
*/
|
||||
public function setFirst($first,$paymentDelay) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
if (!is_bool($first))
|
||||
return false;
|
||||
$paymentDelay=trim($paymentDelay);
|
||||
if ($first) {
|
||||
if (!preg_match("#[0-9]+[HDM]#",$paymentDelay))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!preg_match("#[0-9]+[DM]#",$paymentDelay)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$num = (int)substr($paymentDelay,0,strlen($paymentDelay)-1);
|
||||
if (($num<1 && !$first) || ($num<0 && $first) || $num>365) {
|
||||
return false;
|
||||
}
|
||||
$this->first=$first;
|
||||
$this->paymentDelay=$paymentDelay;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne les taxes s'appliquant à ce paiement
|
||||
*
|
||||
* @param array $tax
|
||||
* @return boolean
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($tax,'HIPAY_MAPI_Tax'))
|
||||
return false;
|
||||
foreach ($tax as $obj)
|
||||
$this->tax[]= clone $obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* assigne le timestamp du premier paiement ou des paiements récurrents
|
||||
*
|
||||
*/
|
||||
public function setDelayTS( $baseTS=0 )
|
||||
{
|
||||
if( (int)$baseTS <= 0 ) {
|
||||
$baseTS = time();
|
||||
}
|
||||
|
||||
switch( substr($this->paymentDelay, -1, 1) ) {
|
||||
case 'd': case 'D': $unit='day'; break;
|
||||
case 'm': case 'M': $unit='month'; break;
|
||||
case 'h': case 'H':
|
||||
default : $unit='hour'; break;
|
||||
}
|
||||
|
||||
$this->_delayTS = strtotime( '+'.substr($this->paymentDelay, 0, -1).' '.$unit, $baseTS );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les taxes s'appliquant à ce paiement
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne s'il s'agit du premier paiement
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFirst() {
|
||||
return $this->first;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le délai de déclenchement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentDelay() {
|
||||
return $this->paymentDelay;
|
||||
}
|
||||
|
||||
/**
|
||||
* retourne le timestamp du premier paiement
|
||||
*
|
||||
*/
|
||||
public function getDelayTS()
|
||||
{
|
||||
return $this->_delayTS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie si l'objet est correctement initialisé
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function check() {
|
||||
if ($this->price<0)
|
||||
throw new Exception('Montant invalide ou pas initilisé');
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($this->tax,'HIPAY_MAPI_Tax'))
|
||||
throw new Exception('Taxes invalides ou pas initialisées');
|
||||
foreach($this->tax as $obj) {
|
||||
if (!$obj->check())
|
||||
return false;
|
||||
}
|
||||
if (!is_bool($this->first))
|
||||
throw new Exception('Premier paiement ou suivant n\'est pas initialisé');
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function init()
|
||||
{
|
||||
$this->price = -1;
|
||||
$this->tax = array();
|
||||
$this->first = '';
|
||||
$this->paymentDelay = '';
|
||||
$this->_delayTS = '';
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->init();
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Représente une ligne de la commande
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Item extends HIPAY_MAPI_lockable {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return '';
|
||||
}
|
||||
public function getInfo() {
|
||||
return '';
|
||||
}
|
||||
public function getQuantity() {
|
||||
return 1;
|
||||
}
|
||||
public function getRef() {
|
||||
return '';
|
||||
}
|
||||
public function getCategory() {
|
||||
return 1;
|
||||
}
|
||||
public function getPrice() {
|
||||
return 0;
|
||||
}
|
||||
public function getTax() {
|
||||
return array();
|
||||
}
|
||||
public function check() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
class HIPAY_MAPI_lockable extends HIPAY_MAPI_XML {
|
||||
/**
|
||||
* Etat du vérou
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_locked;
|
||||
|
||||
/**
|
||||
* Vérouille l'objet
|
||||
*
|
||||
*/
|
||||
public function lock() {
|
||||
$this->_locked=true;
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->_locked=false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Représente un paiement récurrent
|
||||
* Un paiement simple contient :
|
||||
* - 1 objet paramètres HIPAY_MAPI_PaymentParams
|
||||
* - 1 objet order pour le premier paiement HIPAY_MAPI_Order
|
||||
* - 1 objet installment pour le premier paiement HIPAY_MAPI_Installment
|
||||
* - 1 objet order pour le second paiement HIPAY_MAPI_Order
|
||||
* - 1 objet installment pour le second paiement HIPAY_MAPI_Installment
|
||||
*
|
||||
*/
|
||||
|
||||
class HIPAY_MAPI_MultiplePayment extends HIPAY_MAPI_Payment {
|
||||
function __construct(HIPAY_MAPI_PaymentParams $paymentParams,HIPAY_MAPI_Order $firstOrder,HIPAY_MAPI_Installment $firstInstallment,HIPAY_MAPI_Order $nextOrder,HIPAY_MAPI_Installment $nextInstallment) {
|
||||
if ($firstInstallment->getFirst()===$nextInstallment->getFirst() || !$firstInstallment->getFirst()) {
|
||||
throw new Exception('Vous devez définir un objet installment pour le premier et les paiements suivants');
|
||||
}
|
||||
$firstInstallment->setDelayTS();
|
||||
$nextInstallment->setDelayTS( $firstInstallment->getDelayTS() );
|
||||
try {
|
||||
parent::__construct($paymentParams,array($firstOrder,$nextOrder),array($firstInstallment,$nextInstallment));
|
||||
} catch(Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total de la somme devant être
|
||||
* distribuée aux affiliés
|
||||
*/
|
||||
protected function _getTotalAmountForAffiliates($installement_nr) {
|
||||
$affiliates=$this->order[0]->getAffiliate();
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($affiliates,'HIPAY_MAPI_Affiliate'))
|
||||
return false;
|
||||
$total_aff = 0;
|
||||
foreach($affiliates as $aff) {
|
||||
$total_aff+=$aff->getAmount();
|
||||
}
|
||||
return $total_aff;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,370 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Objet représentant les informations de la commande
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Order extends HIPAY_MAPI_lockable {
|
||||
|
||||
/**
|
||||
* Montant des frais de livraison
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $shippingAmount;
|
||||
|
||||
/**
|
||||
* Taxes s'appliquants aux frais de livraison
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $shippingTax;
|
||||
|
||||
/**
|
||||
* Montant des assurances
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $insuranceAmount;
|
||||
|
||||
/**
|
||||
* Taxes s'appliquants aux assurances
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $insuranceTax;
|
||||
|
||||
/**
|
||||
* Montant des coûts fixes
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $fixedCostAmount;
|
||||
|
||||
/**
|
||||
* Taxes s'appliquants aux coûts fixes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fixedCostTax;
|
||||
|
||||
/**
|
||||
* Affiliés
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $affiliate;
|
||||
|
||||
/**
|
||||
* Intitulé de la commande
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $orderTitle;
|
||||
|
||||
/**
|
||||
* Informations sur la commande
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $orderInfo;
|
||||
|
||||
/**
|
||||
* Catégorie de la commande
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $orderCategory;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Défini le montant des frais d'envoi et les taxes s'y appliquant
|
||||
*
|
||||
* @param float $shippingAmount
|
||||
* @param array $shippingTax
|
||||
* @return boolean
|
||||
*/
|
||||
public function setShipping($shippingAmount,$shippingTax) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$shippingAmount = sprintf('%.02f',(float)$shippingAmount);
|
||||
if ($shippingAmount<0) {
|
||||
return false;
|
||||
}
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($shippingTax,'HIPAY_MAPI_Tax')) {
|
||||
return false;
|
||||
}
|
||||
$this->shippingAmount=$shippingAmount;
|
||||
foreach ($shippingTax as $obj)
|
||||
$this->shippingTax[]= clone $obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des frais d'envoi
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getShippingAmount() {
|
||||
return $this->shippingAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les taxes s'appliquants aux frais d'envoi
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function &getShippingTax() {
|
||||
return $this->shippingTax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le montant des assurances
|
||||
*
|
||||
* @param float $insuranceAmount
|
||||
* @param array $insuranceTax
|
||||
* @return boolean
|
||||
*/
|
||||
public function setInsurance($insuranceAmount,$insuranceTax) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$insuranceAmount = sprintf('%.02f',(float)$insuranceAmount);
|
||||
if ($insuranceAmount<0)
|
||||
return false;
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($insuranceTax,'HIPAY_MAPI_Tax'))
|
||||
return false;
|
||||
$this->insuranceAmount=$insuranceAmount;
|
||||
foreach ($insuranceTax as $obj)
|
||||
$this->insuranceTax[]= clone $obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des assurances
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getInsuranceAmount() {
|
||||
return $this->insuranceAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les taxes s'appliquants aux assurances
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function &getInsuranceTax() {
|
||||
return $this->insuranceTax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le montant des coûts fixes et les taxes s'y appliquant
|
||||
*
|
||||
* @param float $fixedCostAmount
|
||||
* @param array $fixedCostTax
|
||||
* @return boolean
|
||||
*/
|
||||
public function setFixedCost($fixedCostAmount,$fixedCostTax) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$fixedCostAmount = sprintf('%.02f',(float)$fixedCostAmount);
|
||||
if ($fixedCostAmount<0)
|
||||
return false;
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($fixedCostTax,'HIPAY_MAPI_Tax'))
|
||||
return false;
|
||||
$this->fixedCostAmount=$fixedCostAmount;
|
||||
foreach ($fixedCostTax as $obj)
|
||||
$this->fixedCostTax[]= clone $obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des coûts fixes
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getFixedCostAmount() {
|
||||
return $this->fixedCostAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les taxes s'appliquant aux coûts fixes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function &getFixedCostTax() {
|
||||
return $this->fixedCostTax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini les affiliés qui recevront une rétribution pour cette commande
|
||||
*
|
||||
* @param array $affiliate
|
||||
* @return boolean
|
||||
*/
|
||||
public function setAffiliate($affiliate) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($affiliate,'HIPAY_MAPI_Affiliate'))
|
||||
return false;
|
||||
foreach ($affiliate as $obj)
|
||||
$this->affiliate[]= clone $obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la liste des affiliés de cette commande
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function &getAffiliate() {
|
||||
return $this->affiliate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne l'intitulé de la commande
|
||||
*
|
||||
* @param string $orderTitle
|
||||
* @return boolean
|
||||
*/
|
||||
public function setOrderTitle($orderTitle) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$orderTitle = HIPAY_MAPI_UTF8::forceUTF8($orderTitle);
|
||||
$len=HIPAY_MAPI_UTF8::strlen_utf8($orderTitle);
|
||||
if ($len<1 || $len>HIPAY_MAPI_MAX_TITLE_LENGTH)
|
||||
return false;
|
||||
$this->orderTitle=$orderTitle;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'intitulé de la commande
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderTitle() {
|
||||
return $this->orderTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne les infos sur la commande
|
||||
*
|
||||
* @param string $orderInfo
|
||||
* @return boolean
|
||||
*/
|
||||
public function setOrderInfo($orderInfo) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$orderInfo = HIPAY_MAPI_UTF8::forceUTF8($orderInfo);
|
||||
$len=HIPAY_MAPI_UTF8::strlen_utf8($orderInfo);
|
||||
if ($len>HIPAY_MAPI_MAX_INFO_LENGTH)
|
||||
return false;
|
||||
$this->orderInfo=$orderInfo;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les infos sur la commande
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderInfo() {
|
||||
return $this->orderInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assigne la catégorie de la commande
|
||||
*
|
||||
* @param int $orderCategory
|
||||
* @return boolean
|
||||
*/
|
||||
public function setOrderCategory($orderCategory) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$orderCategory = (int)$orderCategory;
|
||||
if ($orderCategory<1)
|
||||
return false;
|
||||
$this->orderCategory=$orderCategory;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la catégorie de la commande
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getOrderCategory() {
|
||||
return $this->orderCategory;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Vérifie si l'objet est correctement initialisé
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function check() {
|
||||
if ($this->orderTitle=='' || $this->orderCategory<0)
|
||||
throw new Exception('L\'intitulé et/ou la catégorie de la commande sont manquants');
|
||||
|
||||
foreach($this->affiliate as $obj) {
|
||||
try {
|
||||
$obj->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
foreach($this->shippingTax as $obj) {
|
||||
try {
|
||||
$obj->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
foreach($this->insuranceTax as $obj) {
|
||||
try {
|
||||
$obj->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
foreach($this->fixedCostTax as $obj) {
|
||||
try {
|
||||
$obj->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function init() {
|
||||
$this->shippingAmount=0;
|
||||
$this->shippingTax=array();
|
||||
$this->insuranceAmount=0;
|
||||
$this->insuranceTax=array();
|
||||
$this->fixedCostAmount=0;
|
||||
$this->fixedCostTax=array();
|
||||
$this->affiliate=array();
|
||||
$this->orderTitle='';
|
||||
$this->orderInfo='';
|
||||
$this->orderCategory=-1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function __construct() {
|
||||
$this->init();
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
$_mapi_dir=dirname(__FILE__);
|
||||
require_once($_mapi_dir.'/mapi_defs.php');
|
||||
require_once($_mapi_dir.'/mapi_utils.php');
|
||||
require_once($_mapi_dir.'/mapi_utf8.php');
|
||||
require_once($_mapi_dir.'/mapi_xml.php');
|
||||
require_once($_mapi_dir.'/mapi_send_xml.php');
|
||||
require_once($_mapi_dir.'/mapi_comm_xml.php');
|
||||
require_once($_mapi_dir.'/mapi_lockable.php');
|
||||
|
||||
require_once($_mapi_dir.'/mapi_tax.php');
|
||||
require_once($_mapi_dir.'/mapi_affiliate.php');
|
||||
require_once($_mapi_dir.'/mapi_item.php');
|
||||
require_once($_mapi_dir.'/mapi_installment.php');
|
||||
require_once($_mapi_dir.'/mapi_product.php');
|
||||
require_once($_mapi_dir.'/mapi_paymentparams.php');
|
||||
require_once($_mapi_dir.'/mapi_order.php');
|
||||
require_once($_mapi_dir.'/mapi_payment.php');
|
||||
require_once($_mapi_dir.'/mapi_multiplepayment.php');
|
||||
require_once($_mapi_dir.'/mapi_simplepayment.php');
|
||||
@@ -1,447 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Représente un paiement.
|
||||
* N'est pas utilisé directement
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Payment extends HIPAY_MAPI_XML {
|
||||
|
||||
/**
|
||||
* Paramètres du paiement
|
||||
*
|
||||
* @var HIPAY_MAPI_PaymentParams
|
||||
*/
|
||||
protected $paymentParams;
|
||||
|
||||
/**
|
||||
* Objets HIPAY_MAPI_Order
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $order;
|
||||
|
||||
/**
|
||||
* Objets HIPAY_MAPI_Item
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $items;
|
||||
|
||||
/**
|
||||
* Total des taxes sur les produits
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_taxItemsAmount;
|
||||
|
||||
/**
|
||||
* Total des taxes sur les frais d'envoi
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_taxShippingAmount;
|
||||
/**
|
||||
* Total des taxes sur les assurances
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_taxInsuranceAmount;
|
||||
|
||||
/**
|
||||
* Total des taxes sur les coûts fixes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_taxFixedCostAmount;
|
||||
|
||||
/**
|
||||
* Total du montant HT des produits
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_itemsTotalAmount;
|
||||
|
||||
/**
|
||||
* Total des taxes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $_taxTotalAmount;
|
||||
|
||||
/**
|
||||
* Total de la commande hors taxes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_orderTotalAmountHT;
|
||||
|
||||
/**
|
||||
* Total de la commande
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_orderTotalAmount;
|
||||
|
||||
|
||||
/**
|
||||
* Total des affilies
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_affiliateTotalAmount;
|
||||
|
||||
|
||||
public function __construct($paymentParams,$order,$items) {
|
||||
try {
|
||||
$this->init($paymentParams,$order,$items);
|
||||
} catch(Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
protected function init($paymentParams,$order,$items) {
|
||||
if (!($paymentParams instanceof HIPAY_MAPI_PaymentParams)
|
||||
|| !HIPAY_MAPI_UTILS::is_an_array_of($order,'HIPAY_MAPI_Order')
|
||||
|| !HIPAY_MAPI_UTILS::is_an_array_of($items,'HIPAY_MAPI_Item')
|
||||
|| count($items)<1)
|
||||
throw new Exception('Wrong parameters');
|
||||
|
||||
try {
|
||||
$paymentParams->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
foreach($order as $orderObj) {
|
||||
try {
|
||||
$orderObj->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
foreach($items as $obj)
|
||||
try {
|
||||
$obj->check();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
|
||||
$this->paymentParams= clone $paymentParams;
|
||||
$this->paymentParams->lock();
|
||||
|
||||
|
||||
foreach($order as $obj) {
|
||||
$this->order[]= clone $obj;
|
||||
end($this->order)->lock();
|
||||
$this->_taxItemsAmount[]=0;
|
||||
$this->_taxShippingAmount[]=0;
|
||||
$this->_taxInsuranceAmount[]=0;
|
||||
$this->_taxFixedCostAmount[]=0;
|
||||
$this->_itemsTotalAmount[]=0;
|
||||
$this->_taxTotalAmount[]=0;
|
||||
$this->_orderTotalAmount[]=0;
|
||||
$this->_affiliateTotalAmount[]=0;
|
||||
|
||||
}
|
||||
foreach($items as $obj) {
|
||||
$this->items[]= clone $obj;
|
||||
end($this->items)->lock();
|
||||
}
|
||||
try {
|
||||
$this->compute();
|
||||
} catch(Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul les différents montants (taxes, affiliés, totaux) de la commande
|
||||
*
|
||||
*/
|
||||
protected function compute() {
|
||||
|
||||
// Mise à jour du montant total des taxes pour chaque item du tableau _taxItemsAmount
|
||||
// Mise à jour du montant total des taxes de livraison pour chaque order du tableau _taxShippingAmount
|
||||
// Mise à jour du montant total des taxes d'assurances pour chaque order du tableau _taxInsuranceAmount
|
||||
// Mise à jour du montant total des taxes de couts fixes pour chaque order du tableau _taxFixedCostAmount
|
||||
$this->computeTaxes();
|
||||
// Mise a jour du montant total HT des produits pour chaque item du tableau _itemsTotalAmount
|
||||
$this->computeItemsAmount();
|
||||
// Pour chaque commande
|
||||
foreach($this->order as $key=>$order) {
|
||||
$this->_taxTotalAmount[$key] = $this->_taxItemsAmount[$key] + $this->_taxShippingAmount[$key] + $this->_taxInsuranceAmount[$key] + $this->_taxFixedCostAmount[$key];
|
||||
$this->_orderTotalAmountHT[$key] = $order->getShippingAmount() + $order->getInsuranceAmount() + $order->getFixedCostAmount() + $this->_itemsTotalAmount[$key];
|
||||
$this->_orderTotalAmount[$key] = $this->_orderTotalAmountHT[$key] + $this->_taxTotalAmount[$key];
|
||||
// $this->_orderTotalAmount[$key] = $order->getShippingAmount() + $order->getInsuranceAmount() + $order->getFixedCostAmount() + $this->_itemsTotalAmount[$key] +
|
||||
// $this->_taxItemsAmount[$key] +
|
||||
// $this->_taxShippingAmount[$key] +
|
||||
// $this->_taxInsuranceAmount[$key] +
|
||||
// $this->_taxFixedCostAmount[$key];
|
||||
}
|
||||
try {
|
||||
$this->computeAffiliates();
|
||||
} catch(Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calcul le montant des taxes
|
||||
*
|
||||
*/
|
||||
protected function computeTaxes() {
|
||||
|
||||
// Taxes sur les produits au niveau de l'item (ligne de commande)
|
||||
// @FIXME bug et confusion entre indice d'item et indice d'order ?
|
||||
$cur=0;
|
||||
// pour chaque ligne de commande
|
||||
foreach($this->items as $item) {
|
||||
// Liste des taxes de la ligne
|
||||
$itemTaxes= $item->getTax();
|
||||
$tItemsAmount=0;
|
||||
// pour chaque taxe appliquée sur cette ligne
|
||||
foreach($itemTaxes as $tax) {
|
||||
$amount=HIPAY_MAPI_UTILS::computeTax($item->getPrice(),$tax);
|
||||
$tax->setTaxAmount($amount);
|
||||
$tax->lock();
|
||||
// mise a jour du montant total des taxes pour cet item (ligne de commande)
|
||||
$tItemsAmount+=$amount;
|
||||
}
|
||||
if (!isset($this->order[$cur]))
|
||||
$cur=0;
|
||||
if (!isset($this->_taxItemsAmount[$cur]))
|
||||
$this->_taxItemsAmount[$cur]=0;
|
||||
// mise a jour du montant total des taxes pour cette ligne de commande
|
||||
// avec prise en compte du nombre de produits dans l'indice numLigneCommande
|
||||
// du tableau _taxItemsAmount de cette commande
|
||||
$this->_taxItemsAmount[$cur]+=($tItemsAmount*$item->getQuantity());
|
||||
$item->lock();
|
||||
$cur++;
|
||||
}
|
||||
|
||||
// Taxes sur frais d'envoi, assurances, coûts fixes
|
||||
// au niveau des commandes
|
||||
$cur=0;
|
||||
foreach($this->order as $order) {
|
||||
// Taxes sur frais d'envoi
|
||||
$taxArr =& $order->getShippingTax();
|
||||
foreach($taxArr as $key=>$tax) {
|
||||
$amount=HIPAY_MAPI_UTILS::computeTax($order->getShippingAmount(),$tax);
|
||||
$taxArr[$key]->setTaxAmount($amount);
|
||||
$taxArr[$key]->lock();
|
||||
|
||||
if (!isset($this->_taxShippingAmount[$cur]))
|
||||
$this->_taxShippingAmount[$cur]=0;
|
||||
$this->_taxShippingAmount[$cur]+=$amount;
|
||||
}
|
||||
// Taxes sur assurances
|
||||
$taxArr =& $order->getInsuranceTax();
|
||||
foreach($taxArr as $key=>$tax) {
|
||||
$amount=HIPAY_MAPI_UTILS::computeTax($order->getInsuranceAmount(),$tax);
|
||||
$taxArr[$key]->setTaxAmount($amount);
|
||||
$taxArr[$key]->lock();
|
||||
if (!isset($this->_taxInsuranceAmount[$cur]))
|
||||
$this->_taxInsuranceAmount[$cur]=0;
|
||||
$this->_taxInsuranceAmount[$cur]+=$amount;
|
||||
}
|
||||
// Taxes sur coûts fixes
|
||||
$taxArr =& $order->getFixedCostTax();
|
||||
foreach($taxArr as $key=>$tax) {
|
||||
$amount=HIPAY_MAPI_UTILS::computeTax($order->getFixedCostAmount(),$tax);
|
||||
$taxArr[$key]->setTaxAmount($amount);
|
||||
$taxArr[$key]->lock();
|
||||
if (!isset($this->_taxFixedCostAmount[$cur]))
|
||||
$this->_taxFixedCostAmount[$cur]=0;
|
||||
$this->_taxFixedCostAmount[$cur]+=$amount;
|
||||
}
|
||||
$cur++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul le montant total HT des produits
|
||||
*
|
||||
*/
|
||||
protected function computeItemsAmount() {
|
||||
$itemsAmount=0;
|
||||
$cur=0;
|
||||
foreach($this->items as $item) {
|
||||
$mt=sprintf("%.02f",$item->getPrice()*$item->getQuantity());
|
||||
|
||||
if (!isset($this->order[$cur]))
|
||||
$cur=0;
|
||||
if (!isset($this->_itemsTotalAmount[$cur]))
|
||||
$this->_itemsTotalAmount[$cur]=0;
|
||||
$this->_itemsTotalAmount[$cur]+=$mt;
|
||||
$cur++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total des taxes
|
||||
*
|
||||
* @param array $tItemsAmount
|
||||
* @param array $tShippingAmount
|
||||
* @param array $tInsuranceAmount
|
||||
* @param array $tFixedCostAmount
|
||||
*/
|
||||
public function getTotalTaxes(&$tItemsAmount,&$tShippingAmount,&$tInsuranceAmount,&$tFixedCostAmount) {
|
||||
$tItemsAmount=$this->getItemsTaxes();
|
||||
$tShippingAmount=$this->getShippingTaxes();
|
||||
$tInsuranceAmount=$this->getInsuranceTaxes();
|
||||
$tFixedCostAmount=$this->getFixedCostTaxes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des taxes sur les articles
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getItemsTaxes() {
|
||||
return $this->_taxItemsAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des taxes sur les frais de port
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getShippingTaxes() {
|
||||
return $this->_taxShippingAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des taxes sur les assurances
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getInsuranceTaxes() {
|
||||
return $this->_taxInsuranceAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant des taxes sur les couts fixes
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getFixedCostTaxes() {
|
||||
return $this->_taxFixedCostAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total des produits
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getItemsTotalAmount() {
|
||||
return $this->_itemsTotalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total des taxes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTaxesTotalAmount() {
|
||||
return $this->_taxTotalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total hors taxes de la commande
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOrderTotalAmountHT() {
|
||||
return $this->_orderTotalAmountHT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total TTC de la commande
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOrderTotalAmount() {
|
||||
return $this->_orderTotalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant total des affiliés
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAffiliateTotalAmount() {
|
||||
return $this->_affiliateTotalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les objets order
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOrder() {
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les objets items
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getItems() {
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'objet paramètre
|
||||
*
|
||||
* @return HIPAY_MAPI_PaymentParams
|
||||
*/
|
||||
public function getPaymentParams() {
|
||||
return $this->paymentParams;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calcul les montants à redistribuer aux affiliés
|
||||
*
|
||||
*/
|
||||
protected function computeAffiliates() {
|
||||
|
||||
|
||||
foreach($this->order as $k=>$order) {
|
||||
$totalAmount=0;
|
||||
$tAffiliate = $order->getAffiliate();
|
||||
foreach($tAffiliate as $key=>$affiliate) {
|
||||
$baseAmount=0;
|
||||
$percentageTarget= $affiliate->getPercentageTarget();
|
||||
if ($percentageTarget>0) {
|
||||
if ($percentageTarget & HIPAY_MAPI_TTARGET_ITEM)
|
||||
$baseAmount+=$this->_itemsTotalAmount[$k];
|
||||
if ($percentageTarget & HIPAY_MAPI_TTARGET_TAX)
|
||||
$baseAmount+=$this->_taxItemsAmount[$k]+$this->_taxFixedCostAmount[$k]+$this->_taxInsuranceAmount[$k]+$this->_taxShippingAmount[$k];
|
||||
if ($percentageTarget& HIPAY_MAPI_TTARGET_INSURANCE)
|
||||
$baseAmount+=$order->getInsuranceAmount();
|
||||
if ($percentageTarget & HIPAY_MAPI_TTARGET_FCOST)
|
||||
$baseAmount+=$order->getFixedCostAmount();
|
||||
if ($percentageTarget & HIPAY_MAPI_TTARGET_SHIPPING)
|
||||
$baseAmount+=$order->getShippingAmount();
|
||||
$tAffiliate[$key]->setBaseAmount($baseAmount);
|
||||
} else {
|
||||
$baseAmount = $affiliate->getValue();
|
||||
$tAffiliate[$key]->setBaseAmount($baseAmount);
|
||||
}
|
||||
$totalAmount+=$tAffiliate[$key]->getAmount();
|
||||
$tAffiliate[$key]->lock();
|
||||
}
|
||||
$this->_affiliateTotalAmount[$k]=$totalAmount;
|
||||
if ($totalAmount > $this->_orderTotalAmount[$k]) {
|
||||
throw new Exception('Le montant à redistribuer est supérieur au montant de la transaction ('.$totalAmount.'/'.$this->_orderTotalAmount.')');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,849 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Paramètres
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_PaymentParams extends HIPAY_MAPI_lockable {
|
||||
|
||||
/**
|
||||
* Nom d'utilisateur pour se connecter à la plateforme
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $login;
|
||||
|
||||
/**
|
||||
* Mot de passe de connexion
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Compte sur lequel verser le montant HT des produits
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $itemAccount;
|
||||
|
||||
/**
|
||||
* Compte sur lequel verser le montant des taxes
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $taxAccount;
|
||||
|
||||
/**
|
||||
* Compte sur lequel verser le montant des assurances
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $insuranceAccount;
|
||||
|
||||
/**
|
||||
* Compte sur lequel verser le montant des coûts fixes
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $fixedCostAccount;
|
||||
|
||||
/**
|
||||
* Compte sur lequel verser le montant des frais de livraison
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $shippingCostAccount;
|
||||
|
||||
/**
|
||||
* Langue par défaut de l'interface de paiement
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $defaultLang;
|
||||
|
||||
/**
|
||||
* Type d'interface de paiement
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $media;
|
||||
|
||||
/**
|
||||
* Classe d'age à laquelle s'applique cette vente
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $rating;
|
||||
|
||||
/**
|
||||
* Type du paiement (simple ou récurrent)
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $paymentMethod;
|
||||
|
||||
/**
|
||||
* Délai de capture
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $captureDay;
|
||||
|
||||
/**
|
||||
* Devise dans laquelle sont exprimés les montants
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $currency;
|
||||
|
||||
/**
|
||||
* Identifiant de cette vente pour le marchant
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $idForMerchant;
|
||||
|
||||
/**
|
||||
* Identifiant du site marchand tel que renseigné
|
||||
* dans l'interface marchande de la plateforme
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $merchantSiteId;
|
||||
|
||||
|
||||
/**
|
||||
* Identifiant du groupe statistique auquel appartient ce paiement
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $statsGroupId;
|
||||
|
||||
|
||||
/**
|
||||
* Données propres au marchand
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $merchantDatas;
|
||||
|
||||
/**
|
||||
* Url sur laquelle est redirigée le client si le paiement est ok
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $url_ok;
|
||||
|
||||
/**
|
||||
* Url sur laquelle est redirigée le client si le paiement n'est pas ok
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $url_nok;
|
||||
|
||||
/**
|
||||
* Url sur laquelle est redirigée le client si le paiement est annulé
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $url_cancel;
|
||||
|
||||
/**
|
||||
* Url du script qui sera appellé pour signifier le résultat du paiement
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $url_ack;
|
||||
|
||||
/**
|
||||
* Chaine de caractère devant etre retournée par le script $url_ack
|
||||
* pour informer de la bonne réception des informations
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $ack_wd;
|
||||
|
||||
/**
|
||||
* Adresse email vers laquelle la plateforme enverra un email
|
||||
* pour informer d'un nouveau paiement
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $email_ack;
|
||||
|
||||
/**
|
||||
* code hexa de la couleur de fond de l'interface
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $bg_color;
|
||||
|
||||
/**
|
||||
* Url du logo du marchand
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $logo_url;
|
||||
|
||||
|
||||
/**
|
||||
* Assigne le login et le mot de passe
|
||||
*
|
||||
* @param string $login
|
||||
* @param string $password
|
||||
* @return boolean
|
||||
*/
|
||||
public function setLogin($login,$password) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$login = HIPAY_MAPI_UTF8::forceUTF8($login);
|
||||
if (empty($login))
|
||||
return false;
|
||||
$password = HIPAY_MAPI_UTF8::forceUTF8($password);
|
||||
if (empty($password))
|
||||
return false;
|
||||
$this->login=$login;
|
||||
$this->password=$password;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le login
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogin() {
|
||||
return $this->login;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le mot de passe
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword() {
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne les comptes sur lesquels seront versés les différents montants
|
||||
*
|
||||
* @param int $itemAccount
|
||||
* @param int $taxAccount
|
||||
* @param int $insuranceAccount
|
||||
* @param int $fixedCostAccount
|
||||
* @param int $shippingCostAccount
|
||||
* @return boolean
|
||||
*/
|
||||
public function setAccounts($itemAccount,$taxAccount=0,$insuranceAccount=0,$fixedCostAccount=0,$shippingCostAccount=0) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$itemAccount=(int)$itemAccount;
|
||||
$taxAccount=(int)$taxAccount;
|
||||
$insuranceAccount=(int)$insuranceAccount;
|
||||
$fixedCostAccount=(int)$fixedCostAccount;
|
||||
$shippingCostAccount=(int)$shippingCostAccount;
|
||||
|
||||
if ($itemAccount<=0)
|
||||
return false;
|
||||
if ($taxAccount<=0)
|
||||
$taxAccount=$itemAccount;
|
||||
if ($insuranceAccount<=0)
|
||||
$insuranceAccount=$itemAccount;
|
||||
if ($fixedCostAccount<=0)
|
||||
$fixedCostAccount=$itemAccount;
|
||||
if ($shippingCostAccount<=0)
|
||||
$shippingCostAccount=$itemAccount;
|
||||
$this->itemAccount = $itemAccount;
|
||||
$this->taxAccount = $taxAccount;
|
||||
$this->insuranceAccount = $insuranceAccount;
|
||||
$this->fixedCostAccount = $fixedCostAccount;
|
||||
$this->shippingCostAccount = $shippingCostAccount;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de compte sur lequel sera versé
|
||||
* le montant de produits
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getItemAccount() {
|
||||
return $this->itemAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de compte sur lequel sera versé
|
||||
* le montant des taxes
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTaxAccount() {
|
||||
return $this->taxAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de compte sur lequel sera versé
|
||||
* le montant des assurances
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getInsuranceAccount() {
|
||||
return $this->insuranceAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de compte sur lequel sera versé
|
||||
* le montant des coûts fixes
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFixedCostAccount() {
|
||||
return $this->fixedCostAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le numéro de compte sur lequel sera versé
|
||||
* le montant des frais d'envoi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getShippingCostAccount() {
|
||||
return $this->shippingCostAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne la lange par défaut (AZ_az = pays_langue)
|
||||
*
|
||||
* @param string $defaultLang
|
||||
* @return boolean
|
||||
*/
|
||||
public function setDefaultLang($defaultLang) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
if (!preg_match('#^[A-Z]{2}_[a-z]{2}$#',$defaultLang))
|
||||
return false;
|
||||
$this->defaultLang=$defaultLang;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la langue par défaut
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultLang() {
|
||||
return $this->defaultLang;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le type d'interface de paiement
|
||||
*
|
||||
* @param string $media
|
||||
* @return boolean
|
||||
*/
|
||||
public function setMedia($media) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
if (!preg_match('#^[A-Z]+$#',$media))
|
||||
return false;
|
||||
$this->media=$media;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le type d'interface de paiement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMedia() {
|
||||
return $this->media;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le public visé
|
||||
*
|
||||
* @param string $rating
|
||||
* @return boolean
|
||||
*/
|
||||
public function setRating($rating) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$rating = trim(substr($rating,0,HIPAY_MAPI_MAX_RATING_LENGTH));
|
||||
if ($rating=='')
|
||||
return false;
|
||||
$this->rating=$rating;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le type de public visé
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRating() {
|
||||
return $this->rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini si le paiement est simple ou récurrent
|
||||
*
|
||||
* @param int $paymentMethod
|
||||
* @return boolean
|
||||
*/
|
||||
public function setPaymentMethod($paymentMethod) {
|
||||
if ($this->_locked)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$paymentMethod = (int)$paymentMethod;
|
||||
if ($paymentMethod!=HIPAY_MAPI_METHOD_SIMPLE && $paymentMethod!=HIPAY_MAPI_METHOD_MULTI)
|
||||
return false;
|
||||
$this->paymentMethod=$paymentMethod;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le type de paiement (simple ou récurrent)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPaymentMethod() {
|
||||
return $this->paymentMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le délai de capture
|
||||
*
|
||||
* @param int $captureDay
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCaptureDay($captureDay) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$captureDay = (int)$captureDay;
|
||||
if (($captureDay!=HIPAY_MAPI_CAPTURE_MANUAL && $captureDay!=HIPAY_MAPI_CAPTURE_IMMEDIATE && $captureDay<=0) || $captureDay>HIPAY_MAPI_CAPTURE_MAX_DAYS)
|
||||
return false;
|
||||
$this->captureDay=$captureDay;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le délai de capture
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCaptureDay() {
|
||||
return $this->captureDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini la devise
|
||||
*
|
||||
* @param string $currency
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
if (!preg_match('#^[A-Z]{3}$#',$currency))
|
||||
return false;
|
||||
$this->currency = $currency;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la devise
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency() {
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Défini l'identifiant du groupe statistique auquel appartient ce paiement
|
||||
*
|
||||
* @param int $statsGroupId
|
||||
* @return boolean
|
||||
*/
|
||||
public function setStatsGroupId($statsGroupId) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$statsGroupId=(int)$statsGroupId;
|
||||
if ($statsGroupId<0)
|
||||
return false;
|
||||
$this->statsGroupId=$statsGroupId;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne l'identifiant du groupe statistique auquel appartient ce paiement
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStatsGroupId() {
|
||||
return $this->statsGroupId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Défini l'identifiant de cette vente chez le marchand
|
||||
*
|
||||
* @param string $idForMerchant
|
||||
* @return boolean
|
||||
*/
|
||||
public function setIdForMerchant($idForMerchant) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$this->idForMerchant=$idForMerchant;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'identifiant de la vente pour le marchand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIdForMerchant() {
|
||||
return $this->idForMerchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini l'identifiant du site marchand
|
||||
*
|
||||
* @param int $merchantSiteId
|
||||
* @return boolean
|
||||
*/
|
||||
public function setMerchantSiteId($merchantSiteId) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$merchantSiteId=(int)$merchantSiteId;
|
||||
if ($merchantSiteId<0)
|
||||
return false;
|
||||
$this->merchantSiteId=$merchantSiteId;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'identifiant du site marchand
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getMerchantSiteId() {
|
||||
return $this->merchantSiteId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne des données marchandes
|
||||
*
|
||||
* @param string $merchantDatas
|
||||
* @return boolean
|
||||
*/
|
||||
public function setMerchantDatas($key,$merchantDatas) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
if ($key=='')
|
||||
return false;
|
||||
$merchantDatas=substr($merchantDatas,0,HIPAY_MAPI_MAX_MDATAS_LENGTH);
|
||||
$this->merchantDatas[$key]=$merchantDatas;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les données marchandes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMerchantDatas() {
|
||||
return $this->merchantDatas;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne l'url à appeller si le paiement est ok
|
||||
*
|
||||
* @param string $url_ok
|
||||
* @return unknown
|
||||
*/
|
||||
public function setUrlOk($url_ok) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$url_ok = trim($url_ok);
|
||||
if (!HIPAY_MAPI_UTILS::checkURL($url_ok) && $url_ok!='')
|
||||
return false;
|
||||
$this->url_ok=$url_ok;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'url_ok
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrlOk() {
|
||||
return $this->url_ok;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne l'url à appeller si le paiement n'est pas ok
|
||||
*
|
||||
* @param string $url_nok
|
||||
* @return unknown
|
||||
*/
|
||||
public function setUrlNok($url_nok) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$url_nok = trim($url_nok);
|
||||
if (!HIPAY_MAPI_UTILS::checkURL($url_nok) && $url_nok!='')
|
||||
return false;
|
||||
$this->url_nok=$url_nok;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'url_nok
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrlNok() {
|
||||
return $this->url_nok;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne l'url à appeller si le paiement est annulé
|
||||
*
|
||||
* @param string $url_cancel
|
||||
* @return boolean
|
||||
*/
|
||||
public function setUrlCancel($url_cancel) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$url_cancel = trim($url_cancel);
|
||||
if (!HIPAY_MAPI_UTILS::checkURL($url_cancel) && $url_cancel!='')
|
||||
return false;
|
||||
$this->url_cancel=$url_cancel;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'url_cancel
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrlCancel() {
|
||||
return $this->url_cancel;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assigne l'url à appeller pour notifier le paiement
|
||||
*
|
||||
* @param string $url_cancel
|
||||
* @return boolean
|
||||
*/
|
||||
public function setUrlAck($url_ack) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$url_ack = trim($url_ack);
|
||||
if (!HIPAY_MAPI_UTILS::checkURL($url_ack) && $url_ack!='')
|
||||
return false;
|
||||
$this->url_ack=$url_ack;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'url_ack
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrlAck() {
|
||||
return $this->url_ack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Assigne le mot clé d'acquittement
|
||||
*
|
||||
* @param string $ack_wd
|
||||
* @return boolean
|
||||
*/
|
||||
public function setAckWd($ack_wd) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$ack_wd=trim($ack_wd);
|
||||
if (strlen($ack_wd)>HIPAY_MAPI_MAX_ACKWD_LENGTH)
|
||||
return false;
|
||||
$this->ack_wd=$ack_wd;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le mot clé d'acquittement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAckWd() {
|
||||
return $this->ack_wd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne l'adresse email de notification de paiement
|
||||
*
|
||||
* @param string $email_ack
|
||||
* @return boolean
|
||||
*/
|
||||
public function setEmailAck($email_ack) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$email_ack=trim($email_ack);
|
||||
if (strlen($email_ack)>HIPAY_MAPI_MAX_ACKMAIL_LENGTH || (!HIPAY_MAPI_UTILS::checkemail($email_ack) && $email_ack!=''))
|
||||
return false;
|
||||
$this->email_ack=$email_ack;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'email de notification
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmailAck() {
|
||||
return $this->email_ack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne la couleur de fond de l'interface (#XXXXXX)
|
||||
*
|
||||
* @param string $bg_color
|
||||
* @return boolean
|
||||
*/
|
||||
public function setBackgroundColor($bg_color) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$bg_color = trim($bg_color);
|
||||
if (!preg_match('#^\#([0-9a-f]){6}$#i', $bg_color) && $bg_color != '')
|
||||
return false;
|
||||
$this->bg_color = $bg_color;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la couleur de fond de l'interface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBackgroundColor() {
|
||||
return $this->bg_color;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assigne l'url du logo du marchand
|
||||
*
|
||||
* @param string $logo_url
|
||||
* @return boolean
|
||||
*/
|
||||
public function setLogoUrl($logo_url) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$logo_url = trim($logo_url);
|
||||
if (!HIPAY_MAPI_UTILS::checkURL($logo_url) && $logo_url!='')
|
||||
return false;
|
||||
$this->logo_url=$logo_url;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'url du logo du marchand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogoUrl() {
|
||||
return $this->logo_url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Vérifie que l'objet est correctement initialisé
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function check() {
|
||||
if ($this->login=='')
|
||||
throw new Exception('Nom d\'utilisateur manquant');
|
||||
if ($this->itemAccount<=0 || $this->taxAccount<=0 || $this->insuranceAccount <=0 ||
|
||||
$this->fixedCostAccount<=0 || $this->shippingCostAccount<=0)
|
||||
throw new Exception('Numéros de compte invalides');
|
||||
if ($this->rating=='')
|
||||
throw new Exception('Type de public visé invalide');
|
||||
if ($this->paymentMethod<0)
|
||||
throw new Exception('Type de paiement invalide');
|
||||
if ($this->captureDay==-100)
|
||||
throw new Exception('Délai de capture invalide ');
|
||||
if ($this->currency=='')
|
||||
throw new Exception('Devise non-définie');
|
||||
if ($this->idForMerchant<0)
|
||||
throw new Exception('ID chez le marchand manquant');
|
||||
if ($this->idForMerchant>0)
|
||||
if ($this->password=='')
|
||||
throw new Exception('Mot de passe manquant');
|
||||
if ($this->statsGroupId<0)
|
||||
throw new Exception('ID groupe est négatif');
|
||||
if ($this->merchantSiteId<0)
|
||||
throw new Exception('ID du site marchand manquant');
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function init() {
|
||||
$this->login='';
|
||||
$this->password='';
|
||||
$this->itemAccount=0;
|
||||
$this->taxAccount=0;
|
||||
$this->insuranceAccount=0;
|
||||
$this->fixedCostAccount=0;
|
||||
$this->shippingCostAccount=0;
|
||||
$this->defaultLang=HIPAY_MAPI_DEFLANG;
|
||||
$this->media=HIPAY_MAPI_DEFMEDIA;
|
||||
$this->rating='';
|
||||
$this->paymentMethod=-1;
|
||||
$this->captureDay=-100;
|
||||
$this->currency='';
|
||||
$this->idForMerchant=-1;
|
||||
$this->statsGroupId=0;
|
||||
$this->merchantSiteId=-1;
|
||||
$this->merchantDatas=array();
|
||||
$this->url_ok='';
|
||||
$this->url_nok='';
|
||||
$this->url_cancel='';
|
||||
$this->url_ack='';
|
||||
$this->ack_wd='';
|
||||
$this->email_ack='';
|
||||
$this->bg_color='';
|
||||
$this->logo_url='';
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->init();
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,274 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Représente une ligne de la commande pour un paiement simple
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Product extends HIPAY_MAPI_Item {
|
||||
/**
|
||||
* Nom du produit
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Informations sur le produit
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $info;
|
||||
|
||||
/**
|
||||
* quantité
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $quantity;
|
||||
|
||||
/**
|
||||
* Réference produit
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $ref;
|
||||
|
||||
/**
|
||||
* Catégorie du produit
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $category;
|
||||
|
||||
/**
|
||||
* Montant unitaire HT du produit
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $price;
|
||||
|
||||
/**
|
||||
* Taxes s'appliquant à ce produit
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tax;
|
||||
|
||||
|
||||
/**
|
||||
* Assigne le nom du produit
|
||||
*
|
||||
* @param string $name
|
||||
* @return boolean
|
||||
*/
|
||||
public function setName($name) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$name = HIPAY_MAPI_UTF8::forceUTF8($name);
|
||||
$len=HIPAY_MAPI_UTF8::strlen_utf8($name);
|
||||
if ($len<1 || $len>HIPAY_MAPI_MAX_PRODUCT_NAME_LENGTH)
|
||||
return false;
|
||||
$this->name=$name;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le nom du produit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne les informations sur le produit
|
||||
*
|
||||
* @param string $info
|
||||
* @return boolean
|
||||
*/
|
||||
public function setInfo($info) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$info = HIPAY_MAPI_UTF8::forceUTF8($info);
|
||||
$len=HIPAY_MAPI_UTF8::strlen_utf8($info);
|
||||
if ($len>HIPAY_MAPI_MAX_PRODUCT_INFO_LENGTH)
|
||||
return false;
|
||||
$this->info=$info;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les informations sur le produit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInfo() {
|
||||
return $this->info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne la quantité de produit
|
||||
*
|
||||
* @param int $quantity
|
||||
* @return boolean
|
||||
*/
|
||||
public function setQuantity($quantity) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$quantity=(int)$quantity;
|
||||
if ($quantity<1)
|
||||
return false;
|
||||
$this->quantity=$quantity;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la quantité de produit
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getQuantity() {
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne la réference du produit
|
||||
*
|
||||
* @param string $ref
|
||||
* @return boolean
|
||||
*/
|
||||
public function setRef($ref) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$ref = HIPAY_MAPI_UTF8::forceUTF8($ref);
|
||||
$len=HIPAY_MAPI_UTF8::strlen_utf8($ref);
|
||||
if ($len>HIPAY_MAPI_MAX_PRODUCT_REF_LENGTH)
|
||||
return false;
|
||||
$this->ref=$ref;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la réference du produit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRef() {
|
||||
return $this->ref;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assigne la catégorie du produit
|
||||
*
|
||||
* @param int $category
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCategory($category) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$category = (int)$category;
|
||||
if ($category<1)
|
||||
return false;
|
||||
$this->category=$category;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la catégorie du produit
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCategory() {
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne le montant unitaire HT du produit
|
||||
*
|
||||
* @param float $price
|
||||
* @return boolean
|
||||
*/
|
||||
public function setPrice($price) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$price = sprintf('%.02f',(float)$price);
|
||||
if ($price<0)
|
||||
return false;
|
||||
$this->price=$price;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne montant unitaire HT du produit
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getPrice() {
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigne les taxes s'appliquant à ce produit
|
||||
*
|
||||
* @param array $tax
|
||||
* @return boolean
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
if (!HIPAY_MAPI_UTILS::is_an_array_of($tax,'HIPAY_MAPI_Tax'))
|
||||
return false;
|
||||
foreach ($tax as $obj)
|
||||
$this->tax[]= clone $obj;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les taxes s'appliquant à ce produit
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie que l'objet est correctement initialisé
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function check() {
|
||||
if ($this->name=='' || $this->quantity<0 || $this->category<0 || $this->price<0 || !HIPAY_MAPI_UTILS::is_an_array_of($this->tax,'HIPAY_MAPI_Tax'))
|
||||
throw new Exception('L\'objet n\'à pas été initilisé. Vous devez préciser un nom de produit, une quantité, un prix, une catégorie et des taxes');
|
||||
foreach($this->tax as $obj) {
|
||||
if (!$obj->check())
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function init() {
|
||||
$this->name='';
|
||||
$this->info='';
|
||||
$this->quantity=-1;
|
||||
$this->ref='';
|
||||
$this->category=-1;
|
||||
$this->price=-1;
|
||||
$this->tax=array();
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->init();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
class HIPAY_MAPI_SEND_XML {
|
||||
|
||||
/**
|
||||
* Envoi le flux XML et retourne la réponse du serveur
|
||||
*
|
||||
* un timeout trop bas
|
||||
* Une mauvaise url
|
||||
* un proxy mal configuré s'il existe
|
||||
*
|
||||
* peuvent engendrer une erreur de connexion
|
||||
*
|
||||
* @param string $xml
|
||||
* @return string
|
||||
*/
|
||||
public static function sendXML($xml, $url="") {
|
||||
$xml=self::prepare($xml);
|
||||
|
||||
if ($url=="")
|
||||
$turl=parse_url(HIPAY_GATEWAY_URL);
|
||||
else $turl=parse_url($url);
|
||||
if (!isset($turl['path']))
|
||||
$turl['path']='/';
|
||||
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl,CURLOPT_TIMEOUT, HIPAY_MAPI_CURL_TIMEOUT);
|
||||
curl_setopt($curl,CURLOPT_POST,1);
|
||||
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
|
||||
curl_setopt($curl,CURLOPT_USERAGENT,"HIPAY");
|
||||
curl_setopt($curl,CURLOPT_URL, $turl['scheme'].'://'.$turl['host'].$turl['path']);
|
||||
curl_setopt($curl,CURLOPT_POSTFIELDS,'xml='.urlencode($xml));
|
||||
|
||||
if(HIPAY_MAPI_CURL_PROXY_ON === true)
|
||||
{
|
||||
curl_setopt($curl, CURLOPT_PROXY, HIPAY_MAPI_CURL_PROXY);
|
||||
curl_setopt($curl, CURLOPT_PROXYPORT, HIPAY_MAPI_CURL_PROXYPORT);
|
||||
}
|
||||
|
||||
if(HIPAY_MAPI_CURL_LOG_ON === true)
|
||||
{
|
||||
$errorFileLog = fopen(HIPAY_MAPI_CURL_LOGFILE, "a+");
|
||||
curl_setopt($curl, CURLOPT_VERBOSE, true);
|
||||
curl_setopt($curl, CURLOPT_STDERR, $errorFileLog);
|
||||
}
|
||||
|
||||
curl_setopt($curl, CURLOPT_HEADER, 0);
|
||||
|
||||
ob_start();
|
||||
if (curl_exec($curl) !== true)
|
||||
{
|
||||
$output = $turl['scheme'].'://'.$turl['host'].$turl['path'].' is not reachable';
|
||||
$output .= '<br />Network problem ? Verify your proxy configuration in mapi_defs.php';
|
||||
}
|
||||
else $output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
curl_close($curl);
|
||||
if(HIPAY_MAPI_CURL_LOG_ON === true)
|
||||
{
|
||||
fclose($errorFileLog);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prépare le flux XML
|
||||
*
|
||||
* @param string $xml
|
||||
* @return string
|
||||
*/
|
||||
public static function prepare($xml) {
|
||||
$cleanXML='';
|
||||
$xml = trim($xml);
|
||||
$md5 = hash('md5',$xml);
|
||||
$cleanXML="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
|
||||
$cleanXML.="<mapi>\n";
|
||||
$cleanXML.="<mapiversion>".MAPI_VERSION."</mapiversion>\n";
|
||||
$cleanXML.='<md5content>'.$md5."</md5content>\n";
|
||||
$cleanXML.=$xml;
|
||||
$cleanXML.="\n</mapi>\n";
|
||||
return trim($cleanXML);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Représente un paiement simple
|
||||
* Un paiement simple contient :
|
||||
* - 1 objet paramètres HIPAY_MAPI_PaymentParams
|
||||
* - 1 objet order HIPAY_MAPI_Order
|
||||
* - n objet produits représentant les lignes de la commande HIPAY_MAPI_Product
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_SimplePayment extends HIPAY_MAPI_Payment {
|
||||
|
||||
function __construct(HIPAY_MAPI_PaymentParams $paymentParams,HIPAY_MAPI_Order $order,$items) {
|
||||
try {
|
||||
parent::__construct($paymentParams,array($order),$items);
|
||||
} catch(Exception $e) {
|
||||
throw new Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Gestion des taxes
|
||||
*
|
||||
*/
|
||||
class HIPAY_MAPI_Tax extends HIPAY_MAPI_lockable
|
||||
{
|
||||
/**
|
||||
* nom de la taxe
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $taxName;
|
||||
|
||||
/**
|
||||
* valeur de la taxe
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $taxVal;
|
||||
|
||||
/**
|
||||
* true si la valeur de la taxe est un pourcentage
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $percentage;
|
||||
|
||||
/**
|
||||
* Montant calculé de la taxe
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $_amount;
|
||||
|
||||
|
||||
/**
|
||||
* assigne le nom de la taxe
|
||||
*
|
||||
* @param string $taxName nom de la taxe
|
||||
* @return boolean true si l'assignation s'est bien déroulée
|
||||
*/
|
||||
public function setTaxName($taxName) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
$taxName = HIPAY_MAPI_UTF8::forceUTF8($taxName);
|
||||
$len=HIPAY_MAPI_UTF8::strlen_utf8($taxName);
|
||||
if ($len<1 || $len>HIPAY_MAPI_MAX_TAX_NAME_LENGTH)
|
||||
return false;
|
||||
$this->taxName=$taxName;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* retourne le nom de la taxe
|
||||
*
|
||||
* @return string nom de la taxe
|
||||
*/
|
||||
public function getTaxName() {
|
||||
return $this->taxName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assigne la valeur de la taxe
|
||||
*
|
||||
* @param float $taxVal valeur de la taxe
|
||||
* @param boolean $percentage true si la valeur de la taxe est un pourcentage
|
||||
* @return boolean true si l'assignation s'est bien déroulée
|
||||
*/
|
||||
public function setTaxVal($taxVal,$percentage=true) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
if (!is_bool($percentage))
|
||||
return false;
|
||||
$taxVal = sprintf('%.02f',(float)$taxVal);
|
||||
if ($percentage && ($taxVal<=0 || $taxVal>100))
|
||||
return false;
|
||||
$this->taxVal=$taxVal;
|
||||
$this->percentage=$percentage;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* retourne la valeur de la taxe
|
||||
*
|
||||
* @return float valeur de la taxe
|
||||
*/
|
||||
public function getTaxVal() {
|
||||
return $this->taxVal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* détermine si la valeur de la taxe est un pourcentage
|
||||
*
|
||||
* @return boolean true si la valeur de la taxe est un pourcentage
|
||||
*/
|
||||
public function isPercentage() {
|
||||
return $this->percentage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* effectue une vérification des propriétés de la taxe
|
||||
*
|
||||
* @return boolean true si les propriétés de la taxe sont correctes
|
||||
*/
|
||||
public function check() {
|
||||
if ($this->taxName=='' || $this->taxVal<0)
|
||||
throw new Exception('Nom ou valeur de la taxe non initialisée');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* initilise les propriétés de la taxe
|
||||
*
|
||||
*/
|
||||
protected function init() {
|
||||
$this->taxVal=-1;
|
||||
$this->taxName='';
|
||||
$this->percentage=false;
|
||||
$this->_amount=0;
|
||||
$this->_locked=false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* assigne le montant calculé de la taxe
|
||||
*
|
||||
* @param float $amount montant calculé
|
||||
* @return boolean true si l'assignation s'est bien déroulée
|
||||
*/
|
||||
public function setTaxAmount($amount) {
|
||||
if ($this->_locked)
|
||||
return false;
|
||||
|
||||
$amount=(float)$amount;
|
||||
if ($amount<0)
|
||||
$amount=0;
|
||||
$this->_amount = sprintf("%.02f",$amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* retourne le montant calculé de la taxe
|
||||
*
|
||||
* @return float montant calculé
|
||||
*/
|
||||
public function getTaxAmount() {
|
||||
return $this->_amount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* constructeur
|
||||
*
|
||||
*/
|
||||
function __construct() {
|
||||
$this->init();
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
class HIPAY_MAPI_UTF8 {
|
||||
/**
|
||||
* Test si une chaine est en UTF-8
|
||||
*
|
||||
* @param string $string
|
||||
* @return boolean
|
||||
*/
|
||||
public static function is_utf8($string) {
|
||||
// From http://w3.org/International/questions/qa-forms-utf-8.html
|
||||
return preg_match('%^(?:
|
||||
[\x09\x0A\x0D\x20-\x7E] # ASCII
|
||||
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
|
||||
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
|
||||
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
|
||||
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
|
||||
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
|
||||
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|
||||
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
|
||||
)*$%xs', $string);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Encode une chaine en UTF-8 si elle ne l'est pas déjà
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
public static function forceUTF8($string) {
|
||||
if (!self::is_utf8($string))
|
||||
return utf8_encode($string);
|
||||
else return $string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Longueur d'une chaine UTF-8
|
||||
*
|
||||
* @param string $str
|
||||
* @return int longueur de la chaine
|
||||
*/
|
||||
public static function strlen_utf8 ($str) {
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$len = strlen ($str);
|
||||
while ($i < $len)
|
||||
{
|
||||
$chr = ord ($str[$i]);
|
||||
$count++;
|
||||
$i++;
|
||||
if ($i >= $len)
|
||||
break;
|
||||
|
||||
if ($chr & 0x80)
|
||||
{
|
||||
$chr <<= 1;
|
||||
while ($chr & 0x80)
|
||||
{
|
||||
$i++;
|
||||
$chr <<= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
class HIPAY_MAPI_UTILS {
|
||||
|
||||
/**
|
||||
* Vérifie si le tableau $array contient des objet $objectName
|
||||
*
|
||||
* @param array $array
|
||||
* @param string $objectName
|
||||
* @return boolean
|
||||
*/
|
||||
public static function is_an_array_of($array,$objectName) {
|
||||
if (!is_array($array))
|
||||
return false;
|
||||
try {
|
||||
foreach($array as $obj) {
|
||||
if (!($obj instanceof $objectName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le montant calculé d'une taxe en fonction de la valeur $itemValue
|
||||
*
|
||||
* @param float $itemValue
|
||||
* @param HIPAY_MAPI_Tax $tax
|
||||
* @return float
|
||||
*/
|
||||
public static function computeTax($itemValue,HIPAY_MAPI_Tax $tax) {
|
||||
$itemValue = (float) $itemValue;
|
||||
$taxAmount=0;
|
||||
if ($tax->isPercentage()) {
|
||||
$taxAmount=sprintf("%.02f",($itemValue/100)*$tax->getTaxVal());
|
||||
} else {
|
||||
$taxAmount+=sprintf("%.02f",$tax->getTaxVal());
|
||||
}
|
||||
return (float)$taxAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie la validité d'une URL
|
||||
*
|
||||
* @param string $url
|
||||
* @return boolean
|
||||
*/
|
||||
public static function checkURL( $url ) {
|
||||
return preg_match( '#^(((http|https):\/\/){0,1})(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(.*)#i', $url );
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie la validité de l'email
|
||||
*
|
||||
* @param string $email
|
||||
* @return boolean
|
||||
*/
|
||||
public static function checkemail( $email ) {
|
||||
return preg_match( '#^[_a-z0-9-]+(\.[_a-z0-9-]*)*@[a-z0-9-]+(\.[a-z0-9-]+)+$#i', $email );
|
||||
}
|
||||
|
||||
public static function parseDelay( $delay )
|
||||
{
|
||||
$array = array_fill_keys( array('H', 'I', 'S', 'M', 'D', 'Y'), 0 );
|
||||
$n = substr( $delay, 0, -1 );
|
||||
$r = substr( $delay, -1, 1 );
|
||||
$array[ strtoupper($r) ] = $n;
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
class HIPAY_MAPI_XML {
|
||||
|
||||
/**
|
||||
* Cré le flux XML de cet objet.
|
||||
* Les membres commençants par "_" sont ignorées
|
||||
*
|
||||
* @param int $t
|
||||
* @return string
|
||||
*/
|
||||
public function getXML($t=0,$noshow=true) {
|
||||
$xml='';
|
||||
$xml.=str_repeat(chr(9),$t)."<".get_class($this).">\n";
|
||||
foreach($this as $name=>$value) {
|
||||
if ($noshow && substr($name,0,1)=='_')
|
||||
continue;
|
||||
|
||||
if (!is_array($this->$name) && !is_object($this->$name) && !is_bool($this->$name)) {
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>$value</$name>\n";
|
||||
} else if (is_bool($this->$name)) {
|
||||
if ($value===true)
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>true</$name>\n";
|
||||
else
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>false</$name>\n";
|
||||
} else if (is_object($this->$name) && method_exists($this->$name,'getXML')) {
|
||||
$xml.=$this->$name->getXml($t+1);
|
||||
} else if (is_array($this->$name)) {
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>\n";
|
||||
$xml.=self::getXMLArray($this->$name,$t+1,$noshow);
|
||||
$xml.=str_repeat(chr(9),$t+1)."</$name>\n";
|
||||
}
|
||||
// else : no getXML method available
|
||||
|
||||
}
|
||||
$xml.=str_repeat(chr(9),$t)."</".get_class($this).">\n";
|
||||
return $xml;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Cré le flux XML d'un tableau
|
||||
*
|
||||
* @param array $array
|
||||
* @param int $t
|
||||
* @return string
|
||||
*/
|
||||
protected function getXMLArray($array,$t=0,$noshow=true) {
|
||||
$xml='';
|
||||
foreach($array as $name=>$value) {
|
||||
if (substr($name,0,1)=='_')
|
||||
continue;
|
||||
|
||||
if (!is_array($array[$name]) && !is_object($array[$name]) && !is_bool($array[$name])) {
|
||||
$xml.=str_repeat(chr(9),$t+1)."<_aKey_$name>$value</_aKey_$name>\n";
|
||||
} else if (is_bool($array[$name])) {
|
||||
if ($value===true)
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>true</$name>\n";
|
||||
else
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>false</$name>\n";
|
||||
} else if (is_object($array[$name]) && method_exists($array[$name],'getXML')) {
|
||||
$xml.=$array[$name]->getXml($t+1);
|
||||
} else if (is_array($array[$name])){
|
||||
$xml.=str_repeat(chr(9),$t+1)."<$name>\n";
|
||||
$xml.=self::getXMLArray($array[$name],$t+1,$noshow);
|
||||
$xml.=str_repeat(chr(9),$t+1)."</$name>\n";
|
||||
}
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<p class="payment_module">
|
||||
{if $cart->getOrderTotal() < 2}
|
||||
<a href="">
|
||||
<img src="{$this_path}hipay.png" alt="{l s='Pay with Hipay' mod='hipay'}" />
|
||||
{l s='Minimum amount required in order to pay with Hipay:' mod='hipay'} {convertPrice price=2}
|
||||
</a>
|
||||
{else}
|
||||
<a href="{$this_path_ssl}redirect.php" title="{l s='Pay with Hipay' mod='hipay'}">
|
||||
<img src="{$this_path}hipay.png" alt="{l s='Pay with Hipay' mod='hipay'}" />
|
||||
{l s='Pay with Hipay' mod='hipay'} {if !$hipay_prod}{l s='(sandbox / test mode)' mod='hipay'}{/if}
|
||||
</a>
|
||||
{/if}
|
||||
</p>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/* SSL Management */
|
||||
$useSSL = true;
|
||||
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/../../init.php');
|
||||
include(dirname(__FILE__).'/hipay.php');
|
||||
|
||||
if (!$cookie->isLogged(true))
|
||||
Tools::redirect('index.php/authentication?back=order.php');
|
||||
|
||||
$hipay = new HiPay();
|
||||
$hipay->payment();
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 43 KiB |
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/hipay.php');
|
||||
$hipay = new HiPay();
|
||||
$hipay->validation();
|
||||
|
||||
|
||||