Jump to content
asro2004

Stripe v3 module for SCA

Recommended Posts

I have installed 1.0.6

Still cannot save cards in test mode. Not tried live. Stripe dashboard error says

{
  "error": {
    "code": "resource_missing",
    "doc_url": "https://stripe.com/docs/error-codes/resource-missing",
    "message": "No such customer: cus_************; a similar object exists in live mode, but a test mode key was used to make this request.",
    "param": "customer",
    "type": "invalid_request_error"

Cannot access saved cards in live that were saved by the old module. Token exists in the database, with the same customer hash as the blanked out one above.

When I click the saved Cards link on the account page the screen just flicks and comes back to where it was.

Edited by mhsuffolk

OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites
7 hours ago, peterespana said:

This is the log that appears:

 

ID
req_LWmdlGmOiCG4W6
Time
9/14/19, 7:01:22 AM
Method
POST
URL
/v1/payment_intents/pi_1FITLjK4kydItoIjO
Status
200
IP address
81.169.144.135
Version
Source
Stripe/v1 PhpBindings/6.43.0
Related
payment_intent 
 
 
Thanks!!
Peter

Removed the module and installed 1.06.

But still the same error: IntegrationError: Invalid value for stripe.handleCardPayment intent secret: value should be a client_secret string. You specified: undefined.

Thanks.

Log files says:

ID
req_MhL0nXN5BhCHOB
Time
9/14/19, 2:10:44 PM
Method
POST
URL
/v1/payment_intents
Status
200
IP address
81.169.144.135
Version
Source
Stripe/v1 PhpBindings/6.43.0
Related
payment_intent  pi_1FIa5

Share this post


Link to post
Share on other sites

Update, I can now save cards and use them in test mode. I did not change anything apart from creating a new customer. it appears to have healed itself.

However I still cannot access the saved cards page in test or live.


OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites
15 hours ago, 14steve14 said:

Link to latest release version Latest version

Is it a case that all the files in this latest release need to re-uploaded to the site or is it just the odd one or two. Upgrade instruction would be nice. 

 

It's probably easiest to just overwrite all of them.

Share this post


Link to post
Share on other sites

@peterespanaWere you able to see the stripe_event_log mysql table in your store database? It should create a row with the 'action' 'page create intent', and a request something like:

{"amount":"7500","currency":"USD","setup_future_usage":"off_session","capture_method":"automatic","metadata":{"customer_id":"26","order_id":"2640","company":"","product_1_name":"Grillage for 6 beam 3 span bridge","product_1_model":"","product_1_id":"72{6}14","product_1_qty":"1","product_1_price":"75.0000","product_1_tax":0}}

and the response should be the payment intent object returned by stripe, or an error message. You should see a line in the response 'client_secret', and it is that value that is placed in a hidden field in the payment form by the code in the confirmation function of stripe_sca.php. With the error message you are getting, would suggest an error response from Stripe when the intent is created, but your Stripe log shows a response code 200.

Try looking in your PHP error log, or Apache/Nginx log, or check the browser console for any javascript error. Have a look at the page source of the checkout_payment.php page, and search for id="secret". The value of that field should be the client secret returned by Stripe in the payment intent object.

Share this post


Link to post
Share on other sites
On 9/15/2019 at 12:23 AM, mhsuffolk said:

Update, I can now save cards and use them in test mode. I did not change anything apart from creating a new customer. it appears to have healed itself.

However I still cannot access the saved cards page in test or live.

Is that the 'Manage save cards' in the my account page? Please check your PHP or Apache/Nginx web site log for any errors.

The account page is loading the code from includes/modules/content/account/cm_account_stripe_sca_cards.php, with the English text from includes/languages/english/modules/content/account/cm_account_stripe_sca_cards.php

Share this post


Link to post
Share on other sites
33 minutes ago, asro2004 said:

The account page is loading the code from includes/modules/content/account/cm_account_stripe_sca_cards.php

Yes, it is the manage saved cards page.

No errors in my PHP logs. I don't know if I should be able to, but if I call includes/modules/content/account/cm_account_stripe_sca_cards.php it returns a 403 error.

I notice that the hyperlink on the accounts.php page is returning ext/modules/content/account/stripe_sca/cards.php Is this correct?


OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites
6 hours ago, asro2004 said:

@peterespanaWere you able to see the stripe_event_log mysql table in your store database? It should create a row with the 'action' 'page create intent', and a request something like:

{"amount":"7500","currency":"USD","setup_future_usage":"off_session","capture_method":"automatic","metadata":{"customer_id":"26","order_id":"2640","company":"","product_1_name":"Grillage for 6 beam 3 span bridge","product_1_model":"","product_1_id":"72{6}14","product_1_qty":"1","product_1_price":"75.0000","product_1_tax":0}}

and the response should be the payment intent object returned by stripe, or an error message. You should see a line in the response 'client_secret', and it is that value that is placed in a hidden field in the payment form by the code in the confirmation function of stripe_sca.php. With the error message you are getting, would suggest an error response from Stripe when the intent is created, but your Stripe log shows a response code 200.

Try looking in your PHP error log, or Apache/Nginx log, or check the browser console for any javascript error. Have a look at the page source of the checkout_payment.php page, and search for id="secret". The value of that field should be the client secret returned by Stripe in the payment intent object.

Hi, again thanks for your patience with me...

Stripe return the values in the response body. That looks all normal.
I checked the id-secret in the page, it's there. But the error persists (IntegrationError: Invalid value for stripe.handleCardPayment intent secret: value should be a client_secret string. You specified: undefined.)

No script errors, nothing in the apache logs.

Any more ideas? Regards Peter

Share this post


Link to post
Share on other sites

I also get that same error when I don't fill in any creditcard number at all. When I press confirm order. The order does appear in my order history admin area as Preparing [Stripe SCA]

Share this post


Link to post
Share on other sites
25 minutes ago, peterespana said:

The order does appear in my order history admin area as Preparing [Stripe SCA]

When you get to the checkout_confirmation page, before you have even entered a card number, you should have Preparing [Stripe SCA] in your admin and in the Stripe Dashboard under Developers/logs  you should have a log entry like this. What do you get?

image.png.ed91136e22831a05a385ff474b1ac74a.png

Click on the row and you should have this.

image.png.16b9a61591ffff4de39db7949eb69101.png

Edited by mhsuffolk

OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites
On 9/14/2019 at 1:23 PM, mhsuffolk said:

However I still cannot access the saved cards page in test or live.

Found it @asro2004

In ext/modules/content/account/stripe_sca/cards.php Line 21

  if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('stripe.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) {

Change to

  if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('stripe_sca.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) {

This fault appeared after I had uninstalled the old Stripe module, previously it must have been using the old module's configuration values.

Edited by mhsuffolk

OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites

@mhsuffolk @asro2004 there are a couple more stripe references that should be changed to stripe_sca in the ext/modules/content/account/stripe_sca/cards.php lines 59 and 63 redirect and breadcrumb

 


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites
15 hours ago, peterespana said:

I also get that same error when I don't fill in any creditcard number at all. When I press confirm order. The order does appear in my order history admin area as Preparing [Stripe SCA]

I'm pretty sure the problem is something in the checkout_confirmation.php form.

Raiwa had provided some refactoring to the handling of order processing, moving it from the webhook to the payment module, so I took the opportunity to re-check the javascript in the checkout-confirmation.php page, and removed some redundant fields and a dependency on a specific class name on the button. It was possible that a custom theme may disrupt the completion of the payment process, so this could fix it if that was the case for you. I reset the configuration and re-installed the module from scratch on a standard system, and then re-run tests for new cards, saving a new card, and using a saved card, and all worked ok.

Please download and install the latest version 1.0.7 from the market place. All files should be replaced.

If still no luck, please PM me a copy of the page source of checkout_confirmation.php page.

Share this post


Link to post
Share on other sites
13 hours ago, 241 said:

@mhsuffolk @asro2004 there are a couple more stripe references that should be changed to stripe_sca in the ext/modules/content/account/stripe_sca/cards.php lines 59 and 63 redirect and breadcrumb

 

Thanks, they have been fixed in 1.0.7

Share this post


Link to post
Share on other sites
On 9/16/2019 at 2:28 PM, mhsuffolk said:

When you get to the checkout_confirmation page, before you have even entered a card number, you should have Preparing [Stripe SCA] in your admin and in the Stripe Dashboard under Developers/logs  you should have a log entry like this. What do you get?

image.png.ed91136e22831a05a385ff474b1ac74a.png

Click on the row and you should have this.

image.png.16b9a61591ffff4de39db7949eb69101.png

Order is visible in admin (preparing Stripe SCA). This is the stripe log:

 

image.png.583853ccc1d6057ae5932269adf3941f.png

 

Sometimes (not always) I have that with a PayPal payment as well, an order (pending payment) is made. Payment comes in, but no order confirmation and stock remains unchanged. Like there was no order. But payment is done.

Do you know what file may cause this? I guess it has to do with the same issue here.

 

Thanks a lot!

Regards Peter

 

Edited by peterespana

Share this post


Link to post
Share on other sites
On 9/16/2019 at 7:17 AM, asro2004 said:

@peterespanaWere you able to see the stripe_event_log mysql table in your store database? It should create a row with the 'action' 'page create intent', and a request something like:

{"amount":"7500","currency":"USD","setup_future_usage":"off_session","capture_method":"automatic","metadata":{"customer_id":"26","order_id":"2640","company":"","product_1_name":"Grillage for 6 beam 3 span bridge","product_1_model":"","product_1_id":"72{6}14","product_1_qty":"1","product_1_price":"75.0000","product_1_tax":0}}

and the response should be the payment intent object returned by stripe, or an error message. You should see a line in the response 'client_secret', and it is that value that is placed in a hidden field in the payment form by the code in the confirmation function of stripe_sca.php. With the error message you are getting, would suggest an error response from Stripe when the intent is created, but your Stripe log shows a response code 200.

Try looking in your PHP error log, or Apache/Nginx log, or check the browser console for any javascript error. Have a look at the page source of the checkout_payment.php page, and search for id="secret". The value of that field should be the client secret returned by Stripe in the payment intent object.

 

 

 

Edited by peterespana

Share this post


Link to post
Share on other sites
11 hours ago, asro2004 said:

I'm pretty sure the problem is something in the checkout_confirmation.php form.

Raiwa had provided some refactoring to the handling of order processing, moving it from the webhook to the payment module, so I took the opportunity to re-check the javascript in the checkout-confirmation.php page, and removed some redundant fields and a dependency on a specific class name on the button. It was possible that a custom theme may disrupt the completion of the payment process, so this could fix it if that was the case for you. I reset the configuration and re-installed the module from scratch on a standard system, and then re-run tests for new cards, saving a new card, and using a saved card, and all worked ok.

Please download and install the latest version 1.0.7 from the market place. All files should be replaced.

If still no luck, please PM me a copy of the page source of checkout_confirmation.php page.

I got a lot further now..... I could make a payment, but after entering my creditcard number it stuck, page can not be displayed.... But the payment came in. But order still is preparing, not processing. No payment info in the admin area. And no order confirmation. 

 

This page is not working

xxxxxx.com kan dit verzoek momenteel niet verwerken.

HTTP ERROR 500
 
 
 

Any ideas where to look for this problem?

The module also looks strange:

 

 

Knipsel.JPG

Edited by peterespana

Share this post


Link to post
Share on other sites

Have you installed version 1.0.7

It has had many English message labels moved to a language file, has that been missed?


OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites
5 minutes ago, mhsuffolk said:

Have you installed version 1.0.7

It has had many English message labels moved to a language file, has that been missed?

Yes i did install the version 1.0.7. I now checked the language file and it's there in the English folder.

Share this post


Link to post
Share on other sites

Your strange look picture seems to have disappeared.

The file in question should be in includes/languages/english/modules/payment/stripe_sca.php

I fear you have it in the wrong location as the strange look is due to missing language definitions. If it is there, has it 83 lines, the previous file was much shorter.

Edited by mhsuffolk

OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites

@asro2004

Updated to 1.0.7

Under 1.0.6 in the order admin I get this and confirmation emails are received Line 2 is Order processed status. Line 3 is Transaction order status. (I have changed the label text)

image.png.7f1ce68394ca098c40430f5bcb693c99.png

Under 1.0.7 I get this only and no emails are received. That is the Order processed status is not reached, payments have completed correctly in Stripe dashboard.

image.png.ac6381dd5186288ff77736526b71c69b.png


OsC 2.3.4.1 CE Frozen   PHP 7.2   MySQL 10.1.36-MariaDB-cll-lve. Phoenix in development

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.2.0) here.

Share this post


Link to post
Share on other sites
29 minutes ago, mhsuffolk said:

@asro2004

Updated to 1.0.7

Under 1.0.6 in the order admin I get this and confirmation emails are received Line 2 is Order processed status. Line 3 is Transaction order status. (I have changed the label text)

image.png.7f1ce68394ca098c40430f5bcb693c99.png

Under 1.0.7 I get this only and no emails are received. That is the Order processed status is not reached, payments have completed correctly in Stripe dashboard.

image.png.ac6381dd5186288ff77736526b71c69b.png

Please do not use 1.0.7 for now. The code for order_status_history and order mails is removed/wrong. I have sent a PM to the author already and I suppose he will fix it in the next update.

Share this post


Link to post
Share on other sites

1.0.8 has been uploaded to the market place. It fixes missing customer emails, and order status history information.

If would be a good idea to copy the entire contents of the ext and includes folders in the update to the corresponding folders of the store to ensure that all files get to the right places.

 

Share this post


Link to post
Share on other sites

1.0.8 has still problems with the order status and order comments not beeing saved. I didn't test anything on the cart save part.

Here my update to v 1.0.9 which fixes it. I sent the whole updated package to Alastair to revise and upload it.

Here my package for to test:

stripe_sca_v1.0.9.zip

 

Share this post


Link to post
Share on other sites

Stil some issues here....

I can now make a payment with version 1.0.8
Looks like it all finishes normally. But, it stays in Stripe as uncaptured. And no payment info in the admin area: remains as preparing....

I use a discount code coupon module, the discount is not visible in the order.

And last it ads more VAT, I have 1.61157 shipping +21% VAT = 1,95. This module ads 21% to 1,95.

 

Thanks for all the help, it's much appreciated.

Edited by peterespana

Share this post


Link to post
Share on other sites

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

×