Perch Shop Payments

  • I have my Perch Shop up and running and everything seems to be working fine, except for testing transactions using Stripe. The first transaction I did went through and showed up in Perch as an order and it showed in Stripe as an order as well, but I've tried to do about 5 additional transactions and none of the other test transactions are working. I looked in the Stripe logs and they look good to me, in fact I matched up the successful transaction with the other transactions that failed and everything looks the same in the log.

    Has anyone else had this issue with Stripe testing? Or What would be the best way to trouble shoot the issue. Any help would be appreciated.

  • Drew I'm not sure. Let me bullet point the situation.

    • I ran the first transaction through the cart and it worked. Showed up in the order section Perch and showed up in Stripe.
    • All other transactions failed and didn't show up in either Perch or in Stripe.
    • It is possible that the first transaction was a fluke because I actually refreshed the page because I had not set up the page to go to after the successful transaction.
    • I am wondering if it is just a syntax error on my part?
    • I spoke with Stripe. They said the first transaction that worked used "Guzzle" but all other failed transactions used Stripe. I'm not sure what that even means. Here is my code:

    /perch/config/shop.php (the below secret and publishable key I have changed to the ones Stripe gave me)

    Payment Page on website. First code chunk is in the head and the second is in the body. (I copied and pasted the code and didn't make any changes). I am wondering if I need to change the return_url & cancel_url

    /perch/templates/gateways/stripe_payment_form.html (only thing I changed on this page was action="/shop/result"). I am wondering if the action should =#?

    1. <form action="/shop/result" method="post">
    2. <script src="" class="stripe-button" data-key="<perch:shop id="publishable_key" escape="true" />"
    3. data-amount="<perch:shop id="amount" escape="true" />"
    4. data-currency="<perch:shop id="currency" escape="true" />"
    5. data-name="<perch:shop id="shop_name" escape="true" />"
    6. data-description="Items (<perch:shop id="amount_formatted" escape="true" />)"
    7. data-email="<perch:member id="email" escape="true" />">
    8. </script>
    9. </form>
  • Drew, can you just take a minute and look at my code and see if anything pops up to you as looking wrong. I really don't want you to spend more than a minute or two. Just let me know if you see anything that you think might be a problem. I understand you are busy, but I would really appreciate it. If it is more extensive then I would be willing to pay for support.

  • As the stripe team said the first successful payment was made using guzzle (which is what the Omnipay drive uses), and that the failed payments came form stripe, I would imaging that the payment is failing to issue the stripeToken, or the stripeToken you are sending to the perch_shop_checkout () function is bad.

    I would suggest checking your front end code is working correctly, and that that there are no console errors when calling the stripe checkout.