Code Duplication    Length = 14-14 lines in 15 locations

src/Intraface/XMLRPC/Shop/Server2.php 4 locations

@@ 522-535 (lines=14) @@
519
     *
520
     * @return boolean true or false
521
     */
522
    public function saveCustomerCoupon($credentials, $shop_id, $customer_coupon)
523
    {
524
        $this->checkCredentials($credentials);
525
526
        $this->_factoryWebshop($shop_id);
527
528
        $customer_coupon = $this->processRequestData($customer_coupon);
529
        if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) {
530
            require_once 'XML/RPC2/Exception.php';
531
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
532
        }
533
534
        return $this->prepareResponseData(true);
535
    }
536
537
538
    /**
@@ 563-576 (lines=14) @@
560
     *
561
     * @return boolean true or false
562
     */
563
    public function saveCustomerEan($credentials, $shop_id, $customer_ean)
564
    {
565
        $this->checkCredentials($credentials);
566
567
        $this->_factoryWebshop($shop_id);
568
569
        $customer_ean = $this->processRequestData($customer_ean);
570
        if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) {
571
            require_once 'XML/RPC2/Exception.php';
572
            throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
573
        }
574
575
        return $this->prepareResponseData(true);
576
    }
577
578
579
    /**
@@ 605-618 (lines=14) @@
602
     *
603
     * @return boolean true or false
604
     */
605
    public function saveCustomerComment($credentials, $shop_id, $customer_comment)
606
    {
607
        $this->checkCredentials($credentials);
608
609
        $this->_factoryWebshop($shop_id);
610
611
        $customer_comment = $this->processRequestData($customer_comment);
612
        if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) {
613
            require_once 'XML/RPC2/Exception.php';
614
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
615
        }
616
617
        return $this->prepareResponseData(true);
618
    }
619
620
621
    /**
@@ 664-677 (lines=14) @@
661
     *
662
     * @return boolean true or false
663
     */
664
    public function savePaymentMethod($credentials, $shop_id, $payment_method)
665
    {
666
        $this->checkCredentials($credentials);
667
668
        $this->_factoryWebshop($shop_id);
669
670
        $payment_method = $this->processRequestData($payment_method);
671
        if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) {
672
            require_once 'XML/RPC2/Exception.php';
673
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
674
        }
675
676
        return $this->prepareResponseData(true);
677
    }
678
679
    /**
680
     * Returns selected payment method

src/Intraface/XMLRPC/Shop/Server.php 3 locations

@@ 475-488 (lines=14) @@
472
     *
473
     * @return boolean true or false
474
     */
475
    public function saveCustomerCoupon($credentials, $customer_coupon)
476
    {
477
        $this->checkCredentials($credentials);
478
479
        $this->_factoryWebshop();
480
481
        $customer_coupon = $this->utf8Decode($customer_coupon);
482
        if (!$this->webshop->basket->saveCustomerCoupon($customer_coupon)) {
483
            require_once 'XML/RPC2/Exception.php';
484
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
485
        }
486
487
        return true;
488
    }
489
490
491
    /**
@@ 515-528 (lines=14) @@
512
     *
513
     * @return boolean true or false
514
     */
515
    public function saveCustomerEan($credentials, $customer_ean)
516
    {
517
        $this->checkCredentials($credentials);
518
519
        $this->_factoryWebshop();
520
521
        $customer_ean = $this->utf8Decode($customer_ean);
522
        if (!$this->webshop->basket->saveCustomerEan($customer_ean)) {
523
            require_once 'XML/RPC2/Exception.php';
524
            throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
525
        }
526
527
        return true;
528
    }
529
530
531
    /**
@@ 555-568 (lines=14) @@
552
     *
553
     * @return boolean true or false
554
     */
555
    public function saveCustomerComment($credentials, $customer_comment)
556
    {
557
        $this->checkCredentials($credentials);
558
559
        $this->_factoryWebshop();
560
561
        $customer_comment = $this->utf8Decode($customer_comment);
562
        if (!$this->webshop->basket->saveCustomerComment($customer_comment)) {
563
            require_once 'XML/RPC2/Exception.php';
564
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
565
        }
566
567
        return true;
568
    }
569
570
571
    /**

src/Intraface/XMLRPC/Shop/Server0004.php 4 locations

@@ 778-791 (lines=14) @@
775
     *
776
     * @return boolean true or false
777
     */
778
    public function saveCustomerCoupon($credentials, $shop_id, $customer_coupon)
