Forum

Thread tagged as: Problem

Failed payment via Stripe how to debug this

We've been testing our stripe integration in test mode for quite a while with no issues.

Now that we have went live, there has been people complaining that their card is being declined how would I go about debugging this to see what the problem is

The only thing i'm seeing in the logs is

[22-Nov-2016 22:35:22 UTC] PHP Notice:  Use of undefined constant PERCH_SHOP_VERSION - assumed 'PERCH_SHOP_VERSION' in /home/thebigbl/public_html/admin/addons/apps/perch_shop_orders/admin.php on line 3

This is the diagnostic report

Perch Runway: 2.8.32
Production mode: Production (100)
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (PERCH_SHOP_VERSION), perch_shop_products (PERCH_SHOP_VERSION), perch_shop (1.0.9), perch_members (1.5)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_blog_authors (3), perch2_blog_comments (0), perch2_blog_index (477), perch2_blog_posts (18), perch2_blog_posts_to_tags (12), perch2_blog_sections (1), perch2_blog_tags (8), perch2_blogs (1), perch2_categories (6), perch2_category_counts (0), perch2_category_sets (2), perch2_collection_index (0), perch2_collection_items (0), perch2_collection_revisions (0), perch2_collections (0), perch2_content_index (3733), perch2_content_items (551), perch2_content_regions (54), perch2_forms (2), perch2_forms_responses (419), perch2_gallery_albums (6), perch2_gallery_image_versions (954), perch2_gallery_images (159), perch2_members (2), perch2_members_forms (2), perch2_members_member_tags (1), perch2_members_sessions (5), perch2_members_tags (18), perch2_navigation (1), perch2_navigation_pages (7), perch2_page_routes (4), perch2_page_templates (32), perch2_pages (31), perch2_resource_log (2642), perch2_resource_tags (0), perch2_resources (631), perch2_resources_to_tags (0), perch2_settings (50), perch2_shop_addresses (189), perch2_shop_admin_index (30), perch2_shop_brands (3), perch2_shop_cart (757), perch2_shop_cart_data (293), perch2_shop_cart_items (100), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (16), perch2_shop_emails (1), perch2_shop_index (14255), perch2_shop_option_values (24), perch2_shop_options (5), perch2_shop_order_items (112), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (95), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (198), perch2_shop_product_options (45), perch2_shop_product_tags (21), perch2_shop_products (287), perch2_shop_promotions (2), perch2_shop_search (191), perch2_shop_shipping_zone_countries (0), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (193), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (0), perch2_shop_variants (253), perch2_user_passwords (1), perch2_user_privileges (84), perch2_user_role_privileges (108), perch2_user_roles (3), perch2_users (5), perch_blog_categories (3), perch_blog_posts (17), perch_blog_posts_to_categories (13), perch_blog_posts_to_tags (20), perch_blog_tags (8), perch_contentItems (7), perch_events (0), perch_events_categories (0), perch_events_to_categories (0), perch_forms (2), perch_forms_responses (632), perch_gallery_albums (4), perch_gallery_images (348), perch_gallery_imagesets (87), perch_settings (15), perch_users (2)
Users: 5
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_blog',
        'perch_forms',
        'perch_members',
        'perch_shop',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: 871e1abcbd2111bbe54e5aab2ce6b6d9
