Jump to content
Alex

Payment methods integrated with Shop Module... Stripe anyone?

Recommended Posts

I’ve been playing with the Shop module a little bit, its really impressive.

Wondering if anyone has integrated it with Stripe Checkout so you get that lovely mobile friendly overlay which feels like you’re still on the same website, rather than the Paypal-leave-the-page experience.

You can’t customise the Paypal payment page right?

Foxycart is also on the radar but the Processwire shop module is just so nice to use and easy to set up, it would be great to have a payment option with a better customer experience than the Paypal one.

Alex

Share this post


Link to post
Share on other sites

I was just thinking the same thing recently.

I havn't used stripe checkout but it looks interesting.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By quickjeff
      Hey guys, 
      Looking for another dev to help on multiple processwire projects as well as some other PHP apps. 
      First project is a directory style site with lots of components to come, including stripe implementation  and other fun stuff.
      Need someone ASAP to help out. 
       
      Thanks.
    • By cleanboy
      Hey all,
      Mods; please feel free to move this if it is in the incorrect place although I thought this was the best place for it.
      Kinda new to processwire but getting the hang of it....I am trying to build a payment form with the Stripe platform but failing miserably....I really hope someone can help!
      So I am building my form with the PW API and also following through this documentation here: https://stripe.com/docs/elements and here: https://stripe.com/docs/charges
      My form is pretty basic just for testing purposes right now:
      <form id="payment-form" class="pusher" name="payment-form" method="post" action="./#booking-form"> <?php $tokenName = $this->session->CSRF->getTokenName(); $tokenValue = $this->session->CSRF->getTokenValue(); echo '<input type="hidden" id="_post_token" name="' . $tokenName . '" value="' . $tokenValue . '"/>'; $out = ""; $out .= '<div id="card-number"></div> <div id="card-errors"></div>'; // create a new form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'payment-form'); // First Name $field = $modules->get("InputfieldText"); $field->skipLabel = true; $field->attr('id+name','name'); $field->attr('placeholder','Full Name'); $field->required = 1; $form->append($field); // append the field to the form // create email field $field = $modules->get("InputfieldEmail"); $field->attr('id+name','email'); $field->attr('placeholder','Email'); $field->required = 1; $form->append($field); // append the field // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","SUBMIT"); $submit->attr("id+name","submit"); $submit->attr("class","cta white"); $form->append($submit); if($input->post->submit) { // user submitted the form, process it and check for errors $form->processInput($input->post); if($form->getErrors()) { // the form is processed and populated // but contains errors $out .= $form->render(); } else { foreach($input->post as $key => $value) echo htmlentities("$key = $value") . "<br />"; } } else { foreach($form->children as $input){ $out .= "<div class='col-sm-6'>{$input->render()}</div>"; } } echo $out; ?> </form> That alone works fine and returns all of the fields values after I click submit which is great...now we add the javascript:
      //Stripe var stripe = Stripe('pk_test_*****************'); var elements = stripe.elements(); // Custom styling can be passed to options when creating an Element. var style = { base: { // Add your base input styles here. For example: fontSize: '16px', lineHeight: '24px' } }; // Create an instance of the card Element var card = elements.create('card', {style: style}); // Add an instance of the card Element into the `card-element` <div> card.mount('#card-number'); card.addEventListener('change', function(event) { var displayError = document.getElementById('card-errors'); if (event.error) { displayError.textContent = event.error.message; } else { displayError.textContent = ''; } }); // Create a token or display an error when the form is submitted. var form = document.getElementById('payment-form'); form.addEventListener('submit', function(event) { event.preventDefault(); stripe.createToken(card).then(function(result) { if (result.error) { // Inform the user if there was an error var errorElement = document.getElementById('card-errors'); errorElement.textContent = result.error.message; } else { // Send the token to your server stripeTokenHandler(result.token); } }); }); function stripeTokenHandler(token) { // Insert the token ID into the form so it gets submitted to the server var form = document.getElementById('payment-form'); var hiddenInput = document.createElement('input'); hiddenInput.setAttribute('type', 'hidden'); hiddenInput.setAttribute('name', 'stripeToken'); hiddenInput.setAttribute('value', token.id); form.appendChild(hiddenInput); // Submit the form form.submit(); } This gives an error in the console: Uncaught (in promise) TypeError: form.submit is not a function. 
      This is because our submit input has the name "submit". Ok thats cool...I can change that but once I do the page essentially refreshes and the form just shows again and it doesnt give me the values it did before....I guess it isnt posting? either way after I submit the form after changing the name of the submit button the form just loads again and anything inside: if($input->post->submit) doesnt seem to execute...so what gives?
      If anybody here has done this before with PW 3+ I would really love an example of how to use this to the point of sending information to Stripe.
      I have installed Stripe with composer and it would appear that I can refer to it in Processwire just fine...my problem is just getting to the point where I need to refer to it which is after the submit.
      I have seen the PaymentStripe module but tbh the documentation on that is somewhat lacking and im not even sure it works with the latest version of stripe? Im also not sure how to integrate that into a form either unless you use something along the lines of the example code provided after the form has been submitted but I cant even seem to submit the form to even try that and im not really sure why.
      Here is the PaymentStripe module page for those wondering: https://modules.processwire.com/modules/payment-stripe/
      Any help would be greatly appreciated!
      Cleanboy
    • By franciccio-ITALIANO
      Hi, 
      I create this paypal form by paypal site.

       
      <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="N922SN77XG7WE"> <table> <tr><td><input type="hidden" name="on0" value="Scegli uno di questi PIANI DI ASSUNZIONE A DISTANZA. Grazie!">Seleziona e clicca. Grazie!</td></tr><tr><td><select name="os0">     <option value="BRONZE - </option>     <option value="SILVER - </option>     <option value="GOLD - </option>     <option value="PLATINUM - </option>     <option value="DIAMOND - e</option> </select> </td></tr> </table> <input type="hidden" name="currency_code" value="EUR"> <input type="image" src="https://www.paypalobjects.com/it_IT/IT/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal"> <img style="text-align:center;" alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1"> </form>  
      Now I put it into my html file template. Ok.
      But can I put it into another file html?
      It isn't part of the template!
      The same template I use in another pages, but that form don't want is there and anywhere! 
      Exist a form modules for processwire, with an api or code - string for link it from template file?
      Excuse me if I don't explain my problem well. 
       
       
       
       
       
    • By Rudy
      Hi all,
      I am currently building a custom membership functionality for a client. Here are the procedure:
      User fills in a membership registration form. Based on the form data, it is supposed to do the following
      create user, add roles (guest, subscriber OR free-trial) if free-trial, remove/disable user after X number of days if free-trial, add user to mailchimp list in the free-trial segment if subscriber, add user to mailchimp list in the subscriber segment if subscriber, create a new invoice via Freshbooks API and get Freshbooks to charge to user's credit card via Stripe My questions:
      What is the best approach on this? all in one module? or separate tasks into its own module? Are there any existing module(s) that already do these things? Thanks
      Rudy
    • By lucas
      I'd like to know if it's possible for you to integrate Paypal to the Form Builder module. I'd like to use the Form Builder to build a paid job listing. Job submissions would be only published to the site after the payment via Paypal (standard checkout).
      Could you tell me if this would be something you'd consider adding? That's the only thing keeping me from building this project with PW right now
×
×
  • Create New...