Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Stripe Checkout For Single Non-Store Item Rate Topic   - - - - -

 
  • fmofmo
  • Newbie
  • Members
  • Join Date: 02-Apr 19
  • 2 posts

Posted 16 August 2019 - 07:53 PM #1

We want to use Stripe Checkout to allow companies to purchase one "service" item and are stuck getting it to work. It seems this should be easier, but I am a newbie on CS-Cart and still getting a handle on some of these things.

 

We've created a separate page where we want to add the code that we copied from our Stripe Checkout account dashboard. We're using the "client integration" option. The code looks like this:

 

 

<!-- Load Stripe.js on your website. -->
 
<!-- Create a button that your customers click to complete their purchase. Customize the styling to suit your branding. -->
<button
  style="background-color:#6772E5;color:#FFF;padding:8px 12px;border:0;border-radius:4px;font-size:1em"
  id="checkout-button-sku_FdPETF8kafD8cO"
  role="link"
>
  Checkout
</button>
 
<div id="error-message"></div>
 
<script>
  var stripe = Stripe('pk_test_ykrpQaV46gtmev3wnvZ7KuH4');
 
  var checkoutButton = document.getElementById('checkout-button-sku_FdPETF8kafD8cO');
  checkoutButton.addEventListener('click', function () {
    // When the customer clicks on the button, redirect
    // them to Checkout.
    stripe.redirectToCheckout({
      items: [{sku: 'sku_FdPETF8kafD8cO', quantity: 1}],
 
      // Do not rely on the redirect to the successUrl for fulfilling
      // purchases, customers may not always reach the success_url after
      // a successful payment.
      // Instead use one of the strategies described in
    })
    .then(function (result) {
      if (result.error) {
        // If `redirectToCheckout` fails due to a browser or network
        // error, display the localized error message to your customer.
        var displayError = document.getElementById('error-message');
        displayError.textContent = result.error.message;
      }
    });
  });
</script>
 

 

Where should this code be pasted on the page? We tried pasting it in the "Description" section, by clicking the code area "<>", and it displayed the Checkout button initially. Then, when we saved the page and went to review it, it displayed the code that was pasted instead of the checkout button.

 

Help for a newbie would be greatly appreciated! I am sure it is something simple. Hoping, anyway.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19574 posts

Posted 19 August 2019 - 06:17 AM #2

Hire someone to perform integration according to CS-Cart requirements. There is no ability just to copy and paste the code


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2294 posts

Posted 19 August 2019 - 08:58 AM #3

Why don't you create a hidden product? You can send the link to this product to the buyer and they can simply checkout the usual way.


When life hands you lemons, bring on the Tequila baby!


 
  • fmofmo
  • Newbie
  • Members
  • Join Date: 02-Apr 19
  • 2 posts

Posted 19 August 2019 - 04:15 PM #4

Hire someone to perform integration according to CS-Cart requirements. There is no ability just to copy and paste the code

This seems to be such a basic thing to do. I'm surprised this capability is not a part of CS-Cart. Much to learn. I've done this on a WordPress site and it was super easy. Thanks for your input!
 

 

Why don't you create a hidden product? You can send the link to this product to the buyer and they can simply checkout the usual way.

 

I will check this option out. Thank you for the suggestion!