L1: f3addfd64e9906cf023b3391a0d20db3
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #0e2044
content_singlePageEdit: 1
helpURL:
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.7: done
latest_version: 2.8.15
on_sale_version: 2.8.32
perch_gallery_update: 2.8.5
perch_blog_post_url: /blog/post/{postSlug}
headerLinkColour: #000000
logoPath: /admin/resources/bbs.png
linkColour: #ffffff
editorMayDeleteRegions: 0
perch_events_detail_url: /events/event.php?event={eventSlug}
perch_forms_editorMayConfigure: 1
perch_forms_editorMayDelete: 1
perch_events_editorMayManageCats: 0
latestUpdate: 1.8.4
headerScheme: dark
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 1
perch_gallery_bucket_mode: single
perch_gallery_bucket: default
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_comment_notify: 0
perch_gallery_basicUpload: 0
update_2.8.13: done
update_runway_2.8.31: done
perch_blog_update: 5.0.1
perch_shop_update: 1.0.9
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: exc
perch_shop_trade_price_tax_mode: exc
perch_shop_site_url: https://thebigblueswim.com/
perch_shop_product_url: /shop/products/{slug}
perch_shop_default_currency: 47
perch_shop_reporting_currency: 47
perch_shop_invoice_number_format: Invoice%d
perch_members_update: 1.4
perch_blog_site_name: The Big Blue Swim
update_runway_2.8.32: done
siteURL:
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: thebigbl_runway_admin
PERCH_DB_SERVER: 87.117.252.235
PERCH_DB_DATABASE: thebigbl_runway_live
PERCH_DB_PREFIX: perch2_
PERCH_DEBUG:
PERCH_TZ: UTC
PERCH_EMAIL_FROM: info@thebigblueswim.com
PERCH_EMAIL_FROM_NAME: The Big Blue Swim
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/thebigbl/public_html/admin
PERCH_CORE: /home/thebigbl/public_html/admin/core
PERCH_RESFILEPATH: /home/thebigbl/public_html/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_SITEPATH: /Users/Chris 1/Code/bigblueswim
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/thebigbl/public_html/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_SHOP_VERSION: 1.0.9
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.4.45
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 10.0.28-MariaDB
MySQL server: 10.0.28-MariaDB
Free disk space: 42.23 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, cgi-fcgi, bcmath, dom, gd, imap, json, exif, mcrypt, mysql, PDO, pdo_mysql, pdo_sqlite, Phar, posix, xmlreader, xmlwriter, mhash, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 2M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 2M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
CONTEXT_DOCUMENT_ROOT: /home/thebigbl/public_html
DOCUMENT_ROOT: /home/thebigbl/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTPS: on
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: __utma=179088353.1231942774.1479306128.1479735486.1479747384.5; __utmz=179088353.1479735486.4.3.utmcsr=newsite.thebigblueswim.com|utmccn=(referral)|utmcmd=referral|utmcct=/admin/addons/apps/perch_shop_products/; _ga=GA1.2.1231942774.1479306128; cmsa=1; PHPSESSID=3d6u4mqtdahggran6fs8vs4nd5
HTTP_HOST: thebigblueswim.com
HTTP_REFERER: https://thebigblueswim.com/admin/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.59 Safari/537.36
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 86.2.230.214
REMOTE_PORT: 50723
REQUEST_METHOD: GET
REQUEST_SCHEME: https
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/thebigbl/public_html/admin/core/settings/diagnostics/index.php
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
SERVER_ADDR: 87.117.252.235
SERVER_ADMIN: webmaster@thebigblueswim.com
SERVER_NAME: thebigblueswim.com
SERVER_PORT: 443
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
SSL_TLS_SNI: thebigblueswim.com
UNIQUE_ID: WDVUbVd1-OsAC6VJPfQAAAAN
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1479890029.8505
REQUEST_TIME: 1479890029

Thanks

Fishtank Creative

Fishtank Creative 2 points

  • 4 years ago

We had Stripe in test mode when we went live, I'm assuming this would be the reason the payment failed? I have now set test mode to false, like so

'stripe' => [
    'enabled'   => true,
    'test_mode' => false,
    'live' => [
        'secret_key'      => 'sk_live_xxxxxxxxxxxxxxxxxxxxxxxxx',
        'publishable_key' => 'pk_live_xxxxxxxxxxxxxxxxxxxxxxxxx',
    ],
    'test' => [
        'secret_key'      => 'sk_test_xxxxxxxxxxxxxxxxxxxxxxxxx',
        'publishable_key' => 'pk_test_xxxxxxxxxxxxxxxxxxxxxxxxx',
    ],
],
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's quite normal for cards to be declined - do you see the reason in Stripe?

No there wasn't any logs in stripe. So since i've set the test mode to false I created an order for 1 pence it went through but didn't get accepted.

In the logs there is a 200 status which says

Parsed Request POST Body

email: "barry@teamfc.co.uk"
validation_type: "card"
payment_user_agent: "Stripe Checkout v3 checkout-manhattan (stripe.js/15cb6da)"
card:
number: "************1079"
exp_month: "02"
exp_year: "19"
cvc: "***"
name: "barry@teamfc.co.uk"
key: "pk_live_xxxxxxxxxxxxxxxxxxxxxxxxx"

Response body

id: tok_xxxx
object: "token"
card:
id: card_xxxxx
object: "card"
address_city: null
address_country: null
address_line1: null
address_line1_check: null
address_line2: null
address_state: null
address_zip: null
address_zip_check: null
brand: "Visa"
country: "GB"
cvc_check: "pass"
dynamic_last4: null
exp_month: 2
exp_year: 2019
funding: "debit"
last4: "1079"
metadata:
name: "xxxx@xxx.xxx"
tokenization_method: null
client_ip: "xxxxxxxxx"
created: 1479891857
email: "barry@teamfc.co.uk"
livemode: true
type: "card"
used: false

Then got a 400 status that says

Parsed Request POST Body

amount: "1"
currency: "gbp"
description: "Order #96"
metadata: null
capture: "true"
source: "tok_19zzzzzxxxxcxcxfdfdffdf"

Response body

error:
type: "invalid_request_error"
message: "Amount must be at least 30 pence"
param: "amount"

At least I got something which tells me its now working as it should, I hope.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That seems logical to me.