Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

cinolas

Members
  • Posts

    288
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by cinolas

  1. I'm having the same problem right now.

    PayPal 2.0 was written for php 7, and like you I'm still running osC 2.3.4 BS GOLD on php 5.6.4, so it doesn't work. This is what the error about the ? is about.

    I've put in some work to try and convert PayPal 2.0 to php 5.6.4 but there are a lot of files and I'm no good at php... I may have to ditch PayPal because of this.

    Have you found a solution?

  2. Unfortunately @Harald Ponce de Leon has retired from osCommerce support (after 21 yrs!!! understandable)

    Anyone has any idea how this could be achieved?

    I'm frankly surprised there isn't another post about it already. The CC fields on the confirmation page is slightly weird, and makes the payment page solely to chose the payment method. I'd be willing to pay for some help.

  3. I'm using the PayPal App 5.018 on osC 2.34 BS GOLD. I currently use 2 payments modules, Moneris for CC processing, and PayPal Express Checkout. On checkout_payment Moneris is pre-selected, with the CC input fields showing under the radio button, and then PayPal Express Checkout under that as an alternative.

    I'm switching from Moneris to Payments Pro (Direct Payment) via Payflow, which requires PayPal Express Checkout for PayPal payments. Everything seems to be working, but strangely the credit card input fields for Payments Pro (Direct Payment) are on checkout_confirmation, and not on checkout_payment like the Moneris module.

    Is there any way to move those fields to checkout_payment, and show confirmation data instead on checkout_confirmation?

    PayPal is suggesting I use the old version of PayPal Express Checkout (Payflow Edition) and Payment Pro (Direct Payment) from 2014... I'm not sure that's a good idea. Would it solve my problem?

     

    Thanks!

  4. @greasemonkey When you made the Moneris module for Phoenix, did you update it to use the new Moneris API? Or did you simply convert the process that was in the 2.2 / 2.3.x module?

    Moneris is saying that the 2.3.x module uses their old API (& 3dSecure 1.0) which is barely still supported by card issuers. I need to change this so it uses the new APIs...

  5. My problem is not fixed.... it seems the one thing it's really doing wrong is that it's keeping failed AVS transactions in PRE-AUTH. Then the customer tries a few times, it locks up their available balance in the mutiple PRE-AUTH and then we get angry customers.

  6. I'm not sure wether that's what was causing my problem or not, I'm not sure yet that it's fixed, but the format for the AVS response codes field is like "AWXYZ", no spaces, no commas. My selection of codes was a little wrong too.

  7. New problems with this module while AVS check is enabled (still on osC 2.3.4 BS GOLD). @greasemonkey have you see this before?

    I just activated AVS check because we were getting a lot more fraud than before. In an effort not to stop orders coming in from Quebec (where addresses often contain accents) I’ve elected to accept the following AVS verification codes: A, W, X, Y, Z. I did some testing and everything seemed to be working reliably.

    Looking at our logs this morning it’s apparent that there’s a problem. Some transactions are being approved without the AVS check while others are being declined because of a bad AVS check. Some are approved with bad CVD while others are declined, and some not checked at all. Some of the payments that came in without an order were in Pre-Auth even though the options sate to Complete the transaction. Even worst, some transactions are being approved but osCommerce isn’t getting the response and isn’t creating an order and the only sign we get of the payment being received is in our local Moneris transaction log.

    It worked pretty flawlessly when I had AVS disabled. The options hereunder were the same except that the AVS response field was left blank, and the "How would you like to perform CVD verification?" option was set to "Allow Unparticipated Cards".

    Here's my AVS enabled configuration:

    Enable Moneris Solutions eSELECTplus Module
    Do you want to accept eSELECTplus payments?
    True
     False
    Environment
    Test or Production Server?
     Test Server
    X  Production Server
    Transaction Completion
    Complete transaction on checkout or manual completion
     X Completion on checkout
     Manual Completion
    Store ID
    Store ID value obtained from the Moneris eSELECTplus Activation Letter
    MYSTOREID
    API Token
    API Token value obtained from the Store Settings Section of eSELECTPlus Merchant Resource Center
    MYAPITOKEN
    Order ID Prefix
    Prefix of the order id you would like on for the moneris transactions
    OSC_ORDER-
    Number Of Retries
    Number of Retries on the same credit card in the same transaction.
    (To disable retries limit, set it as '-1')
    10
    VISA Card Transactions
    How would you like to perform VISA card transaction(s)?
     Do not accept
     Normal Transaction only
    Perform AVS/CVD
     Perform VbV
     Perform VbV and AVS/CVD
    Master Card Transactions
    How would you like to perform Master Card transaction(s)?
     Do not accept
     Normal Transaction only
    Perform AVS/CVD
     Perform MCSC
     Perform MCSC and AVS/CVD
    American Express Transactions
    How would you like to perform American Express transaction(s)?
    Do not accept
     Normal Transaction only
     Perform CVD
    Novus/Discover Transactions
    How would you like to perform Novus/Discover transaction(s)?
    Do not accept
     Normal Transaction only
     Perform AVS
    Other Card Types Transactions
    Would you like to allow transaction(s) from other card types?
    Do not accept
     Normal Transaction only
    Card Verification Digit (CVD)
    How would you like to perform CVD verification?
     Do Not Perform
    Full Matches Only
     Allow Unparticipated Cards
    Address Verification Service (AVS)
    Which AVS response code would you allow? (To disable AVS, leave the field blank)
    A, W, X, Y, Z

    Add Shipping Tax
    Would you like to turn the module to calculate shipping tax?
     Yes
    No
    Payment Zone
    If a zone is selected, only enable this payment method for that zone.
    None
    Sort order of display.
    Sort order of display. Lowest is displayed first.
    0
    Set Order Status
    Set the status of orders made with this payment module to this value
    default

     

  8. @greasemonkey I'm having the same problem with the CanadaPost module not accepting the disallowed services, and storing 'array' in the DB instead.... I don't mind entering the disallowed services into the DB manually (unless there's an easy fix) but I can't figure out the proper format for the multiple choices. Specifically I entered those 2 services I need to disallow:

    I.IP.SURF, I.SP.SURF

    But when I look at the web interface it only seems to recognize Small Packet International Surface and not I.I P.SURF as "International Parcel Surface". Maybe it's not the format but the code... Is there a different code for that service now?

    Cheers!

  9. @Jack_mcs I'm back! <sigh>

    I know that what I'm doing with Gift Voucher is FAR beyond regular support, but I'm having one last problem and I'm hoping you may have insights: After all the modifications I've done, when I try checking out with my regular CC payment method (Moneris) no Gift Voucher involved, the CC#, CC Expiration, and CVS gets blanked out as described here: Thanks! 

     

  10. @Jack_mcs I'm going to bug you once more, about something that is far, FAR, beyond the scope of support :)

    I'm trying to move the gift voucher code redeem field. I don't want it on checkout_payment.php but on a page of it's own (redeem_gv.php) accessed from My Account. Is that a customization that I could hire you to do? PM me.

    I looked into it, and it looks like I would have to split the credit_selection() function into 2 different functions, one for the checkbox, one for the redeem code field. And then somehow build a form on redeem_gv.php that stands alone and calls the order_total classes. I just need a field to type in the gv code, and then run the verification and add the amount to the user's account. It sounds simple, but I'm not sure I can manage that myself in a timely manner.

    The reason is that Gift Voucher doesn't work well with Pay Without Account (obviously, since the balance must be stored in the user's account), I've modified account_pwa.php to prevent guest checkout when there's a gift voucher in the cart. If I can move the redeem process to a page accessed from My Account then I believe that covers me and guest users won't be able to buy or redeem gift vouchers.

    Let me know!

  11. Well, I've found a solution to my problem, so I'm posting it here too, in case others are trying to achieve something similar. If you are using the Gift Voucher Secure contrib with a payment module such as the Free payment module linked above, you simply need to comment out line 64 of checkout_process.php, like so:

    //Begin Gift Vouchers Secure
       //if ($credit_covers) $payment=''; 
    //End Gift Vouchers Secure

    $payment does not need to be emptied since we are using a payment method (the modified Free module).

  12. 11 hours ago, 14steve14 said:

    I had this module working on my old Frozen site to sell free downloads and it worked faultlessly. Have you set it to be the first payment module selected and set the correct number of other payment modules as explained in the instructions. I had problems with this until I got it right.

    Thanks, @14steve14. I have set it to be the first payment module, but it looks like setting the correct number of other payment modules was just for when you want to bypass the payment page. I do need the payment page still, that's where the Gift Vouchers are applied.

    From the install instructions:

    Quote

    4. OPTIONAL: TO BYPASS PAYMENT PAGE
    - MUST: Go into your shops admin module >> paymet, set "Free Product" payment module as the first payment method at "Sort order of display". Make it 0 and the other payment method(s) higher.

    - Open your oSC file "catalog/checkout_payment.php"

    - just before:
      require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);

      ADD:
      // BOF skip if only 1 payment method available. IF YOU HAVE 2 PAYMENT METHODS then "set tep_count_payment_modules() == 2"
        if (tep_count_payment_modules() == 1 ) {
        $payment_select = $payment_modules->selection();
        $payment = $payment_select[0]['id'];
        if (!tep_session_is_registered('payment')) tep_session_register('payment');
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
        }
      // EOF

    Though even if you bypass both the payment and shipping pages, it's the confirmation page that refuses my order. I am not sure why. and not sure how to debug past that is_object($$payment)

    Thanks for the help!

  13. Understood, I will.

    I just thought that part would be instrumental to the next version of this contrib working well with the Free payment module mod. But yeah, I get it. I'll post here when I have a solution.

    I did follow the link and read the threads, but none of them actually come up with an answer. The closest they get is with the same Free payment module, when used with a different coupon contrib that applies the coupon on the shopping cart page, so it's all about bypassing the payment page. I need the payment page because that's where the gift vouchers are applied :)

    Will post in General.

    Cheers!

  14. SO CLOSE! :D

    Debugging this led me to line 90 of checkout_process.php where this IF sends me back to checkout_payment.php with the error:

    if ( ($payment_modules->selected_module != $payment) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
      }

    Specifically this part returns TRUE:

    !is_object($$payment)

    $payment = 'free' so $$payment = $free, and if I put a var_dump on checkout_confirmation.php I see:

    ["free"]=>
        object(free)#19 (5) {
          ["code"]=>
          string(4) "free"
          ["title"]=>
          string(36) "Pay with my Gift Certificate balance"
          ["description"]=>
          string(12) "Free Product"
          ["enabled"]=>
          bool(true)
          ["sort_order"]=>
          string(1) "1"
        }

    It looks like an object to me. But I admittedly don't know much about php objects... I'll keep on kicking it until it works, I'm so close.

  15. Specifically: 

    is_object($$payment)

    Which is weird because $payment = 'free' and a var_dump on checkout_confirmation.php shows:

    ["free"]=>
        object(free)#19 (5) {
          ["code"]=>
          string(4) "free"
          ["title"]=>
          string(36) "Pay with my Gift Certificate balance"
          ["description"]=>
          string(12) "Free Product"
          ["enabled"]=>
          bool(true)
          ["sort_order"]=>
          string(1) "1"
        }

     

  16. I'm trying to install this contribution on osC 2.3.4 BS GOLD, to be used with the Gift Voucher contribution: https://apps.oscommerce.com/KMILS&amp;gift-vouchers-secure-v1-0

    Everything is in place but when I get to checkout_confirmation.php and click the Confirm button, I get sent back to the checkout_payment.php with this error:

    "Please select a payment method for your order."

    The problem is caused by line 90 of checkout_process.php:

    if ( ($payment_modules->selected_module != $payment) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
      }

    The first condition is false because $payment_modules->selected_module = NULL

    Why would it be false?

  17. Ok, so it wasn't that difficult after all.

    I added an ID to the hidden checkbox. In the __construct() function of /includes/modules/order_total/ot_gv.php to this:

    function __construct() {
          global $order, $currencies;	
          $this->code = 'ot_gv';
          $this->title = MODULE_ORDER_TOTAL_GV_TITLE;
          $this->header = MODULE_ORDER_TOTAL_GV_HEADER;
          $this->description = MODULE_ORDER_TOTAL_GV_DESCRIPTION;
          $this->enabled = MODULE_ORDER_TOTAL_GV_STATUS;
          $this->sort_order = MODULE_ORDER_TOTAL_GV_SORT_ORDER;
          $this->include_shipping = MODULE_ORDER_TOTAL_GV_INC_SHIPPING;
          $this->include_tax = MODULE_ORDER_TOTAL_GV_INC_TAX;
          $this->calculate_tax = MODULE_ORDER_TOTAL_GV_CALC_TAX;
          $this->credit_tax = MODULE_ORDER_TOTAL_GV_CREDIT_TAX;
          $this->tax_class  = MODULE_ORDER_TOTAL_GV_TAX_CLASS;
          $this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX;
          $this->credit_class = true;
          // Added test to see if there's enough Gift Certificate balance to cover the entire order. If so, hide the Gift Certificate checkbox, if not hide the Free payment module and show the checkbox
          if (tep_session_is_registered('customer_id')) {
              $gv_query = tep_db_query("select amount from coupon_gv_customer where customer_id = '" . tep_db_input($_SESSION['customer_id']) . "'");
              $gv_result = tep_db_fetch_array($gv_query);
          }
          If ($order->info['total'] > $gv_result['amount']) {
                $this->user_prompt = MODULE_ORDER_TOTAL_GV_USER_PROMPT;
                $this->checkbox = $this->user_prompt . ' (' . $currencies->format($gv_result['amount']) . ') <input type="checkbox" onClick="submitFunction()" id="GiftCertBox" name="' . 'c' . $this->code . '">';
          } else {
                $this->user_prompt = '';
                $this->checkbox = $this->user_prompt . '<input type="hidden" value="0" id="GiftCertBox "name="' . 'c' . $this->code . '">';
          }
          $this->output = array();
        }

    Then I modified the javascript_validation() function of /includes/classes/payment.php, line 76:

    function javascript_validation() {
          $js = '';
          if (is_array($this->modules)) {
            $js = '<script><!-- ' . "\n" .
                  'function check_form() {' . "\n" .
                  '  var error = 0;' . "\n" .
                  '  var error_message = "' . JS_ERROR . '";' . "\n" .
                  '  var payment_value = null;' . "\n" .
                  '  var gc_box = document.getElementById("GiftCertBox");' . "\n" .
                  '  if (document.checkout_payment.payment.length) {' . "\n" .
                  '    for (var i=0; i<document.checkout_payment.payment.length; i++) {' . "\n" .
                  '      if (document.checkout_payment.payment[i].checked) {' . "\n" .
                  '        payment_value = document.checkout_payment.payment[i].value;' . "\n" .
                  '      }' . "\n" .
                  '    }' . "\n" .
                  '  } else if (document.checkout_payment.payment.checked) {' . "\n" .
                  '    payment_value = document.checkout_payment.payment.value;' . "\n" .
                  '  } else if (document.checkout_payment.payment.value) {' . "\n" .
                  '    payment_value = document.checkout_payment.payment.value;' . "\n" .
                  '  }' . "\n\n";
    
            reset($this->modules);
            while (list(, $value) = each($this->modules)) {
              $class = substr($value, 0, strrpos($value, '.'));
              if ($GLOBALS[$class]->enabled) {
                $js .= $GLOBALS[$class]->javascript_validation();
              }
            }
    
            //$js .= "\n" . '  if (payment_value == null) {' . "\n" .
            //       '    error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
            //       '    error = 1;' . "\n" .
            //       '  }' . "\n\n" .
            //       '  if (error == 1) {' . "\n" .
            //       '    alert(error_message);' . "\n" .
            //       '    return false;' . "\n" .
            //       '  } else {' . "\n" .
            //       '    return true;' . "\n" .
            //       '  }' . "\n" .
            //       '}' . "\n" .
            //       '//--></script>' . "\n";
    		// Begin Gift Vouchers Secure
    
            $js .= "\n" . '  if (payment_value == null && submitter != 1) {' . "\n" . 
                   '    error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
                   '    error = 1;' . "\n" .
                   '  }' . "\n\n" .
    			   '  if (payment_value == "free") {' . "\n" .
    			   '      	gc_box.value = 1;' . "\n" .
    			   '   }' . "\n\n" .
                   '  if (error == 1 && submitter != 1) {' . "\n" . 
                   '    alert(error_message);' . "\n" .
                   '    return false;' . "\n" .
                   '  } else {' . "\n" .
                   '    return true;' . "\n" .
                   '  }' . "\n" .
                   '}' . "\n" .
                   '//--></script>' . "\n";
            // End Gift Vouchers Secure

    Basically just adding:

    var gc_box = document.getElementById("GiftCertBox");

    At the top, and at the bottom before the return:

    if (payment_value == "free") {
       gc_box.value = 1;
    }

    And that properly changes the value of the hidden checkbox! So on the checkout_confirmation.php page it shows Gift Voucher amount being removed, and the total is $0, and the selected payment method is the Free payment method as it all should be!

  18. Now, the only thing left to do for this to work, is to change the JS so it sets the value of the hidden Gift Vouher checkbox to 1 when the Free payment method is selected... or otherwise cause the gift voucher balance to be applied just as if the customer had checked the Gift Voucher checkbox.

    That JS, after the Gift Voucher modifications, looks like this:

    function javascript_validation() {
          $js = '';
          if (is_array($this->modules)) {
            $js = '<script><!-- ' . "\n" .
                  'function check_form() {' . "\n" .
                  '  var error = 0;' . "\n" .
                  '  var error_message = "' . JS_ERROR . '";' . "\n" .
                  '  var payment_value = null;' . "\n" .
                  '  if (document.checkout_payment.payment.length) {' . "\n" .
                  '    for (var i=0; i<document.checkout_payment.payment.length; i++) {' . "\n" .
                  '      if (document.checkout_payment.payment[i].checked) {' . "\n" .
                  '        payment_value = document.checkout_payment.payment[i].value;' . "\n" .
                  '      }' . "\n" .
                  '    }' . "\n" .
                  '  } else if (document.checkout_payment.payment.checked) {' . "\n" .
                  '    payment_value = document.checkout_payment.payment.value;' . "\n" .
                  '  } else if (document.checkout_payment.payment.value) {' . "\n" .
                  '    payment_value = document.checkout_payment.payment.value;' . "\n" .
                  '  }' . "\n\n";
    
            reset($this->modules);
            while (list(, $value) = each($this->modules)) {
              $class = substr($value, 0, strrpos($value, '.'));
              if ($GLOBALS[$class]->enabled) {
                $js .= $GLOBALS[$class]->javascript_validation();
              }
            }
    
            //$js .= "\n" . '  if (payment_value == null) {' . "\n" .
            //       '    error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
            //       '    error = 1;' . "\n" .
            //       '  }' . "\n\n" .
            //       '  if (error == 1) {' . "\n" .
            //       '    alert(error_message);' . "\n" .
            //       '    return false;' . "\n" .
            //       '  } else {' . "\n" .
            //       '    return true;' . "\n" .
            //       '  }' . "\n" .
            //       '}' . "\n" .
            //       '//--></script>' . "\n";
    		// Begin Gift Vouchers Secure
    
            $js .= "\n" . '  if (payment_value == null && submitter != 1) {' . "\n" . 
                   '    error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
                   '    error = 1;' . "\n" .
                   '  }' . "\n\n" .
                   '  if (error == 1 && submitter != 1) {' . "\n" . 
                   '    alert(error_message);' . "\n" .
                   '    return false;' . "\n" .
                   '  } else {' . "\n" .
                   '    return true;' . "\n" .
                   '  }' . "\n" .
                   '}' . "\n" .
                   '//--></script>' . "\n";
            // End Gift Vouchers Secure
          }
          return $js;
        }

    I'm no better at JS than I am at php... though it looks like the "payment_value" should contain which payment module is selected.

    "Submitter" is set to 1 by javascript when the user clicks the gift voucher checkbox. But I don't think submitter=1 means the checkbox is checked, because it's not a toggle behavior:

    var submitter = null;
    function submitFunction() {
      submitter = 1;
    }

    I probably don't understand what it's doing :) I will post on stackexchange or something. I'll let you know if I find a solution.

    Cheers!

×
×
  • Create New...