Plugin Directory

Changeset 2795745


Ignore:
Timestamp:
10/07/2022 04:41:25 PM (3 years ago)
Author:
girosolution
Message:
  1. 4.1.7 (07.20.2022)

Implemented support for new giropay
Changed the iDEAL logo.
Added SDK version 2.3.8

Location:
girocheckout/trunk
Files:
1 added
49 edited

Legend:

Unmodified
Added
Removed
  • girocheckout/trunk/girocheckout.php

    r2699192 r2795745  
    1010 * Plugin Name: GiroCheckout
    1111 * Description: Plugin to integrate the GiroCheckout payment methods into WooCommerce.
    12  * Version:     4.1.5
     12 * Version:     4.1.7
    1313 * Author:      S-Public Services GmbH
    1414 * Author URI:  https://s-publicservices.de
  • girocheckout/trunk/library/GiroCheckout_SDK.php

    r2457199 r2795745  
    77 *
    88 * @package GiroCheckout
    9  * @version $Revision: 321 $ / $Date: 2020-12-11 14:09:33 -0300 (Fri, 11 Dec 2020) $
     9 * @version $Revision$ / $Date$
    1010 */
    11 define('__GIROCHECKOUT_SDK_VERSION__', '2.3.1.4');
     11define('__GIROCHECKOUT_SDK_VERSION__', '2.3.8');
    1212
    1313if( version_compare( phpversion(), '5.3.0', '<' ) ) {
  • girocheckout/trunk/library/GiroCheckout_SDK_Notify.php

    r2082698 r2795745  
    1313 *
    1414 * @package GiroCheckout
    15  * @version $Revision: 253 $ / $Date: 2019-02-20 17:41:56 -0300 (Wed, 20 Feb 2019) $
     15 * @version $Revision$ / $Date$
    1616 */
    1717
  • girocheckout/trunk/library/GiroCheckout_SDK_Request.php

    r2457199 r2795745  
    1010 *
    1111 * @package GiroCheckout
    12  * @version $Revision: 320 $ / $Date: 2020-11-24 12:58:51 -0300 (Tue, 24 Nov 2020) $
     12 * @version $Revision$ / $Date$
    1313 */
    1414class GiroCheckout_SDK_Request
  • girocheckout/trunk/library/GiroCheckout_SDK_Tools.php

    r2457199 r2795745  
    8383        return "Logo_paypal_{$p_iSize}_px.png";
    8484      case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYDIREKT:
    85         return "Logo_paydirekt_{$p_iSize}_px.jpg";
     85        return "Logo_paydirekt_{$p_iSize}_px.png";
    8686      case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_BLUECODE:
    8787        return "Logo_bluecode_{$p_iSize}_px.png";
  • girocheckout/trunk/library/GiroCheckout_Utility.php

    r2699192 r2795745  
    1919   */
    2020  public static function getVersion() {
    21     return '4.1.5';
     21    return '4.1.7';
    2222  }
    2323
  • girocheckout/trunk/library/api/GiroCheckout_SDK_AbstractApi.php

    r2457199 r2795745  
    66 *
    77 * @package GiroCheckout
    8  * @version $Revision: 318 $ / $Date: 2020-11-18 19:18:48 -0300 (Wed, 18 Nov 2020) $
     8 * @version $Revision$ / $Date$
    99 */
    1010class GiroCheckout_SDK_AbstractApi implements GiroCheckout_SDK_InterfaceApi
     
    7676        $submitParams[$k] = $params[$k];
    7777      }
    78       elseif ((!isset($params[$k]) || strlen($params[$k]) == 0) && $mandatory) {
     78      elseif ((!isset($params[$k]) || strlen($params[$k]) == 0) && $mandatory === TRUE) {
    7979        throw new Exception('mandatory field ' . $k . ' is unset or empty');
    8080      }
     
    287287        return "Logo_paypal_{$p_iSize}_px.png";
    288288      case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYDIREKT:
    289         return "Logo_paydirekt_{$p_iSize}_px.jpg";
     289        return "Logo_paydirekt_{$p_iSize}_px.png";
    290290      case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_BLUECODE:
    291291        return "Logo_bluecode_{$p_iSize}_px.png";
  • girocheckout/trunk/library/api/GiroCheckout_SDK_InterfaceApi.php

    r1801157 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 174 $ / $Date: 2016-11-09 16:44:31 -0300 (Wed, 09 Nov 2016) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/api/bluecode/GiroCheckout_SDK_BlueCodeRefund.php

    r2346265 r2795745  
    2020        'projectId' => TRUE,
    2121        'merchantTxId' => TRUE,
    22         'amount' => FALSE,
    23         'currency' => FALSE,
     22        'amount' => TRUE,
     23        'currency' => TRUE,
    2424        'purpose' => FALSE,
    2525        'reference' => TRUE,
     
    3232        'rc'=> TRUE,
    3333        'msg' => TRUE,
    34         'reference' => TRUE
     34        'reference' => FALSE
    3535    );
    3636
  • girocheckout/trunk/library/api/bluecode/GiroCheckout_SDK_BlueCodeTransaction.php

    r2346265 r2795745  
    2525        'urlRedirect'     => TRUE,
    2626        'urlNotify'       => TRUE,
     27        'kassenzeichen'   => FALSE,
    2728        'pptoken'         => FALSE,
    2829    );
  • girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardCapture.php

    r2346265 r2795745  
    2121        'amount' => TRUE,
    2222        'currency' => TRUE,
     23        'purpose' => FALSE,
    2324        'reference' => TRUE,
     25        'kassenzeichen' => FALSE,
    2426    );
    2527
     
    3032        'rc'=> TRUE,
    3133        'msg' => TRUE,
    32         'reference' => TRUE,
    33         'referenceParent' => TRUE,
    34         'merchantTxId' => TRUE,
    35         'backendTxId' => TRUE,
    36         'amount' => TRUE,
    37         'currency' => TRUE,
    38         'resultPayment' => TRUE,
     34        'reference' => FALSE,
     35        'referenceParent' => FALSE,
     36        'merchantTxId' => FALSE,
     37        'backendTxId' => FALSE,
     38        'amount' => FALSE,
     39        'currency' => FALSE,
     40        'resultPayment' => FALSE,
    3941    );
    4042
  • girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardInitform.php

    r2457199 r2795745  
    3333      'tds2Country'     => FALSE,
    3434      'tds2Optional'    => FALSE,
     35      'kassenzeichen'   => FALSE,
    3536      'pptoken'         => FALSE,
    3637    );
  • girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardRecurringTransaction.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
     
    2626        'recurring' => TRUE,
    2727        'urlNotify' => FALSE,
     28        'kassenzeichen' => FALSE,
    2829    );
    2930
  • girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardRefund.php

    r2346265 r2795745  
    3131        'rc'=> TRUE,
    3232        'msg' => TRUE,
    33         'reference' => TRUE,
     33        'reference' => FALSE,
    3434        'referenceParent' => FALSE,
    35         'merchantTxId' => TRUE,
    36         'backendTxId' => TRUE,
    37         'amount' => TRUE,
    38         'currency' => TRUE,
    39         'resultPayment' => TRUE,
     35        'merchantTxId' => FALSE,
     36        'backendTxId' => FALSE,
     37        'amount' => FALSE,
     38        'currency' => FALSE,
     39        'resultPayment' => FALSE,
    4040    );
    4141
  • girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardTransaction.php

    r2457199 r2795745  
    3535        'tds2Country'     => FALSE,
    3636        'tds2Optional'    => FALSE,
     37        'kassenzeichen' => FALSE,
    3738        'pptoken'         => FALSE,
    3839    );
  • girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardVoid.php

    r2346265 r2795745  
    2828        'rc'=> TRUE,
    2929        'msg' => TRUE,
    30         'reference' => TRUE,
     30        'reference' => FALSE,
    3131        'referenceParent' => FALSE,
    32         'merchantTxId' => TRUE,
    33         'backendTxId' => TRUE,
    34         'amount' => TRUE,
    35         'currency' => TRUE,
    36         'resultPayment' => TRUE,
     32        'merchantTxId' => FALSE,
     33        'backendTxId' => FALSE,
     34        'amount' => FALSE,
     35        'currency' => FALSE,
     36        'resultPayment' => FALSE,
    3737    );
    3838
  • girocheckout/trunk/library/api/directdebit/GiroCheckout_SDK_DirectDebitCapture.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
     
    2222    'amount' => TRUE,
    2323    'currency' => TRUE,
    24     'reference' => TRUE
     24    'reference' => TRUE,
     25    'kassenzeichen' => FALSE,
    2526  );
    2627
  • girocheckout/trunk/library/api/directdebit/GiroCheckout_SDK_DirectDebitRefund.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/api/directdebit/GiroCheckout_SDK_DirectDebitTransaction.php

    r2457199 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 303 $ / $Date: 2020-04-02 14:13:33 -0300 (Thu, 02 Apr 2020) $
     6 * @version $Revision$ / $Date$
    77 */
    88
     
    3535    'urlRedirect' => FALSE,
    3636    'urlNotify' => FALSE,
     37    'kassenzeichen' => FALSE,
    3738    'pptoken' => FALSE,
     39    // optional fields for donation certificate:
     40    'company'          => FALSE,
     41    'lastname'         => FALSE,
     42    'firstname'        => FALSE,
     43    'address'          => FALSE,
     44    'zip'              => FALSE,
     45    'city'             => FALSE,
     46    'country'          => FALSE,
     47    'email'            => FALSE,
    3848  );
    3949
  • girocheckout/trunk/library/api/directdebit/GiroCheckout_SDK_DirectDebitTransactionWithPaymentPage.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
     
    3333        'urlRedirect' => TRUE,
    3434        'urlNotify' => TRUE,
     35        'kassenzeichen' => FALSE,
    3536        'pptoken' => FALSE,
    3637    );
  • girocheckout/trunk/library/api/directdebit/GiroCheckout_SDK_DirectDebitVoid.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/api/eps/GiroCheckout_SDK_EpsTransaction.php

    r2346265 r2795745  
    2626        'urlRedirect' => TRUE,
    2727        'urlNotify' => TRUE,
     28        'kassenzeichen' => FALSE,
    2829        'pptoken' => FALSE,
    2930    );
  • girocheckout/trunk/library/api/giropay/GiroCheckout_SDK_GiropayBankstatus.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/api/giropay/GiroCheckout_SDK_GiropayIDCheck.php

    r2457199 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 315 $ / $Date: 2020-11-10 01:20:46 -0300 (Tue, 10 Nov 2020) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/api/giropay/GiroCheckout_SDK_GiropayTransaction.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
     
    2424        'currency' => TRUE,
    2525        'purpose' => TRUE,
     26        'shoppingCartType'                     => FALSE,
     27        'shippingAddresseFirstName'            => FALSE, // nur bei PHYSICAL, MIXED und DIGITAL Pflicht
     28        'shippingAddresseLastName'             => FALSE, // nur bei PHYSICAL, MIXED und DIGITAL Pflicht
     29        'shippingCompany'                      => FALSE,
     30        'shippingAdditionalAddressInformation' => FALSE,
     31        'shippingStreet'                       => FALSE,
     32        'shippingStreetNumber'                 => FALSE,
     33        'shippingZipCode'                      => FALSE,  // nur bei PHYSICAL und MIXED Pflicht
     34        'shippingCity'                         => FALSE,  // nur bei PHYSICAL und MIXED Pflicht
     35        'shippingCountry'                      => FALSE,  // nur bei PHYSICAL und MIXED Pflicht
     36        'shippingEmail'                        => FALSE,  // nur bei DIGITAL Pflicht
     37        'merchantReconciliationReferenceNumber'=> FALSE,
     38        'cart'                                 => FALSE,
     39        'deliveryType'                         => FALSE,
    2640        'bic' => FALSE,
    2741        'iban' => FALSE,
     
    3852        'urlRedirect' => TRUE,
    3953        'urlNotify' => TRUE,
     54        'kassenzeichen' => FALSE,
    4055        'pptoken' => FALSE,
    4156    );
  • girocheckout/trunk/library/api/giropay/GiroCheckout_SDK_GiropayTransactionWithGiropayID.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/api/ideal/GiroCheckout_SDK_IdealIssuerList.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_IdealIssuerList extends GiroCheckout_SDK_AbstractApi{
  • girocheckout/trunk/library/api/ideal/GiroCheckout_SDK_IdealPayment.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_IdealPayment extends GiroCheckout_SDK_AbstractApi{
     
    2424                                'urlRedirect' => TRUE,
    2525                                'urlNotify' => TRUE,
     26                                'kassenzeichen' => FALSE,
    2627                                'pptoken' => FALSE,
    2728                            );
  • girocheckout/trunk/library/api/ideal/GiroCheckout_SDK_IdealPaymentRefund.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_IdealPaymentRefund extends GiroCheckout_SDK_AbstractApi{
  • girocheckout/trunk/library/api/maestro/GiroCheckout_SDK_MaestroCapture.php

    r2346265 r2795745  
    2222        'currency' => TRUE,
    2323        'reference' => TRUE,
     24        'kassenzeichen' => FALSE,
    2425    );
    2526
     
    3031        'rc'=> TRUE,
    3132        'msg' => TRUE,
    32         'reference' => TRUE,
    33         'referenceParent' => TRUE,
    34         'merchantTxId' => TRUE,
    35         'backendTxId' => TRUE,
    36         'amount' => TRUE,
    37         'currency' => TRUE,
    38         'resultPayment' => TRUE,
     33        'reference' => FALSE,
     34        'referenceParent' => FALSE,
     35        'merchantTxId' => FALSE,
     36        'backendTxId' => FALSE,
     37        'amount' => FALSE,
     38        'currency' => FALSE,
     39        'resultPayment' => FALSE,
    3940    );
    4041
  • girocheckout/trunk/library/api/maestro/GiroCheckout_SDK_MaestroRefund.php

    r2346265 r2795745  
    3131        'rc'=> TRUE,
    3232        'msg' => TRUE,
    33         'reference' => TRUE,
     33        'reference' => FALSE,
    3434        'referenceParent' => FALSE,
    35         'merchantTxId' => TRUE,
    36         'backendTxId' => TRUE,
    37         'amount' => TRUE,
    38         'currency' => TRUE,
    39         'resultPayment' => TRUE,
     35        'merchantTxId' => FALSE,
     36        'backendTxId' => FALSE,
     37        'amount' => FALSE,
     38        'currency' => FALSE,
     39        'resultPayment' => FALSE,
    4040    );
    4141
  • girocheckout/trunk/library/api/maestro/GiroCheckout_SDK_MaestroTransaction.php

    r2346265 r2795745  
    2929        'urlRedirect' => TRUE,
    3030        'urlNotify' => TRUE,
     31        'kassenzeichen' => FALSE,
    3132        'pptoken' => FALSE,
    3233    );
  • girocheckout/trunk/library/api/paydirekt/GiroCheckout_SDK_PaydirektCapture.php

    r2346265 r2795745  
    2525        'reference' => TRUE,
    2626        'merchantReconciliationReferenceNumber' => FALSE,
    27         'final' => FALSE
     27        'final' => FALSE,
     28        'kassenzeichen' => FALSE,
    2829    );
    2930
     
    3435        'rc'=> TRUE,
    3536        'msg' => TRUE,
    36         'reference' => TRUE
     37        'reference' => FALSE
    3738    );
    3839
  • girocheckout/trunk/library/api/paydirekt/GiroCheckout_SDK_PaydirektRefund.php

    r2346265 r2795745  
    3333        'rc'=> TRUE,
    3434        'msg' => TRUE,
    35         'reference' => TRUE
     35        'reference' => FALSE
    3636    );
    3737
  • girocheckout/trunk/library/api/paydirekt/GiroCheckout_SDK_PaydirektTransaction.php

    r2346265 r2795745  
    4848    'urlRedirect'                           => TRUE,
    4949    'urlNotify'                             => TRUE,
     50    'kassenzeichen'                         => FALSE,
    5051    'pptoken'                               => FALSE,
    5152  );
  • girocheckout/trunk/library/api/paydirekt/GiroCheckout_SDK_PaydirektVoid.php

    r2346265 r2795745  
    2929        'rc'=> TRUE,
    3030        'msg' => TRUE,
    31         'reference' => TRUE
     31        'reference' => FALSE
    3232    );
    3333
  • girocheckout/trunk/library/api/paypage/GiroCheckout_SDK_PaypageDonationcert.php

    r2457199 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_PaypageDonationcert extends GiroCheckout_SDK_AbstractApi implements GiroCheckout_SDK_InterfaceApi {
  • girocheckout/trunk/library/api/paypage/GiroCheckout_SDK_PaypageProjects.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_PaypageProjects extends GiroCheckout_SDK_AbstractApi implements GiroCheckout_SDK_InterfaceApi {
  • girocheckout/trunk/library/api/paypage/GiroCheckout_SDK_PaypageTransaction.php

    r2457199 r2795745  
    4343        'certdata' => FALSE,
    4444        'otherpayments' => FALSE,
     45        'paydirektShoppingCartType' => FALSE,
    4546        'paydirektShippingFirstName' => FALSE,
    4647        'paydirektShippingLastName' => FALSE,
     48        'paydirektShippingCompany' => FALSE,
     49        'paydirektShippingAdditionalAddressInformation' => FALSE,
     50        'paydirektShippingStreet' => FALSE,
     51        'paydirektShippingStreetNumber' => FALSE,
    4752        'paydirektShippingZipCode' => FALSE,
    4853        'paydirektShippingCity' => FALSE,
    4954        'paydirektShippingCountry' => FALSE,
     55        'paydirektShippingEmail' => FALSE,
     56        'paydirektMerchantReconciliationReferenceNumber'=> FALSE,
     57        'paydirektCart' => FALSE,
     58        'paydirektDeliveryType' => FALSE,
    5059        'successUrl' => FALSE,
    5160        'backUrl' => FALSE,
     
    5766        'tds2Country'     => FALSE,
    5867        'tds2Optional'    => FALSE,
     68        'mandateReference' => FALSE,
     69        'mandateSignedOn' => FALSE,
     70        'mandateReceiverName' => FALSE,
     71        'mandateSequence' => FALSE,
     72        'informationText' => FALSE,
     73        'kassenzeichen' => FALSE,
     74        'giropayAllowMissingFields' => FALSE,
    5975    );
    6076
  • girocheckout/trunk/library/api/paypal/GiroCheckout_SDK_PaypalTransaction.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_PaypalTransaction extends GiroCheckout_SDK_AbstractApi{
     
    1515     * For further information use the API documentation.
    1616     */
    17     protected $paramFields = array(  'merchantId'=> TRUE,
    18                                 'projectId' => TRUE,
    19                                 'merchantTxId' => TRUE,
    20                                 'amount' => TRUE,
    21                                 'currency' => TRUE,
    22                                 'purpose' => TRUE,
    23                                 'urlRedirect' => TRUE,
    24                                 'urlNotify' => TRUE,
    25                                 'pptoken' => FALSE,
    26                             );
     17    protected $paramFields = array(
     18      'merchantId'=> TRUE,
     19      'projectId' => TRUE,
     20      'merchantTxId' => TRUE,
     21      'amount' => TRUE,
     22      'currency' => TRUE,
     23      'purpose' => TRUE,
     24      'type' => 'SALE',
     25      'urlRedirect' => TRUE,
     26      'urlNotify' => TRUE,
     27      'kassenzeichen' => FALSE,
     28      'pptoken' => FALSE,
     29    );
    2730
    2831    /*
  • girocheckout/trunk/library/api/sofortuw/GiroCheckout_SDK_SofortUwTransaction.php

    r2346265 r2795745  
    2525      'urlRedirect'     => TRUE,
    2626      'urlNotify'       => TRUE,
     27      'kassenzeichen'   => FALSE,
    2728      'pptoken'         => FALSE,
    2829    );
  • girocheckout/trunk/library/api/tools/GiroCheckout_SDK_Tools_GetTransaction.php

    r2346265 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88
     
    2020        'projectId' => TRUE,
    2121        'reference' => TRUE,
     22        'txreference' => FALSE,
    2223    );
    2324
  • girocheckout/trunk/library/helper/GiroCheckout_SDK_Curl_helper.php

    r1801157 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 204 $ / $Date: 2017-04-11 11:23:52 -0300 (Tue, 11 Apr 2017) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/helper/GiroCheckout_SDK_Hash_helper.php

    r2082698 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 69 $ / $Date: 2014-10-01 11:57:27 -0300 (Wed, 01 Oct 2014) $
     6 * @version $Revision$ / $Date$
    77 */
    88
  • girocheckout/trunk/library/helper/GiroCheckout_SDK_ResponseCode_helper.php

    r2457199 r2795745  
    55 *
    66 * @package GiroCheckout
    7  * @version $Revision: 321 $ / $Date: 2020-12-11 14:09:33 -0300 (Fri, 11 Dec 2020) $
     7 * @version $Revision$ / $Date$
    88 */
    99class GiroCheckout_SDK_ResponseCode_helper {
     
    127127      5111 => 'TDS20: Geben Sie bitte mindestens alle Felder außer Optional an',
    128128      5112 => 'TDS20: Sie müssen zu Optional auch die anderen Felder angeben',
     129      5113 => 'Paypage: Ungültiges Format des Hinweistextes (API-Beschreibung beachten)',
     130      5114 => 'Referenz muss Payment Page Transaktion sein',
    129131      5200 => 'Transaktion nicht akzeptiert',
    130132      5201 => 'giropay Bank offline',
     
    263265      5111 => 'TDS20: Please provide at least all fields except Optional',
    264266      5112 => 'TDS20: You must provide the other fields along with Optional',
     267      5113 => 'Paypage: invalid format of the notification text (see API documentation)',
     268      5114 => 'Reference must be payment page transaction',
    265269      5200 => 'not accepted transaction',
    266270      5201 => 'giropay bank offline',
  • girocheckout/trunk/library/helper/GiroCheckout_SDK_TransactionType_helper.php

    r2457199 r2795745  
    44 *
    55 * @package GiroCheckout
    6  * @version $Revision: 281 $ / $Date: 2019-10-18 12:19:18 +0200 (Fri, 18 Oct 2019) $
     6 * @version $Revision$ / $Date$
    77 */
    88class GiroCheckout_SDK_TransactionType_helper {
     
    1616  const TRANS_TYPE_CREDITCARD_INITFORM     = "creditCardInitform";
    1717  const TRANS_TYPE_CREDITCARD_FINALIZEFORM = "creditCardFinalizeform";
     18  const TRANS_TYPE_CREDITCARD_SENDERINFO   = "creditCardSenderInfo";
    1819
    1920  const TRANS_TYPE_DIRECTDEBIT_TRANSACTION = "directDebitTransaction";
     
    2324  const TRANS_TYPE_DIRECTDEBIT_REFUND      = "directDebitRefund";
    2425  const TRANS_TYPE_DIRECTDEBIT_VOID        = "directDebitVoid";
     26  const TRANS_TYPE_DIRECTDEBIT_SENDERINFO  = "directDebitSenderInfo";
    2527
    2628  const TRANS_TYPE_GIROPAY_BANKSTATUS      = "giropayBankstatus";
     
    2830  const TRANS_TYPE_GIROPAY_TRANSACTION     = "giropayTransaction";
    2931  const TRANS_TYPE_GIROPAY_ISSUERLIST      = "giropayIssuerList";
     32  const TRANS_TYPE_GIROPAY_SENDERINFO      = "giropaySenderInfo";
    3033
    3134  const TRANS_TYPE_IDEAL_ISSUERLIST        = "idealIssuerList";
    3235  const TRANS_TYPE_IDEAL_PAYMENT           = "idealPayment";
    3336  const TRANS_TYPE_IDEAL_REFUND            = "idealRefund";
     37  const TRANS_TYPE_IDEAL_SENDERINFO        = "idealSenderInfo";
    3438
    3539  const TRANS_TYPE_PAYPAL_TRANSACTION      = "paypalTransaction";
     40  const TRANS_TYPE_PAYPAL_REFUND           = "paypalRefund";
     41  const TRANS_TYPE_PAYPAL_CAPTURE          = "paypalCapture";
    3642
    3743  const TRANS_TYPE_EPS_BANKSTATUS          = "epsBankstatus";
    3844  const TRANS_TYPE_EPS_TRANSACTION         = "epsTransaction";
    3945  const TRANS_TYPE_EPS_ISSUERLIST          = "epsIssuerList";
     46  const TRANS_TYPE_EPS_SENDERINFO          = "epsSenderInfo";
    4047
    4148  const TRANS_TYPE_GET_TRANSACTIONTOOL     = "getTransactionTool";
     
    5865  const TRANS_TYPE_PAYPAGE_PROJECTS        = "paypageProjects";
    5966  const TRANS_TYPE_PAYPAGE_DONATIONCERT    = "paypageDonationCert";
     67  const TRANS_TYPE_PAYPAGE_REFUND          = "paypageRefund";
     68  const TRANS_TYPE_PAYPAGE_CAPTURE         = "paypageCapture";
    6069
    6170  const TRANS_TYPE_MAESTRO_TRANSACTION     = "maestroTransaction";
     
    8897      case self::TRANS_TYPE_CREDITCARD_FINALIZEFORM:
    8998        return new GiroCheckout_SDK_CreditCardFinalizeform();
     99      case self::TRANS_TYPE_CREDITCARD_SENDERINFO:
     100        return new GiroCheckout_SDK_CreditCardSenderInfo();
    90101
    91102      //direct debit apis
     
    102113      case self::TRANS_TYPE_DIRECTDEBIT_VOID:
    103114        return new GiroCheckout_SDK_DirectDebitVoid();
     115      case self::TRANS_TYPE_DIRECTDEBIT_SENDERINFO:
     116        return new GiroCheckout_SDK_DirectDebitSenderInfo();
    104117
    105118      //giropay apis
     
    112125      case self::TRANS_TYPE_GIROPAY_ISSUERLIST:
    113126        return new GiroCheckout_SDK_GiropayIssuerList();
     127      case self::TRANS_TYPE_GIROPAY_SENDERINFO:
     128        return new GiroCheckout_SDK_GiropaySenderInfo();
    114129
    115130      //iDEAL apis
     
    120135      case self::TRANS_TYPE_IDEAL_REFUND:
    121136        return new GiroCheckout_SDK_IdealPaymentRefund();
     137      case self::TRANS_TYPE_IDEAL_SENDERINFO:
     138        return new GiroCheckout_SDK_IdealSenderInfo();
    122139
    123140      //PayPal apis
    124141      case self::TRANS_TYPE_PAYPAL_TRANSACTION:
    125142        return new GiroCheckout_SDK_PaypalTransaction();
     143      case self::TRANS_TYPE_PAYPAL_CAPTURE:
     144        return new GiroCheckout_SDK_PaypalCapture();
     145      case self::TRANS_TYPE_PAYPAL_REFUND:
     146        return new GiroCheckout_SDK_PaypalRefund();
    126147
    127148      //eps apis
     
    132153      case self::TRANS_TYPE_EPS_ISSUERLIST:
    133154        return new GiroCheckout_SDK_EpsIssuerList();
     155      case self::TRANS_TYPE_EPS_SENDERINFO:
     156        return new GiroCheckout_SDK_EpsSenderInfo();
    134157
    135158      //tools apis
     
    172195      case self::TRANS_TYPE_PAYPAGE_DONATIONCERT:
    173196        return new GiroCheckout_SDK_PaypageDonationcert();
     197      case self::TRANS_TYPE_PAYPAGE_REFUND:
     198        return new GiroCheckout_SDK_PaypageRefund();
     199      case self::TRANS_TYPE_PAYPAGE_CAPTURE:
     200        return new GiroCheckout_SDK_PaypageCapture();
    174201
    175202      //Maestro apis
  • girocheckout/trunk/payments/gc_giropay.php

    r2435416 r2795745  
    11<?php
    2 class gc_giropay extends WC_Payment_Gateway {
    3 
    4   /** @var string  */
     2
     3class gc_giropay extends WC_Payment_Gateway
     4{
     5
     6  /** @var string */
    57  public $merchantid;
    68
    7   /** @var string  */
     9  /** @var string */
    810  public $projectid;
    911
    10   /** @var string  */
     12  /** @var string */
    1113  public $password;
    1214
    13   /** @var string  */
     15  /** @var string */
    1416  public $lang;
    1517
    16   /** @var string  */
     18  /** @var string */
    1719  public $purpose;
    1820
     
    2022  public $alternativenumorders;
    2123
    22     /**
     24  const CART_TYPE_PHYSICAL = "PHYSICAL";
     25  const CART_TYPE_DIGITAL = "DIGITAL";
     26  const CART_TYPE_MIXED = "MIXED";
     27
     28  /**
    2329   * Constructor for the gateway.
    2430   *
     
    7783    $strLang = substr(get_bloginfo("language"), 0, 2);
    7884
    79     if ($strLang == 'de' || $strLang == 'en')
     85    if ($strLang == 'de' || $strLang == 'en') {
    8086      $this->lang = $strLang;
    81     else
     87    }
     88    else {
    8289      $this->lang = $language;
     90    }
    8391  }
    8492
     
    94102  public function init_form_fields() {
    95103    $this->form_fields = array(
    96         'configuration' => array(
    97             'title' => __('Set-up configuration', 'girocheckout'),
    98             'type' => 'title'
    99         ),
    100         'enabled' => array(
    101             'title' => __('Enable/Disable', 'girocheckout'),
    102             'type' => 'checkbox',
    103             'label' => __('Enable giropay - online bank transfer', 'girocheckout'),
    104             'default' => 'no',
    105         ),
    106         'title' => array(
    107             'title' => __('Title', 'girocheckout'),
    108             'type' => 'text',
    109             'description' => __('Payment method title that the customer will see on your website.', 'girocheckout'),
    110             'default' => __('giropay - online bank transfer', 'girocheckout'),
    111             'desc_tip' => true,
    112         ),
    113         'merchantid' => array(
    114             'title' => __('Merchant ID', 'girocheckout'),
    115             'type' => 'text',
    116             'description' => __('Merchant ID from GiroCockpit', 'girocheckout'),
    117             'default' => '',
    118             'desc_tip' => true,
    119         ),
    120         'projectid' => array(
    121             'title' => __('Project ID', 'girocheckout'),
    122             'type' => 'text',
    123             'description' => __('Project ID from GiroCockpit', 'girocheckout'),
    124             'default' => '',
    125             'desc_tip' => true,
    126         ),
    127         'password' => array(
    128             'title' => __('Project password', 'girocheckout'),
    129             'type' => 'text',
    130             'description' => __('Project password from GiroCockpit', 'girocheckout'),
    131             'default' => '',
    132             'desc_tip' => true,
    133         ),
    134         'purpose' => array(
    135             'title' => __('Purpose', 'girocheckout'),
    136             'type' => 'text',
    137             'description' => __("You can define your own purpose using these placeholders:\n".
    138                                   "{ORDERID}: Bestellnummer\n".
    139                                   "{CUSTOMERID}: Kundennummer\n".
    140                                   "{SHOPNAME}: Shop Name\n".
    141                                   "{CUSTOMERNAME}: Kundenname\n".
    142                                   "{CUSTOMERFIRSTNAME}: Kunde Vorname\n".
    143                                   "{CUSTOMERLASTNAME}: Kunde Nachname\n".
    144                                   "For example: If your purpose is \"Best. {ORDERID}, {SHOPNAME}\" then the submitted purpose must be \"Best. 55342, TestShop\"\n".
    145                                   "The maximum length of the purpose is 27 characters.", 'girocheckout'),
    146             'default' => 'Best. {ORDERID}, {SHOPNAME}',
    147             'desc_tip' => true,
    148         ),
    149         'alternativenumorders' => array(
     104      'configuration' => array(
     105        'title' => __('Set-up configuration', 'girocheckout'),
     106        'type' => 'title'
     107      ),
     108      'enabled' => array(
     109        'title' => __('Enable/Disable', 'girocheckout'),
     110        'type' => 'checkbox',
     111        'label' => __('Enable giropay - online bank transfer', 'girocheckout'),
     112        'default' => 'no',
     113      ),
     114      'title' => array(
     115        'title' => __('Title', 'girocheckout'),
     116        'type' => 'text',
     117        'description' => __('Payment method title that the customer will see on your website.', 'girocheckout'),
     118        'default' => __('giropay - online bank transfer', 'girocheckout'),
     119        'desc_tip' => true,
     120      ),
     121      'merchantid' => array(
     122        'title' => __('Merchant ID', 'girocheckout'),
     123        'type' => 'text',
     124        'description' => __('Merchant ID from GiroCockpit', 'girocheckout'),
     125        'default' => '',
     126        'desc_tip' => true,
     127      ),
     128      'projectid' => array(
     129        'title' => __('Project ID', 'girocheckout'),
     130        'type' => 'text',
     131        'description' => __('Project ID from GiroCockpit', 'girocheckout'),
     132        'default' => '',
     133        'desc_tip' => true,
     134      ),
     135      'password' => array(
     136        'title' => __('Project password', 'girocheckout'),
     137        'type' => 'text',
     138        'description' => __('Project password from GiroCockpit', 'girocheckout'),
     139        'default' => '',
     140        'desc_tip' => true,
     141      ),
     142      'purpose' => array(
     143        'title' => __('Purpose', 'girocheckout'),
     144        'type' => 'text',
     145        'description' => __("You can define your own purpose using these placeholders:\n" .
     146          "{ORDERID}: Bestellnummer\n" .
     147          "{CUSTOMERID}: Kundennummer\n" .
     148          "{SHOPNAME}: Shop Name\n" .
     149          "{CUSTOMERNAME}: Kundenname\n" .
     150          "{CUSTOMERFIRSTNAME}: Kunde Vorname\n" .
     151          "{CUSTOMERLASTNAME}: Kunde Nachname\n" .
     152          "For example: If your purpose is \"Best.{ORDERID},{SHOPNAME}\" then the submitted purpose must be \"Best.55342,TestShop\"\n" .
     153          "It may only contain these characters: A-Z a-z 0-9 + ? / - : ( ) . , \' (NO Blanks!).\n" .
     154          "Purpose field may now only be max. 20 characters long.", 'girocheckout'),
     155        'default' => 'Best.{ORDERID},{SHOPNAME}',
     156        'desc_tip' => true,
     157      ),
     158      'alternativenumorders' => array(
    150159        'title' => __('Enable/Disable', 'girocheckout'),
    151160        'type' => 'checkbox',
    152161        'label' => __('Support alternative order numbers', 'girocheckout'),
    153162        'default' => 'no',
    154         )
     163      )
    155164    );
    156165  }
     
    184193  public function admin_options() {
    185194    ?>
    186     <h3><?php _e('giropay - online bank transfer', 'girocheckout'); ?></h3>
    187     <p><?php _e('GiroCheckout giropay payment', 'girocheckout'); ?></p>
    188     <table class="form-table">
    189       <?php
    190       // Generate the HTML for the settings form.
    191       $this->generate_settings_html();
    192       ?>
    193     </table><!--/.form-table-->
     195      <h3><?php _e('giropay - online bank transfer', 'girocheckout'); ?></h3>
     196      <p><?php _e('GiroCheckout giropay payment', 'girocheckout'); ?></p>
     197      <table class="form-table">
     198        <?php
     199        // Generate the HTML for the settings form.
     200        $this->generate_settings_html();
     201        ?>
     202      </table><!--/.form-table-->
    194203    <?php
    195204  }
     
    233242      if ($this->alternativenumorders) {
    234243        $transaction_id = $order->get_order_number();
    235       } else {
     244      }
     245      else {
    236246        $transaction_id = $orderID;
    237247      }
     248      $aShippData = self::getShippingData($order);
    238249
    239250      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
     
    244255      $reqPayment->setSecret($password);
    245256      $reqPayment->addParam('merchantId', $merchantId)
    246                  ->addParam('projectId', $projectId)
    247                  ->addParam('merchantTxId', $transaction_id)
    248                  ->addParam('amount', round($amount * 100))
    249                  ->addParam('currency', $currency)
    250                  ->addParam('purpose', GiroCheckout_Utility::getPurpose($this->purpose, $order))
    251                  ->addParam('urlRedirect', $urlRedirect)
    252                  ->addParam('urlNotify', $urlNotify)
    253                  ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    254                  ->addParam('orderId', $transaction_id)
    255                  ->addParam('customerId', get_current_user_id())
    256                  ->submit();
     257        ->addParam('projectId', $projectId)
     258        ->addParam('merchantTxId', $transaction_id)
     259        ->addParam('amount', round($amount * 100))
     260        ->addParam('currency', $currency)
     261        ->addParam('purpose', self::getPurpose($this->purpose, $order))
     262        ->addParam('urlRedirect', $urlRedirect)
     263        ->addParam('urlNotify', $urlNotify)
     264        ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
     265        ->addParam('orderId', $transaction_id)
     266        ->addParam('customerId', get_current_user_id())
     267        ->addParam('shippingAddresseFirstName', GiroCheckout_Utility::formatText($aShippData["shippingAddresseFirstName"]))
     268        ->addParam('shippingAddresseLastName', $aShippData["shippingAddresseLastName"])
     269        ->addParam('shippingCompany', $aShippData["shippingCompany"])
     270        ->addParam('shippingAdditionalAddressInformation', $aShippData["shippingAdditionalAddressInformation"])
     271        ->addParam('shippingStreet', $aShippData["shippingStreet"])
     272        ->addParam('shippingZipCode', $aShippData["shippingZipCode"])
     273        ->addParam('shippingCity', $aShippData["shippingCity"])
     274        ->addParam('shippingCountry', $aShippData["shippingCountry"])
     275        ->addParam('shippingEmail', $aShippData["shippingEmail"])
     276        ->addParam('cart', $aShippData["oCart"])
     277        ->addParam('shoppingCartType', $aShippData["cartType"])
     278        ->submit();
    257279
    258280      if ($reqPayment->requestHasSucceeded()) {
     
    261283        if ($statusNotificationOrder == GiroCheckout_Utility::getOrderStatusZero()) {
    262284          GiroCheckout_Utility::registerOrderStatus($transaction_id, GiroCheckout_Utility::getOrderStatusInitial());
    263         } else {
     285        }
     286        else {
    264287          GiroCheckout_Utility::updateOrderStatus($transaction_id, GiroCheckout_Utility::getOrderStatusInitial());
    265288        }
     
    270293        }
    271294        $strUrlRedirect = $reqPayment->getResponseParam('redirect');
    272       } else {
     295      }
     296      else {
    273297        wc_add_notice(GiroCheckout_SDK_ResponseCode_helper::getMessage($reqPayment->getResponseParam('rc'), $this->lang), 'error');
    274298        return;
    275299      }
    276     } catch (Exception $e) {
    277       wc_add_notice(__('The plugin configuration data is incorrect', 'girocheckout') . ' ('.$e->getMessage().')', 'error');
     300    }
     301    catch (Exception $e) {
     302      wc_add_notice(__('The plugin configuration data is incorrect', 'girocheckout') . ' (' . $e->getMessage() . ')', 'error');
    278303      return;
    279304    }
    280305
    281306    return array(
    282         'result' => 'success',
    283         'redirect' => $strUrlRedirect,
     307      'result' => 'success',
     308      'redirect' => $strUrlRedirect,
    284309    );
    285310  }
     
    298323    if (!empty($_GET) && $_GET["type"] == 'redirect') {
    299324      do_action("valid_redirect_" . $this->id);
    300     } else {
     325    }
     326    else {
    301327      do_action("valid_notify_" . $this->id);
    302328    }
     
    318344    try {
    319345      $notify = new GiroCheckout_SDK_Notify('giropayTransaction');
    320       $notify->setSecret(trim((string) $password));
     346      $notify->setSecret(trim((string)$password));
    321347      $notify->parseNotification($_GET);
    322348
    323349      if ($this->alternativenumorders) {
    324         $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
    325       } else {
     350        $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number($notify->getResponseParam('gcMerchantTxId'));
     351      }
     352      else {
    326353        $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    327354      }
    328355
    329       $order = new WC_Order( $iOrderId );
     356      $order = new WC_Order($iOrderId);
    330357      $bPaymentSuccess = $notify->paymentSuccessful();
    331358
     
    334361      $iReturnCodeAVS = $notify->getResponseParam('gcResultAVS');
    335362
    336       if( !empty($iReturnCodeAVS) && $iReturnCodeAVS != $iReturnCodeTrx ) {
     363      if (!empty($iReturnCodeAVS) && $iReturnCodeAVS != $iReturnCodeTrx) {
    337364        $paymentMsg .= ", " . $notify->getResponseMessage($iReturnCodeAVS, $this->lang);
    338365      }
     
    346373        if ($statusNotificationOrder == GiroCheckout_Utility::getOrderStatusZero()) {
    347374          GiroCheckout_Utility::registerOrderStatus($notify->getResponseParam('gcMerchantTxId'), GiroCheckout_Utility::getOrderStatusRedirect());
    348         } else {
     375        }
     376        else {
    349377          GiroCheckout_Utility::updateOrderStatus($notify->getResponseParam('gcMerchantTxId'), GiroCheckout_Utility::getOrderStatusRedirect());
    350378        }
     
    352380
    353381      if ($order->get_status() != 'completed' && $order->get_status() != 'processing' &&
    354         $statusNotificationOrder <= GiroCheckout_Utility::getOrderStatusInitial()) {
     382        $statusNotificationOrder <= GiroCheckout_Utility::getOrderStatusInitial()
     383      ) {
    355384
    356385        // Checks if the payment was successful and redirects the user
    357386        $order->add_order_note($paymentMsg);
    358387
    359         if( $bPaymentSuccess ) {
     388        if ($bPaymentSuccess) {
    360389          $order->payment_complete();
    361390          // Remove cart
     
    366395          $order->update_status('failed');
    367396
    368           if (method_exists($order,'get_cancel_order_url_raw')) {
    369             $urlRedirect = esc_url_raw( $order->get_cancel_order_url_raw() );
     397          if (method_exists($order, 'get_cancel_order_url_raw')) {
     398            $urlRedirect = esc_url_raw($order->get_cancel_order_url_raw());
    370399          }
    371400        }
    372       } else {
     401      }
     402      else {
    373403        if (!$bPaymentSuccess) {
    374404          if ($order->get_status() == 'processing') {
     
    391421      $order->update_status('failed');
    392422    }
    393    
     423
    394424    wp_redirect($urlRedirect);
    395425  }
     
    411441    try {
    412442      $notify = new GiroCheckout_SDK_Notify('giropayTransaction');
    413       $notify->setSecret(trim((string) $password));
     443      $notify->setSecret(trim((string)$password));
    414444      $notify->parseNotification($_GET);
    415445
    416446      if ($this->alternativenumorders) {
    417         $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
    418       } else {
     447        $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number($notify->getResponseParam('gcMerchantTxId'));
     448      }
     449      else {
    419450        $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    420451      }
    421452
    422       $order = new WC_Order( $iOrderId );
     453      $order = new WC_Order($iOrderId);
    423454      $statusNotificationOrder = GiroCheckout_Utility::readOrderStatus($notify->getResponseParam('gcMerchantTxId'));
    424455
     
    428459        if ($statusNotificationOrder == GiroCheckout_Utility::getOrderStatusZero()) {
    429460          GiroCheckout_Utility::registerOrderStatus($notify->getResponseParam('gcMerchantTxId'), GiroCheckout_Utility::getOrderStatusNotify());
    430         } else {
     461        }
     462        else {
    431463          GiroCheckout_Utility::updateOrderStatus($notify->getResponseParam('gcMerchantTxId'), GiroCheckout_Utility::getOrderStatusNotify());
    432464        }
     
    444476      // Order already processed?
    445477      if (($order->get_status() == 'processing' || $order->get_status() == 'completed') &&
    446         $statusNotificationOrder <= GiroCheckout_Utility::getOrderStatusInitial()) {
     478        $statusNotificationOrder <= GiroCheckout_Utility::getOrderStatusInitial()
     479      ) {
    447480        $notify->sendOkStatus();
    448481        $notify->setNotifyResponseParam('Result', 'ERROR');
    449         $notify->setNotifyResponseParam('ErrorMessage', "Order $iOrderId already had state=".$order->get_status());
     482        $notify->setNotifyResponseParam('ErrorMessage', "Order $iOrderId already had state=" . $order->get_status());
    450483        $notify->setNotifyResponseParam('MailSent', '');
    451484        $notify->setNotifyResponseParam('OrderId', $iOrderId);
     
    471504        echo $notify->getNotifyResponseStringJson();
    472505        exit;
    473       } else {
     506      }
     507      else {
    474508        if (($order->get_status() != 'processing' && $order->get_status() != 'completed') &&
    475           $statusNotificationOrder <= GiroCheckout_Utility::getOrderStatusInitial()) {
     509          $statusNotificationOrder <= GiroCheckout_Utility::getOrderStatusInitial()
     510        ) {
    476511          $order->update_status('failed');
    477512        }
     
    493528    }
    494529  }
     530
     531  /**
     532   * Get the payment purpose for giropay payment.
     533   *
     534   * @author S-Public Services GmbH
     535   * @package GiroCheckout
     536   * @copyright Copyright (c) 2022, S-Public Services GmbH
     537   * @return string The purpose format
     538   */
     539  public function getPurpose($p_strPurpose, $p_oOrder) {
     540    if (empty($p_strPurpose)) {
     541      $strPurpose = "Best.{ORDERID},{CUSTOMERNAME}";
     542    }
     543    else {
     544      $strPurpose = $p_strPurpose;
     545    }
     546
     547    $strName = "";
     548    $strLastName = "";
     549    $strFirstName = "";
     550    $strShopName = get_bloginfo('name');
     551
     552    // For registered user
     553    if (is_user_logged_in()) {
     554      $user_info = get_userdata(get_current_user_id());
     555      $strName = $user_info->user_login;
     556      $strFirstName = $user_info->first_name;
     557      $strLastName = $user_info->last_name;
     558    }
     559    else {
     560      // For visitor
     561      $strFirstName = $p_oOrder->get_billing_first_name();
     562      $strLastName = $p_oOrder->get_billing_last_name();
     563      $strName = $strFirstName . " " . $strLastName;
     564    }
     565
     566    if (method_exists($p_oOrder, 'get_id')) {
     567      $iOrderId = $p_oOrder->get_id();
     568    }
     569    else {
     570      $iOrderId = $p_oOrder->id;
     571    }
     572
     573    $transaction_id = (string)apply_filters('woocommerce_order_number', $iOrderId, $p_oOrder);
     574    if (!empty($transaction_id)) {
     575      $iOrderId = $transaction_id;
     576    }
     577
     578    $strPurpose = str_replace("{ORDERID}", $iOrderId, $strPurpose);
     579    $strPurpose = str_replace("{CUSTOMERID}", get_current_user_id(), $strPurpose);
     580    $strPurpose = str_replace("{SHOPNAME}", $strShopName, $strPurpose);
     581    $strPurpose = str_replace("{CUSTOMERNAME}", $strName, $strPurpose);
     582    $strPurpose = str_replace("{CUSTOMERFIRSTNAME}", $strFirstName, $strPurpose);
     583    $strPurpose = str_replace("{CUSTOMERLASTNAME}", $strLastName, $strPurpose);
     584
     585    $bValidPurpose = self::validatePurpose($strPurpose);
     586
     587    if (!$bValidPurpose) {
     588      $strPurposeFormat = preg_replace("([^[A-Za-z0-9\+\?\-\:\(\)\.\,\'\/\s])", '', $strPurpose);
     589    }
     590    else {
     591      $strPurposeFormat = $strPurpose;
     592    }
     593
     594    $strPurposeFormat = mb_substr(Normalizer::normalize($strPurposeFormat, Normalizer::FORM_C), 0, 27);
     595
     596    return $strPurposeFormat;
     597  }
     598
     599  /**
     600   * Validate the payment purpose for giropay payment.
     601   *
     602   * @author S-Public Services GmbH
     603   * @package GiroCheckout
     604   * @copyright Copyright (c) 2022, S-Public Services GmbH
     605   * @return array
     606   */
     607  public function validatePurpose($purpose) {
     608    $strPurpose = $purpose;
     609
     610    if (!empty($strPurpose)) {
     611      if (preg_match("/^[A-Za-z0-9\+\?\-\:\(\)\.\,\'\/\s]+$/", $strPurpose)) {
     612        return true;
     613      }
     614      else {
     615        return false;
     616      }
     617    }
     618
     619    return true;
     620  }
     621
     622  /**
     623   * Get shipping information for giropay.
     624   *
     625   * @author S-Public Services GmbH
     626   * @package GiroCheckout
     627   * @copyright Copyright (c) 2016, S-Public Services GmbH
     628   * @return array
     629   */
     630  public function getShippingData($order) {
     631    $aReturn = array();
     632
     633    try {
     634      $iNumProdVirtual = 0;
     635      $iNumProdPhysical = 0;
     636      $strCartType = self::CART_TYPE_PHYSICAL;
     637      $oCart = new GiroCheckout_SDK_Request_Cart();
     638
     639      $aProducts = $order->get_items();
     640
     641      if (!empty($aProducts)) {
     642        foreach ($aProducts as $aProduct) {
     643          $item_id = $aProduct['product_id'];
     644          $product = new WC_Product($item_id);
     645
     646          $iPrice = $product->get_price();
     647          $oCart->addItem($aProduct['name'], $aProduct['qty'], $iPrice * 100, $product->get_sku());
     648
     649          if ($product->is_downloadable() || $product->is_virtual()) {
     650            $iNumProdVirtual++;
     651          }
     652          else {
     653            $iNumProdPhysical++;
     654          }
     655        }
     656      }
     657
     658      // Set the shopping cart type
     659      if ($iNumProdVirtual > 0 && $iNumProdPhysical == 0) {
     660        $strCartType = self::CART_TYPE_DIGITAL;
     661
     662      }
     663      elseif ($iNumProdVirtual > 0 && $iNumProdPhysical > 0) {
     664        $strCartType = self::CART_TYPE_MIXED;
     665      }
     666
     667      $aReturn["oCart"] = $oCart;
     668      $aReturn["cartType"] = $strCartType;
     669
     670      if (method_exists($order, 'get_billing_first_name')) {
     671        $strFirstName = $order->get_billing_first_name();
     672      }
     673      else {
     674        $strFirstName = $order->billing_first_name;
     675      }
     676
     677      if (method_exists($order, 'get_billing_last_name')) {
     678        $strLastName = $order->get_billing_last_name();
     679      }
     680      else {
     681        $strLastName = $order->billing_last_name;
     682      }
     683
     684      if (method_exists($order, 'get_billing_company')) {
     685        $strCompany = $order->get_billing_company();
     686      }
     687      else {
     688        $strCompany = $order->billing_company;
     689      }
     690
     691      if (method_exists($order, 'get_billing_address_2')) {
     692        $strAddress2 = $order->get_billing_address_2();
     693      }
     694      else {
     695        $strAddress2 = $order->billing_address_2;
     696      }
     697
     698      if (method_exists($order, 'get_billing_address_1')) {
     699        $strAddress1 = $order->get_billing_address_1();
     700      }
     701      else {
     702        $strAddress1 = $order->billing_address_1;
     703      }
     704
     705      if (method_exists($order, 'get_billing_postcode')) {
     706        $strPostCode = $order->get_billing_postcode();
     707      }
     708      else {
     709        $strPostCode = $order->billing_postcode;
     710      }
     711
     712      if (method_exists($order, 'get_billing_city')) {
     713        $strCity = $order->get_billing_city();
     714      }
     715      else {
     716        $strCity = $order->billing_city;
     717      }
     718
     719      if (method_exists($order, 'get_billing_country')) {
     720        $strCountry = $order->get_billing_country();
     721      }
     722      else {
     723        $strCountry = $order->billing_country;
     724      }
     725
     726      if (method_exists($order, 'get_billing_email')) {
     727        $strEmail = $order->get_billing_email();
     728      }
     729      else {
     730        $strEmail = $order->billing_email;
     731      }
     732
     733      $aReturn["shippingAddresseFirstName"] = $strFirstName;
     734      $aReturn["shippingAddresseLastName"] = $strLastName;
     735      $aReturn["shippingCompany"] = $strCompany;
     736      $aReturn["shippingAdditionalAddressInformation"] = $strAddress2;
     737      $aReturn["shippingStreet"] = $strAddress1;
     738      $aReturn["shippingZipCode"] = $strPostCode;
     739      $aReturn["shippingCity"] = $strCity;
     740      $aReturn["shippingCountry"] = $strCountry;
     741      $aReturn["shippingEmail"] = $strEmail;
     742    }
     743    catch (Exception $exception) {
     744    }
     745
     746    return $aReturn;
     747  }
    495748}
  • girocheckout/trunk/payments/gc_ideal.php

    r2435416 r2795745  
    4040    $this->id = 'gc_ideal';
    4141    $this->method_title = __('iDEAL - online bank transfer (NL)', 'girocheckout');
    42     $this->icon = plugins_url('img/gc_ideal.jpg', dirname(__FILE__));
     42    $this->icon = plugins_url('img/gc_ideal.png', dirname(__FILE__));
    4343    $this->title = __('iDEAL - online bank transfer (NL)', 'girocheckout');
    4444    $this->has_fields = true;
  • girocheckout/trunk/readme.txt

    r2719666 r2795745  
    33Tags: woocommerce, payment
    44Requires at least: 4.5
    5 Tested up to: 6.0.0
     5Tested up to: 6.0.2
    66Requires PHP: 5.4
    77WC requires at least: 3.0.0
    8 WC tested up to: 6.3.1
     8WC tested up to: 6.9.4
    99Stable tag: trunk
    1010License: GPLv2 or later
     
    5454
    5555== Changelog ==
     56
     57= 4.1.7 =
     58* Changes in purpose validation for new giropay
     59
     60= 4.1.6 =
     61* Implemented support for new giropay
     62* Changed the iDEAL logo.
     63* Added SDK version 2.3.8
    5664
    5765= 4.1.5 =
Note: See TracChangeset for help on using the changeset viewer.