Plugin Directory

Changeset 2118404


Ignore:
Timestamp:
07/05/2019 10:18:47 PM (7 years ago)
Author:
girosolution
Message:
  1. 4.0.5
Location:
girocheckout/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • girocheckout/trunk/girocheckout.php

    r2099900 r2118404  
    1010 * Plugin Name: GiroCheckout
    1111 * Description: Plugin to integrate the GiroCheckout payment methods into WooCommerce.
    12  * Version:     4.0.4.1
     12 * Version:     4.0.5
    1313 * Author:      GiroSolution GmbH
    1414 * Author URI:  http://www.girosolution.de
  • girocheckout/trunk/library/GiroCheckout_Utility.php

    r2099900 r2118404  
    1919   */
    2020  public static function getVersion() {
    21     return '4.0.4.1';
     21    return '4.0.5';
    2222  }
    2323
     
    7777    }
    7878
     79    $transaction_id = (string) apply_filters( 'woocommerce_order_number', $iOrderId, $p_oOrder );
     80    if( !empty($transaction_id) ) {
     81      $iOrderId = $transaction_id;
     82    }
     83
    7984    $strPurpose = str_replace( "{ORDERID}", $iOrderId, $strPurpose );
    8085    $strPurpose = str_replace( "{CUSTOMERID}", get_current_user_id(), $strPurpose );
     
    9196  public static function formatText($p_strText) {
    9297    return mb_convert_encoding( $p_strText, "UTF-8" );
    93   }   
     98  }
     99
     100  /**
     101   * Get order ID from custom order number.
     102   *
     103   * @param string $order_number Order number to search for
     104   * @return bool|integer Internal order ID or FALSE if not found.
     105   */
     106  public static function get_order_id_by_order_number( $order_number ) {
     107
     108    if( ($order = wc_get_order($order_number)) != NULL ) {
     109      // Order_number is already valid internal id
     110      return $order_number;
     111    }
     112
     113    $aOrders = wc_get_orders( array( 'limit' => -1 ) );
     114    foreach ( $aOrders as $order ) {
     115      if ( $order->get_order_number() == $order_number ) {
     116        return $order->get_id();
     117      }
     118    }
     119    return false;
     120  }
    94121}
  • girocheckout/trunk/payments/gc_bluecode.php

    r2099898 r2118404  
    1010  /** @var string  */
    1111  public $password;
    12 
    13   /** @var string  */
    14   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1512
    1613  /** @var string  */
     
    229226      $amount = $order->get_total();
    230227      $currency = get_woocommerce_currency();
    231       $transaction_id = $orderID;
     228      $transaction_id = $order->get_order_number();
    232229      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    233230      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
     
    238235      $reqPayment->addParam('merchantId', $merchantId)
    239236                 ->addParam('projectId', $projectId)
    240                  ->addParam('merchantTxId', (int) $transaction_id)
     237                 ->addParam('merchantTxId', $transaction_id)
    241238                 ->addParam('amount', round($amount * 100))
    242239                 ->addParam('currency', $currency)
     
    245242                 ->addParam('urlNotify', $urlNotify)
    246243                 ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    247                  ->addParam('orderId', (int) $transaction_id)
     244                 ->addParam('orderId', $transaction_id)
    248245                 ->addParam('customerId', get_current_user_id());
    249246
     
    251248
    252249      if ($reqPayment->requestHasSucceeded()) {
     250        // Add the girocheckout transaction Id value to the order
     251        if (!add_post_meta($orderID, '_girocheckout_reference', $reqPayment->getResponseParam('reference'), true)) {
     252          update_post_meta($orderID, '_girocheckout_reference', $reqPayment->getResponseParam('reference'));
     253        }
    253254        $strUrlRedirect = $reqPayment->getResponseParam('redirect');
    254255      } else {
     
    303304      $notify->parseNotification($_GET);
    304305
    305       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     306      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     307      $order = new WC_Order( $iOrderId );
    306308      $bPaymentSuccess = $notify->paymentSuccessful();
    307309
     
    371373      $notify->parseNotification($_GET);
    372374
    373       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    374       $order = new WC_Order($iOrderId);
    375      
     375      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     376      $order = new WC_Order( $iOrderId );
     377
    376378      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    377379      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_creditcard.php

    r2082698 r2118404  
    1111  /** @var string */
    1212  public $password;
    13 
    14   /** @var string */
    15   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1613
    1714  /** @var string */
     
    8077
    8178    $strLogoName = $this->getExtendedLogo();
    82     if (strlen($strLogoName) > 0)
     79    if (strlen($strLogoName) > 0) {
    8380      $this->icon = plugins_url('img/' . $strLogoName, dirname(__FILE__));
    84     else
     81    }
     82    else {
    8583      $this->icon = plugins_url('img/gc_creditcard.jpg', dirname(__FILE__));
     84    }
    8685
    8786    // Hooks
     
    237236  public function addGateway($methods)
    238237  {
    239 
    240238    $methods[] = $this->id;
    241 
    242239    return $methods;
    243240  }
     
    302299      $amount = $order->get_total();
    303300      $currency = get_woocommerce_currency();
    304       $transaction_id = $orderID;
     301      $transaction_id = $order->get_order_number();
    305302      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    306303      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
    307304
    308       if( $transactiontype == "authorize" )
     305      if( $transactiontype == "authorize" ) {
    309306        $strTransType = __GIROCHECKOUT_TRANTYP_AUTH;
    310       else
     307      }
     308      else {
    311309        $strTransType = __GIROCHECKOUT_TRANTYP_SALE;
     310      }
    312311
    313312      $request = new GiroCheckout_SDK_Request('creditCardTransaction');
     
    315314      $request->addParam('merchantId', $merchantId)
    316315        ->addParam('projectId', $projectId)
    317         ->addParam('merchantTxId', (int)$transaction_id)
     316        ->addParam('merchantTxId', $transaction_id)
    318317        ->addParam('amount', round($amount * 100))
    319318        ->addParam('currency', $currency)
     
    323322        ->addParam('urlNotify', $urlNotify)
    324323        ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    325         ->addParam('orderId', (int)$transaction_id)
     324        ->addParam('orderId', $transaction_id)
    326325        ->addParam('customerId', get_current_user_id())
    327326        ->addParam('type', $strTransType)
     
    389388      $notify->parseNotification($_GET);
    390389
    391       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     390      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     391      $order = new WC_Order( $iOrderId );
    392392      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    393393      $bPaymentSuccess = $notify->paymentSuccessful();
     
    450450      $notify->parseNotification($_GET);
    451451
    452       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    453       $order = new WC_Order($iOrderId);
     452      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     453      $order = new WC_Order( $iOrderId );
    454454      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    455455      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_directdebit.php

    r2082698 r2118404  
    1111  /** @var string */
    1212  public $password;
    13 
    14   /** @var string */
    15   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1613
    1714  /** @var string */
     
    412409      $amount = $order->get_total();
    413410      $currency = get_woocommerce_currency();
    414       $transaction_id = $orderID;
    415 
    416       if ($transactiontype == "authorize")
     411      $transaction_id = $order->get_order_number();
     412
     413      if ($transactiontype == "authorize") {
    417414        $strTransType = __GIROCHECKOUT_TRANTYP_AUTH;
    418       else
     415      }
     416      else {
    419417        $strTransType = __GIROCHECKOUT_TRANTYP_SALE;
     418      }
    420419
    421420      if ($this->useexternalformservice) {
     
    424423        $request->addParam('merchantId', $merchantId)
    425424                ->addParam('projectId', $projectId)
    426                 ->addParam('merchantTxId', (int)$transaction_id)
     425                ->addParam('merchantTxId', $transaction_id)
    427426                ->addParam('amount', round($amount * 100))
    428427                ->addParam('currency', $currency)
     
    431430                ->addParam('urlNotify', $urlNotify)
    432431                ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    433                 ->addParam('orderId', (int)$transaction_id)
     432                ->addParam('orderId', $transaction_id)
    434433                ->addParam('customerId', get_current_user_id())
    435434                ->addParam('type', $strTransType)
     
    577576    $notify->parseNotification($_GET);
    578577
    579     $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     578    $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     579    $order = new WC_Order( $iOrderId );
    580580    $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    581581    $bPaymentSuccess = $notify->paymentSuccessful();
     
    639639    $notify->parseNotification($_GET);
    640640
    641     $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    642     $order = new WC_Order($iOrderId);
     641    $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     642    $order = new WC_Order( $iOrderId );
    643643    $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    644644    $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_eps.php

    r2082698 r2118404  
    1010  /** @var string  */
    1111  public $password;
    12 
    13   /** @var string  */
    14   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1512
    1613  /** @var string  */
     
    251248      $amount = $order->get_total();
    252249      $currency = get_woocommerce_currency();
    253       $transaction_id = $orderID;
     250      $transaction_id = $order->get_order_number();
    254251      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    255252      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
     
    260257      $reqPayment->addParam('merchantId', $merchantId)
    261258                 ->addParam('projectId', $projectId)
    262                  ->addParam('merchantTxId', (int) $transaction_id)
     259                 ->addParam('merchantTxId', $transaction_id)
    263260                 ->addParam('amount', round($amount * 100))
    264261                 ->addParam('currency', $currency)
     
    267264                 ->addParam('urlNotify', $urlNotify)
    268265                 ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    269                  ->addParam('orderId', (int) $transaction_id)
     266                 ->addParam('orderId', $transaction_id)
    270267                 ->addParam('customerId', get_current_user_id())
    271268                 ->submit();
    272269
    273270      if ($reqPayment->requestHasSucceeded()) {
     271        // Add the girocheckout transaction Id value to the order
     272        if (!add_post_meta($orderID, '_girocheckout_reference', $reqPayment->getResponseParam('reference'), true)) {
     273          update_post_meta($orderID, '_girocheckout_reference', $reqPayment->getResponseParam('reference'));
     274        }
    274275        $strUrlRedirect = $reqPayment->getResponseParam('redirect');
    275276      } else {
     
    324325      $notify->parseNotification($_GET);
    325326
    326       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     327      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     328      $order = new WC_Order( $iOrderId );
    327329      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    328330      $bPaymentSuccess = $notify->paymentSuccessful();
     
    388390      $notify->parseNotification($_GET);
    389391
    390       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    391       $order = new WC_Order($iOrderId);
     392      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     393      $order = new WC_Order( $iOrderId );
    392394      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    393395      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_giropay.php

    r2082698 r2118404  
    1010  /** @var string  */
    1111  public $password;
    12 
    13   /** @var string  */
    14   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1512
    1613  /** @var string  */
     
    250247      $amount = $order->get_total();
    251248      $currency = get_woocommerce_currency();
    252       $transaction_id = $orderID;
     249      $transaction_id = $order->get_order_number();
    253250      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    254251      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
    255 
    256252
    257253      // Sends request to Girocheckout.
     
    260256      $reqPayment->addParam('merchantId', $merchantId)
    261257                 ->addParam('projectId', $projectId)
    262                  ->addParam('merchantTxId', (int) $transaction_id)
     258                 ->addParam('merchantTxId', $transaction_id)
    263259                 ->addParam('amount', round($amount * 100))
    264260                 ->addParam('currency', $currency)
     
    267263                 ->addParam('urlNotify', $urlNotify)
    268264                 ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    269                  ->addParam('orderId', (int) $transaction_id)
     265                 ->addParam('orderId', $transaction_id)
    270266                 ->addParam('customerId', get_current_user_id())
    271267                 ->submit();
    272268
    273269      if ($reqPayment->requestHasSucceeded()) {
     270        // Add the girocheckout transaction Id value to the order
     271        if (!add_post_meta($orderID, '_girocheckout_reference', $reqPayment->getResponseParam('reference'), true)) {
     272          update_post_meta($orderID, '_girocheckout_reference', $reqPayment->getResponseParam('reference'));
     273        }
    274274        $strUrlRedirect = $reqPayment->getResponseParam('redirect');
    275275      } else {
     
    324324      $notify->parseNotification($_GET);
    325325
    326       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     326      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     327      $order = new WC_Order( $iOrderId );
    327328      $bPaymentSuccess = $notify->paymentSuccessful();
    328329
     
    394395      $notify->parseNotification($_GET);
    395396
    396       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    397       $order = new WC_Order($iOrderId);
     397      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     398      $order = new WC_Order( $iOrderId );
    398399     
    399400      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
  • girocheckout/trunk/payments/gc_ideal.php

    r2082698 r2118404  
    1111  /** @var string */
    1212  public $password;
    13 
    14   /** @var string */
    15   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1613
    1714  /** @var string */
     
    321318      $amount = $order->get_total();
    322319      $currency = get_woocommerce_currency();
    323       $transaction_id = $orderID;
     320      $transaction_id = $order->get_order_number();
    324321      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    325322      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
     
    330327      $request->addParam('merchantId', $merchantId)
    331328              ->addParam('projectId', $projectId)
    332               ->addParam('merchantTxId', (int)$transaction_id)
     329              ->addParam('merchantTxId', $transaction_id)
    333330              ->addParam('amount', round($amount * 100))
    334331              ->addParam('currency', $currency)
     
    338335              ->addParam('urlNotify', $urlNotify)
    339336              ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    340               ->addParam('orderId', (int)$transaction_id)
     337              ->addParam('orderId', $transaction_id)
    341338              ->addParam('customerId', get_current_user_id())
    342339              ->submit();
     
    401398      $notify->parseNotification($_GET);
    402399
    403       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     400      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     401      $order = new WC_Order( $iOrderId );
    404402      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    405403      $bPaymentSuccess = $notify->paymentSuccessful();
     
    462460      $notify->parseNotification($_GET);
    463461
    464       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    465       $order = new WC_Order($iOrderId);
     462      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     463      $order = new WC_Order( $iOrderId );
    466464      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    467465      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_maestro.php

    r2082698 r2118404  
    1111  /** @var string */
    1212  public $password;
    13 
    14   /** @var string */
    15   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1613
    1714  /** @var string */
     
    234231      $amount = $order->get_total();
    235232      $currency = get_woocommerce_currency();
    236       $transaction_id = $orderID;
     233      $transaction_id = $order->get_order_number();
    237234      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    238235      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
     
    242239      $request->addParam('merchantId', $merchantId)
    243240              ->addParam('projectId', $projectId)
    244               ->addParam('merchantTxId', (int)$transaction_id)
     241              ->addParam('merchantTxId', $transaction_id)
    245242              ->addParam('amount', round($amount * 100))
    246243              ->addParam('currency', $currency)
     
    249246              ->addParam('urlNotify', $urlNotify)
    250247              ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    251               ->addParam('orderId', (int)$transaction_id)
     248              ->addParam('orderId', $transaction_id)
    252249              ->addParam('customerId', get_current_user_id())
    253250              ->submit();
     
    313310      $notify->parseNotification($_GET);
    314311
    315       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     312      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     313      $order = new WC_Order( $iOrderId );
    316314      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    317315      $bPaymentSuccess = $notify->paymentSuccessful();
     
    374372      $notify->parseNotification($_GET);
    375373
    376       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    377       $order = new WC_Order($iOrderId);
     374      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     375      $order = new WC_Order( $iOrderId );
    378376      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    379377      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_paydirekt.php

    r2082698 r2118404  
    1111  /** @var string */
    1212  public $password;
    13 
    14   /** @var string */
    15   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1613
    1714  /** @var string */
     
    269266      $amount = $order->get_total();
    270267      $currency = get_woocommerce_currency();
    271       $transaction_id = $orderID;
     268      $transaction_id = $order->get_order_number();
    272269      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    273270      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
     
    276273      $iNumProdPhysical = 0;
    277274
    278       if( $transactiontype == "authorize" )
     275      if( $transactiontype == "authorize" ) {
    279276        $strTransType = __GIROCHECKOUT_TRANTYP_AUTH;
    280       else
     277      }
     278      else {
    281279        $strTransType = __GIROCHECKOUT_TRANTYP_SALE;
     280      }
    282281
    283282      $oCart = new GiroCheckout_SDK_Request_Cart();
     
    392391      $request->addParam('merchantId', $merchantId)
    393392                ->addParam('projectId', $projectId)
    394                 ->addParam('merchantTxId', (int)$transaction_id)
     393                ->addParam('merchantTxId', $transaction_id)
    395394                ->addParam('amount', round($amount * 100))
    396395                ->addParam('currency', $currency)
     
    411410                ->addParam('urlNotify', $urlNotify)
    412411                ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    413                 ->addParam('orderId', (int)$transaction_id)
     412                ->addParam('orderId', $transaction_id)
    414413                ->addParam('customerId', get_current_user_id())
    415414                ->addParam('shoppingCartType', $strCartType)
     
    479478      $notify->parseNotification($_GET);
    480479
    481       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     480      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     481      $order = new WC_Order( $iOrderId );
    482482      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    483483      $bPaymentSuccess = $notify->paymentSuccessful();
     
    542542      $notify->parseNotification($_GET);
    543543
    544       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    545       $order = new WC_Order($iOrderId);
     544      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     545      $order = new WC_Order( $iOrderId );
    546546      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    547547      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/payments/gc_sofortuw.php

    r2082698 r2118404  
    1010  /** @var string  */
    1111  public $password;
    12 
    13   /** @var string  */
    14   public $sourceid = 'e70f2793e318713d8491a2bbb98edfd7';
    1512
    1613  /** @var string  */
     
    224221      $amount = $order->get_total();
    225222      $currency = get_woocommerce_currency();
    226       $transaction_id = $orderID;
     223      $transaction_id = $order->get_order_number();
    227224      $urlRedirect = add_query_arg('type', 'redirect', add_query_arg('wc-api', $this->id, home_url('/')));
    228225      $urlNotify = add_query_arg('type', 'notify', add_query_arg('wc-api', $this->id, home_url('/')));
     
    232229      $request->addParam('merchantId', $merchantId)
    233230              ->addParam('projectId', $projectId)
    234               ->addParam('merchantTxId', (int) $transaction_id)
     231              ->addParam('merchantTxId', $transaction_id)
    235232              ->addParam('amount', round($amount * 100))
    236233              ->addParam('currency', $currency)
     
    239236              ->addParam('urlNotify', $urlNotify)
    240237              ->addParam('sourceId', GiroCheckout_Utility::getGcSource())
    241               ->addParam('orderId', (int) $transaction_id)
     238              ->addParam('orderId', $transaction_id)
    242239              ->addParam('customerId', get_current_user_id())
    243240              ->submit();
    244241
    245242      if ($request->requestHasSucceeded()) {
     243        // Add the girocheckout transaction Id value to the order
     244        if (!add_post_meta($orderID, '_girocheckout_reference', $request->getResponseParam('reference'), true)) {
     245          update_post_meta($orderID, '_girocheckout_reference', $request->getResponseParam('reference'));
     246        }
    246247        $strUrlRedirect = $request->getResponseParam('redirect');
    247248      } else {
     
    297298      $notify->parseNotification($_GET);
    298299
    299       $order = new WC_Order($notify->getResponseParam('gcMerchantTxId'));
     300      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     301      $order = new WC_Order( $iOrderId );
    300302      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    301303      $bPaymentSuccess = $notify->paymentSuccessful();
     
    360362      $notify->parseNotification($_GET);
    361363
    362       $iOrderId = $notify->getResponseParam('gcMerchantTxId');
    363       $order = new WC_Order($iOrderId);
     364      $iOrderId = GiroCheckout_Utility::get_order_id_by_order_number( $notify->getResponseParam('gcMerchantTxId') );
     365      $order = new WC_Order( $iOrderId );
    364366      $paymentMsg = GiroCheckout_SDK_ResponseCode_helper::getMessage($notify->getResponseParam('gcResultPayment'), $this->lang);
    365367      $order->add_order_note($paymentMsg);
  • girocheckout/trunk/readme.txt

    r2097544 r2118404  
    33Tags: woocommerce, payment
    44Requires at least: 4.5
    5 Tested up to: 5.2
     5Tested up to: 5.2.2
    66Requires PHP: 5.4
    77WC requires at least: 3.0.0
    8 WC tested up to: 3.6.4
     8WC tested up to: 3.6.5
    99Stable tag: trunk
    1010License: GPLv2 or later
     
    5555== Changelog ==
    5656
     57= 4.0.5 =
     58* Order numbers are now compatible with custom formats and may differ from orderid
     59
    5760= 4.0.4 =
    5861* Added support for Bluecode E-Commerce payment method
Note: See TracChangeset for help on using the changeset viewer.