779
    {
780
        $this->checkCredentials($credentials);
781
782
        $this->_factoryWebshop($shop_id);
783
784
        $customer_coupon = $this->processRequestData($customer_coupon);
785
        if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) {
786
            require_once 'XML/RPC2/Exception.php';
787
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
788
        }
789
790
        return $this->prepareResponseData(true);
791
    }
792
793
794
    /**
@@ 819-832 (lines=14) @@
816
     *
817
     * @return boolean true or false
818
     */
819
    public function saveCustomerEan($credentials, $shop_id, $customer_ean)
820
    {
821
        $this->checkCredentials($credentials);
822
823
        $this->_factoryWebshop($shop_id);
824
825
        $customer_ean = $this->processRequestData($customer_ean);
826
        if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) {
827
            require_once 'XML/RPC2/Exception.php';
828
            throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
829
        }
830
831
        return $this->prepareResponseData(true);
832
    }
833
834
835
    /**
@@ 861-874 (lines=14) @@
858
     *
859
     * @return boolean true or false
860
     */
861
    public function saveCustomerComment($credentials, $shop_id, $customer_comment)
862
    {
863
        $this->checkCredentials($credentials);
864
865
        $this->_factoryWebshop($shop_id);
866
867
        $customer_comment = $this->processRequestData($customer_comment);
868
        if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) {
869
            require_once 'XML/RPC2/Exception.php';
870
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
871
        }
872
873
        return $this->prepareResponseData(true);
874
    }
875
876
877
    /**
@@ 920-933 (lines=14) @@
917
     *
918
     * @return boolean true or false
919
     */
920
    public function savePaymentMethod($credentials, $shop_id, $payment_method)
921
    {
922
        $this->checkCredentials($credentials);
923
924
        $this->_factoryWebshop($shop_id);
925
926
        $payment_method = $this->processRequestData($payment_method);
927
        if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) {
928
            require_once 'XML/RPC2/Exception.php';
929
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
930
        }
931
932
        return $this->prepareResponseData(true);
933
    }
934
935
    /**
936
     * Returns selected payment method

src/Intraface/XMLRPC/Shop/Server0100.php 4 locations

@@ 941-954 (lines=14) @@
938
     *
939
     * @return boolean true or false
940
     */
941
    public function saveCustomerCoupon($credentials, $shop_id, $customer_coupon)
942
    {
943
        $this->checkCredentials($credentials);
944
945
        $this->_factoryWebshop($shop_id);
946
947
        $customer_coupon = $this->processRequestData($customer_coupon);
948
        if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) {
949
            require_once 'XML/RPC2/Exception.php';
950
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
951
        }
952
953
        return $this->prepareResponseData(true);
954
    }
955
956
957
    /**
@@ 982-995 (lines=14) @@
979
     *
980
     * @return boolean true or false
981
     */
982
    public function saveCustomerEan($credentials, $shop_id, $customer_ean)
983
    {
984
        $this->checkCredentials($credentials);
985
986
        $this->_factoryWebshop($shop_id);
987
988
        $customer_ean = $this->processRequestData($customer_ean);
989
        if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) {
990
            require_once 'XML/RPC2/Exception.php';
991
            throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
992
        }
993
994
        return $this->prepareResponseData(true);
995
    }
996
997
998
    /**
@@ 1024-1037 (lines=14) @@
1021
     *
1022
     * @return boolean true or false
1023
     */
1024
    public function saveCustomerComment($credentials, $shop_id, $customer_comment)
1025
    {
1026
        $this->checkCredentials($credentials);
1027
1028
        $this->_factoryWebshop($shop_id);
1029
1030
        $customer_comment = $this->processRequestData($customer_comment);
1031
        if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) {
1032
            require_once 'XML/RPC2/Exception.php';
1033
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
1034
        }
1035
1036
        return $this->prepareResponseData(true);
1037
    }
1038
1039
1040
    /**
@@ 1083-1096 (lines=14) @@
1080
     *
1081
     * @return boolean true or false
1082
     */
1083
    public function savePaymentMethod($credentials, $shop_id, $payment_method)
1084
    {
1085
        $this->checkCredentials($credentials);
1086
1087
        $this->_factoryWebshop($shop_id);
1088
1089
        $payment_method = $this->processRequestData($payment_method);
1090
        if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) {
1091
            require_once 'XML/RPC2/Exception.php';
1092
            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
1093
        }
1094
1095
        return $this->prepareResponseData(true);
1096
    }
1097
1098
    /**
1099
     * Returns selected payment method