Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

asro2004

Pioneers
  • Posts

    34
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by asro2004

  1. On 12/4/2019 at 11:08 PM, 14steve14 said:

    I recently installed the latest update and since then have noticed that on the store invoice the Total and figure are above the Shipping costs and the Sub total. Is it just me or should they be the other way around with the sub total, then the shipping then the total.  Looking back through previous orders with the Stripe payment module the order was correct. All other payment modules show correctly on my altered invoice layout.

    Image to show difference below.

    invoice-totals-latest.jpg

    invoice-totals-old.jpg

    Please check the sort order of the totals in Modules ~ Order Totals. If all the totals have the same sort order number, that could cause the totals to be in different sequence under different circumstances, depending on what previous queries mysql had run and how it had managed it's cache.

    The order totals are saved to the database in includes/modules/payment/stripe_sca.php lines 207-214, with the configured sort order, and the order email totals are output in lines 491-493 of that module. The $order_totals variable is set in checkout_process.php using the output of order_total->process(). That prepares the totals in the sequence in which the totals appear in the database configuration table, record with the configuration_key: MODULE_ORDER_TOTAL_INSTALLED. So the email prepared by the stripe_sca module should have the sub totals in the sequence in the configuration table record, but if the order is reprinted from the administration order screen, the totals could be out of sequence if the sort order had not been set.

    The customer email should be ok, and the problem only occur when the order is re-printed.

     

  2. I've updated the module to version 1.0.13 to remove a potential SQL injection and tidy the account saved cards display when there are multiple cards (thanks @Smoky Barnable).

    @mhsuffolk I'm afraid the current version does not support Apple Pay, etc but looking at the Stripe documentation, it does not look too difficult to add. It just involves adding an extra HTML element to host a 'Payment Request' button which is displayed for certain compatible browsers, and some javascript and server code to support the creation and processing of a 'PaymentRequest' in a similar fashion to the handling of the 'PaymentIntent' in the current version. I'll add it to my list of things to do.

  3. Security issue

    There can be a security problem for anyone who installed version 1.0.3 of this module, with some obsolete values being left in the configuration table when the modules is updated to a later version. Please run the following SQL to remove the obsolete values:

    DELETE FROM configuration WHERE configuration_key IN ('MODULE_PAYMENT_STRIPE_SCA_PUBLISHABLE_KEY','MODULE_PAYMENT_STRIPE_SCA_SECRET_KEY','MODULE_PAYMENT_STRIPE_SCA_WEBHOOK_SECRET')

     

  4. 20 hours ago, 14steve14 said:

    I cant even find where the language files are referenced.

    The language files are loaded by the code that loads all the modules: /admin/modules.php for the admin pages, and /includes/classes/payments.php for the checkout pages.

     

  5. 15 hours ago, 14steve14 said:

    I am having a bit of bother with the latest version of this great addon. I removed all the old files from the server and uploaded version 12 to the system and went to install and all the language defines do not seem to be working. In the admin area where the settings are changed every title and bit of text is as if the defines are not present. I have checked and double checked that the files are in the right place including uninstalling all files and uploading them again.

    The prompts are declared in includes/languages/english/modules/payment/stripe_sca.php. It's probably best to just copy the ext and includes directories from the install/update and let it replace all the corresponding files in the web site. It should only be necessary to make sure the ownership and permissions of the files allow them to be read by apache/nginx.

    Check your site's error logs for any PHP errors.

  6. 22 hours ago, 14steve14 said:

    Is there any way to get column titles on the checkout form where the card details need to be added. I have had a couple of customers get confussed about where and how to enter the required information. On looking at this the long card number is sort of easy it's the expiry date and the last 3 digits that cause confusion. If someone can tell me where the form is created I may be able to do something.

    The card details form is generated by Stripe using a placeholder passed to it by the module's javascript in includes/modules/paymant/stripe_sca.php around lines 974-977:

        var card = elements.create('card', {hidePostalCode: true});
        
        // Add an instance of the card Element into the `card-element` <div>.
        card.mount('#card-element');

    Stripe's documentation about elements: https://stripe.com/docs/stripe-js

  7. Module has been updated to 1.0.12 to fix some issues with the stripe payment amount apparent when used in conjunction with some odler discount modules. Also, a problem with duplicate orders in 'preparing' state being created when the customer returns to the cart from the payment page.

    @peterespana, please use the 'send test webhook...' link in the stripe dashboard to check the link to the webhook on your server. It should show a 400 response code, with the message 'Invalid webhook signature: No signatures found matching the expected signature for payload'. If that is ok, please double check you stripe configuration 'transaction method' is set to 'capture' and not authorise. If that's the problem, it won't send to the webhook until you capture the payment in the stripe dashboard.

  8. 1.0.8 has been uploaded to the market place. It fixes missing customer emails, and order status history information.

    If would be a good idea to copy the entire contents of the ext and includes folders in the update to the corresponding folders of the store to ensure that all files get to the right places.

     

  9. 15 hours ago, peterespana said:

    I also get that same error when I don't fill in any creditcard number at all. When I press confirm order. The order does appear in my order history admin area as Preparing [Stripe SCA]

    I'm pretty sure the problem is something in the checkout_confirmation.php form.

    Raiwa had provided some refactoring to the handling of order processing, moving it from the webhook to the payment module, so I took the opportunity to re-check the javascript in the checkout-confirmation.php page, and removed some redundant fields and a dependency on a specific class name on the button. It was possible that a custom theme may disrupt the completion of the payment process, so this could fix it if that was the case for you. I reset the configuration and re-installed the module from scratch on a standard system, and then re-run tests for new cards, saving a new card, and using a saved card, and all worked ok.

    Please download and install the latest version 1.0.7 from the market place. All files should be replaced.

    If still no luck, please PM me a copy of the page source of checkout_confirmation.php page.

  10. On 9/15/2019 at 12:23 AM, mhsuffolk said:

    Update, I can now save cards and use them in test mode. I did not change anything apart from creating a new customer. it appears to have healed itself.

    However I still cannot access the saved cards page in test or live.

    Is that the 'Manage save cards' in the my account page? Please check your PHP or Apache/Nginx web site log for any errors.

    The account page is loading the code from includes/modules/content/account/cm_account_stripe_sca_cards.php, with the English text from includes/languages/english/modules/content/account/cm_account_stripe_sca_cards.php

  11. @peterespanaWere you able to see the stripe_event_log mysql table in your store database? It should create a row with the 'action' 'page create intent', and a request something like:

    {"amount":"7500","currency":"USD","setup_future_usage":"off_session","capture_method":"automatic","metadata":{"customer_id":"26","order_id":"2640","company":"","product_1_name":"Grillage for 6 beam 3 span bridge","product_1_model":"","product_1_id":"72{6}14","product_1_qty":"1","product_1_price":"75.0000","product_1_tax":0}}

    and the response should be the payment intent object returned by stripe, or an error message. You should see a line in the response 'client_secret', and it is that value that is placed in a hidden field in the payment form by the code in the confirmation function of stripe_sca.php. With the error message you are getting, would suggest an error response from Stripe when the intent is created, but your Stripe log shows a response code 200.

    Try looking in your PHP error log, or Apache/Nginx log, or check the browser console for any javascript error. Have a look at the page source of the checkout_payment.php page, and search for id="secret". The value of that field should be the client secret returned by Stripe in the payment intent object.

  12. 15 hours ago, 14steve14 said:

    Link to latest release version Latest version

    Is it a case that all the files in this latest release need to re-uploaded to the site or is it just the odd one or two. Upgrade instruction would be nice. 

     

    It's probably easiest to just overwrite all of them.

  13. @raiwa, @mhsuffolk, @peterespana

    The hanging and failure to complete the transactions was due to the apiKey not being set correctly in payment_intent.php and webhook.php. It was only working for those who had installed the module before 1.0.5 because it was using the configuration key generated in the earlier release. I have re-tested by deleting the earlier configuraition  keys and re-running transactions with new card with and without saving, and a saved card, and all seems ok now.

    I've updated the market place module with 1.0.6

  14. @raiwaI think the email problem may be in the $OSCOM_Hooks call immediately prior to generating the email. If there was a PHP error in there, that would stop it sending the customer email.

    I'll add the '$order_total_modules->process();' to the next release.

    You should find the card prompts have been fixed in 1.0.5.

  15. @peterespana, the error relates to the 'client secret' that is generated by stripe when the payment intent is created. In this module, that is in the includes/modules/payment/stripe_sca.php code, around line 375.

    It checks if it has a global stripe intent id set, which it would if the customer had made changes to the cart or other order details, in which case it retrieves the intent created when the customer first got to the page, and updates it with the current amount, currency and billing details in case any has changed. If it's the first time to the page, a new payment intent is created.

    In either case, the Stripe API returns a payment intent object that includes a new 'client secret' id that has to be put in the payment form, for the javascript code to use to link the card details entered by the customer with the store so the store can be informed of the payment result via the web hook.

    It sounds like it is not getting a successful payment intent created. I'd suggest turning on the 'log events' in the module configuration, retrying the payment, and then check the stripe_event_log' table. You should see a row with the action, 'page create intent', and the response field should contain a message indicating the problem.

  16. @MikepoNot sure about that, I thought it might be a phoenix thing because I had only tested with an older version, but I just retested with Phoenix 1.02 and it works there. Could it be some custom theme you have for your store that is getting in the way?

  17. @14steve14 @mhsuffolk

    I agree it does not look great, and I was not sure how to adjust the look at the time, but I've just done some experimenting, and ignoring the Stripe documentation at https://stripe.com/docs/payments/cards/collecting/web which suggests creating a javascript variable containing the style and passing that to the elements.create function, I think it is easier to insert a <style> block before the <script src="https://js.stripe.com/v3/"></script> line at line 861 in includes/modules/payment/stripe_sca.php, so the code looks like:

    Quote

            $js = <<<EOD
    <style>
    #stripe_table_new_card #card-element {
      background-color: #fff;
      padding: 6px 12px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }
    </style>
    <script src="https://js.stripe.com/v3/"></script>

    That makes the card area similar to the card name and it becomes a lot more obvious to us old folks.

  18. The webhook detail at the stripe dashboard should show the response received from your web site's webhook.php. That would be a PHP formatted error page if there was a PHP error encountered when the webhook.php was processed. But if you're getting 400 error, that suggests the URL in the stripe dashboard is not right. In test data mode at the stripe dashboard, you can send a test message to the webhook. If you are not getting a 200 response, it cannot reach the webhook using that url.

    When the connection is eventually made, the order will complete.

    I put the DIR_FS_CATALOG into the requires because I was having a problem with  the language file not being loaded, and I thought I'd better make it consistant with the paypal standard_ipn.php.

  19. Another update to fix some issues:

    • fix missing payment method in customer order confirmation email
    • separate web hook signing secrets for test and live
    • attempt to resolve 'cannot access empty property' error in stripe_sca.php, line 393

    After installing the update, please go directly to the module configuration and re-enter the web hook signing secret for both test and live environments

    stripe_sca_v1.0.3.zip

  20. @Mikepo , sorry, I got distracted working on something else and did not check my emails.

    After some puzzling over it and some googling, the penny eventually dropped, and looking at the code I now wonder how on earth it works for anyone.

    I have used $this->$intent everywhere instead of $this->intent. It looks like I need to go back to a PHP beginners class.

    I will include @mhsuffolk 's bugs in a new release today.

  21. @mhsuffolk, it is past my bed time, but that line is a reference to a global $currencies which is set in application_top.php. Could there be a problem loading the Currencies class?

    I'm afraid I have not used the stripe cli to text the webhook, but used something called ngrok. I posted instructions for it earlier.

×
×
  • Create New...