Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe.js token was not passed #255

Open
hair-transplant opened this issue May 24, 2018 · 6 comments
Open

Stripe.js token was not passed #255

hair-transplant opened this issue May 24, 2018 · 6 comments

Comments

@hair-transplant
Copy link

It was working some time ago ... but now I get constant errors with this message
So did now 2 fresh installs on same server (php 5.6.) and another one on different server (php7)
In all of these same problem. Working with "Pay later" ...

CiviCRM 5.1.2.
Stripe (com.drastikbydesign.stripe) version 4.7.3
`May 24 09:57:30 [info] $Fatal Error Details = Array
(
[message] => Stripe.js token was not passed! Report this message to the site administrator.
[code] =>
)

May 24 09:57:30 [info] $backTrace = #0 //html/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(381): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /
/html/media/civicrm/ext/com.drastikbydesign.stripe/CRM/Core/Payment/Stripe.php(375): CRM_Core_Error::fatal("Stripe.js token was not passed! Report this message to the site administrator.")
#2 //html/administrator/components/com_civicrm/civicrm/CRM/Core/Payment.php(1191): CRM_Core_Payment_Stripe->doDirectPayment((Array:64), "event")
#3 /
/html/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php(1338): CRM_Core_Payment->doPayment((Array:64), "event")
#4 //html/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Confirm.php(591): CRM_Event_Form_Registration_Confirm->processPayment(Object(CRM_Core_Payment_Stripe), (Array:64))
#5 /
/html/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(447): CRM_Event_Form_Registration_Confirm->postProcess()
#6 //html/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#7 /
/html/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Event_Form_Registration_Confirm), "next", "Next")
#8 //html/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Event_Form_Registration_Confirm), "next")
#9 /
/html/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Registration_Confirm), "next")
#10 //html/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#11 /
/html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Core_Controller->run((Array:3), NULL)
#12 //html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#13 /
/html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#14 //html/components/com_civicrm/civicrm.php(96): CRM_Core_Invoke::invoke((Array:3))
#15 /
/html/components/com_civicrm/civicrm.php(11): civicrm_invoke()
#16 //html/libraries/src/Component/ComponentHelper.php(382): require_once("//html/components/com_civicrm/civicrm.php")
#17 //html/libraries/src/Component/ComponentHelper.php(357): Joomla\CMS\Component\ComponentHelper::executeComponent("//html/components/com_civicrm/civicrm.php")
#18 //html/libraries/src/Application/SiteApplication.php(194): Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm")
#19 /
/html/libraries/src/Application/SiteApplication.php(233): Joomla\CMS\Application\SiteApplication->dispatch()
#20 //html/libraries/src/Application/CMSApplication.php(195): Joomla\CMS\Application\SiteApplication->doExecute()
#21 /
/html/index.php(49): Joomla\CMS\Application\CMSApplication->execute()
#22 {main}
`

@mattwire
Copy link
Contributor

It looks like you are using Joomla. Can you test with this fork (5.x branch) and feedback as it should be working fine with Joomla: https://github.com/mattwire/com.drastikbydesign.stripe

@hair-transplant
Copy link
Author

Yes Joomla 3.8.8.
Tested the 5.x. from today - but still not working on both sites
But different error...

Error Oops! Looks like there was an error. Payment Response:
Type: invalid_request_error
Code: resource_missing
Message: No such token: Stripe Token

May 24 22:34:21  [info] ALERT! Unmasked credit card received in back end. Please report this error to the site administrator.

May 24 22:34:22  [info] Stripe_Error create_customer:  <pre> Array
(
    [error] => Array
        (
            [code] => resource_missing
            [doc_url] => https://stripe.com/docs/error-codes/resource-missing
            [message] => No such token: Stripe Token
            [param] => card
            [type] => invalid_request_error
        )
)
 </pre>

send you links to the 2 test sites by mail

@joewickert
Copy link

Hi,

Hope this helps I was getting a similar issue with Drupal 7.59. civi 5.1.2 and stripe 4.7.3, Cloudlinux Cpanel server, PHP 5.6.3

Testing got me this far:

  • Contribution pages all worked
  • Event registration payments with only stripe as processor worked
  • Event registration payments with Paypal or Pay later as well as stripe give "Error: Stripe.js token was not passed"

On further testing:

  • All of the above worked on a local MAMP test server
  • All of the above worked on another Cloudlinux server with different site (still Drupal 7.59)

So something in the setup/environment maybe...

The good news. manually installing the 4.7.3-dev version seems to be working!

@mpwoodward
Copy link

mpwoodward commented Aug 30, 2018

I'm geting a similar issue on WordPress + CiviCRM 5.4.0 + the 4.7.3-dev version of the Stripe extension, but only if I go this route:

  1. Open contact record
  2. Click contributions tab
  3. Click submit credit card contribution button

That fails with js token not passed. If instead I do this:

  1. Click Contributions -> New Contribution
  2. Click "submit credit card contribution" link
  3. Complete the form

That works without throwing the js token not passed error.

Let me know if I can provide more info. Thanks.

@mattwire
Copy link
Contributor

@mpwoodward I think you will find that is not an issue with the 5.x fork here https://github.com/mattwire/com.drastikbydesign.stripe

@mwoodward-atd
Copy link

Thanks so much for your work on the fork! That solved one problem but seems to have introduced another, unless I'm doing something weird.

The first route above works now, which is great.

If I do the second series of steps, for some reason it fails with "no email address found" even though the contact has an email address. If I then go to the contact I'll see that their email address has indeed been wiped out, but even if I re-add it, the next time I do a transaction this way it will blank out the email address again.

I'll submit this as an issue on your fork as well but wanted to make sure it was part of this discussion. Thanks again for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants