Jump to content

Module stripe its not working


jandrillo18

Recommended Posts

Hello, I installed on my website the official free stripe module and apparently I have everything configured correctly, but at the end of payment is causing me the error "An error occurred during the request. Please contact us "all the time. The error occurs in the Https://elmananacomienzahoy.org/index.php?fc=module&module=stripe_official&controller=ajax&id_lang=1 service (POST 400).

 

I find no way to fix the problem, I spoke with Stripe and say they do not see any error regarding the payment gateway, it seems that the error is in Prestashop.

 

I'm testing in Live mode, but in Test mode gives me the same error.

 

Please, I need your help. Thanks a lot

136FE15E-5A75-4AAD-BA61-7559F34B4A29.jpeg

Link to comment
Share on other sites

Hi,

Are the payments received by Stripe? If not, that's an error in the module indeed. Perhaps you should check your server error-log, there might be something there. 

Its also possible that outgoing POST's are not allowed on your server, you should ask your hosting provider.

Link to comment
Share on other sites

Stripe it's showing  200 OK

Request POST body

{
"type": "card",
"owner": {
"address": {
"line1": "Fuencarral. 127. 4D",
"line2": "",
"city": "Madrid",
"postal_code": "28010",
"country": "España"
},
"name": "Alejandro ",
"email": "[email protected]"
},

"card": {
"number": "************0007",
"cvc": "***",
"exp_month": "01",
"exp_year": "20"
},

"guid": "2e9a5ee4-a369-4e92-adb9-c3fb7830071e",
"muid": "b31a15bf-b676-4339-9f77-570ac8f40072",
"sid": "e6d66388-011a-401f-9068-65287f4182da",
"pasted_fields": "number",
"payment_user_agent": "stripe.js/8ae33abe; stripe-js-v3/8ae33abe",
"referrer": "https://elmananacomienzahoy.org/index.php?controller=order",
"key": "pk_test_ynNn17YnY7xRnSra5vlcPbFf"
}
Response body
{
  "id": "src_1DRMJmDX7SuOHCp8mOTHQOY6",
  "object": "source",
  "amount": null,
  "card": {
    "exp_month": 1,
    "exp_year": 2020,
    "address_line1_check": "unchecked",
    "address_zip_check": "unchecked",
    "brand": "Visa",
    "country": "ES",
    "cvc_check": "unchecked",
    "funding": "credit",
    "last4": "0007",
    "three_d_secure": "optional",
    "name": null,
    "tokenization_method": null,
    "dynamic_last4": null
  },
  "client_secret": "src_client_secret_Dt8aEHzHhqvFAyA9n6XY7ddI",
  "created": 1541002398,
  "currency": null,
  "flow": "none",
  "livemode": false,
  "metadata": {
  },
  "owner": {
    "address": {
      "city": "Madrid",
      "country": "España",
      "line1": "Fuencarral",
      "line2": "",
      "postal_code": "28010",
      "state": null
    },
    "email": "[email protected]",
    "name": "Alejandro",
    "phone": null,
    "verified_address": null,
    "verified_email": null,
    "verified_name": null,
    "verified_phone": null
  },
  "statement_descriptor": null,
  "status": "chargeable",
  "type": "card",
  "usage": "reusable"
}
 
Edited by jandrillo18 (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...
1 hour ago, CyberTron said:

Did TS get this fixed ? I have the same problem, although I am not using live data yet, only testing, but the same error. Can't seem to find anything in logs. I have contacted the author but it will probably be a few days

 

 

Nevermind. Found the issue. Prestashop is changing the url from & to amp;

so I did a change in the payment.tpl in stripe_offical/views/templates/payment.tpl

 

Added this code: 

Quote

  ajaxUrlStripe = ajaxUrlStripe.replace(/&/g, '&');

in line 109 (after the var ajaxUrlStripe variable)

now it works!

  • Like 2
Link to comment
Share on other sites

  • 1 month later...
Hi everyone

I use a local prestashop version, version 1.7.4.4. I have installed the stripe plugin, I have configured it, insert public and private keys because it is connected. Unfortunately, as soon as I arrive in the payment section of my e commerce site I do not see the form payment of stripe. By enabling debugging the following error appears:
payment_stripe.js:21 Uncaught ReferenceError: StripePubKey is not defined
    at HTMLDocument.<anonymous> (payment_stripe.js:21)
    at fire (core.js:690)
    at Object.fireWith [as resolveWith] (core.js:711)
    at Function.ready (core.js:745)
    at HTMLDocument.completed (core.js:748)

 

Help me please

Link to comment
Share on other sites

  • 2 months later...
On 12/2/2018 at 3:57 PM, CyberTron said:

Nevermind. Found the issue. Prestashop is changing the url from & to amp;

so I did a change in the payment.tpl in stripe_offical/views/templates/payment.tpl

 

Added this code: 

in line 109 (after the var ajaxUrlStripe variable)

now it works!

TKS, yes after add this in script part it is work, by the way i'm using in Prestashp 1.4 version so payment.tpl is located in /modules/stripe_official/views/templates/hook/

add in line 110:

<script type="text/javascript">
  var mode = {$stripe_mode};
  var currency_stripe = "{$currency_stripe}";
  var amount_ttl = {$amount_ttl};
  var secure_mode = {$secure_mode};
  var baseDirStripe = "{$baseDirStripe}";
  var billing_address = {$billing_address nofilter};
  var module_dir = "{$module_dir}";
  var ajaxUrlStripe = "{$ajaxUrlStripe}";
  var StripePubKey = "{$publishableKey}";
  var stripeLanguageIso = "{$stripeLanguageIso}";
  ajaxUrlStripe = ajaxUrlStripe.replace(/&/g, '&');
</script>

 

Link to comment
Share on other sites

  • 2 weeks later...

Hello. I just solved this issue in prestashop 1.7.5.1. The variable  ajaxUrlStripe is present in two templates.

In modules/stripe_official/views/templates/hook/payment.tpl and modules/stripe_official/views/templates/front/payment-validation.tpl. When I add the line  ajaxUrlStripe = ajaxUrlStripe.replace(/&amp;/g, '&');   after the declaration of the variable  in both templates the payment process runs ok.

modules/stripe_official/views/templates/hook/payment.tpl line 108  and modules/stripe_official/views/templates/front/payment-validation.tpl. line 46

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...
  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...