• Resolved Rajilesh Panoli

    (@rajilesh)


    request

    curl ‘https://example.com/wp-json/wc/store/checkout’ \
    -H ‘accept: /‘ \
    -H ‘accept-language: en-US,en;q=0.9,de;q=0.8,ml;q=0.7,kn;q=0.6,sq;q=0.5’ \
    -H ‘authorization: Bearer {{token}}’ \
    -H ‘content-type: application/json’ \
    -H ‘origin: https://example.com’ \
    -H ‘priority: u=1, i’ \
    -H ‘referer: https://example.com’ \
    -H ‘sec-ch-ua: “Chromium”;v=”124″, “Google Chrome”;v=”124″, “Not-A.Brand”;v=”99″‘ \
    -H ‘sec-ch-ua-mobile: ?0’ \
    -H ‘sec-ch-ua-platform: “macOS”‘ \
    -H ‘sec-fetch-dest: empty’ \
    -H ‘sec-fetch-mode: cors’ \
    -H ‘sec-fetch-site: same-site’ \
    -H ‘user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36’ \
    –data-raw ‘{“payment_method”:”stripe”,”payment_method_title”:”Card”,”site_id”:”162″,”workspace_id”:”70″,”payment_data”:[{“key”:”stripe_source”,”value”:”pm_1PEBkOFQ5aasd9YlsfSOw”}],”shipping_address”:{“first_name”:”stripe”,”last_name”:”five”,”company”:”asd”,”address_1″:”asd”,”address_2″:”asd”,”city”:”asd”,”state”:”KL”,”postcode”:”670643″,”country”:”IN”,”phone”:”+918547105827″},”billing_address”:{“first_name”:”stripe”,”last_name”:”five”,”company”:”asd”,”address_1″:”asd”,”address_2″:”asd”,”city”:”asd”,”state”:”KL”,”postcode”:”123434″,”country”:”IN”,”phone”:”+911234567890″}}’

    response

    {
    
    "code": "internal_server_error",
    
    "message": "<p>There has been a critical error on this website.<\/p><p><a href=\"https:\/\/www.ads-software.com\/documentation\/article\/faq-troubleshooting\/\">Learn more about troubleshooting WordPress.<\/a><\/p>",
    
    "data": {
    
    "status": 500,
    
    "error": {
    
    "type": 1,
    
    "message": "Uncaught Error: Call to a member function get_token() on null in ****wp-content\/plugins\/woocommerce-gateway-stripe\/includes\/payment-methods\/class-wc-stripe-upe-payment-gateway.php:916\nStack trace:\n#0 ****wp-content\/plugins\/woocommerce-gateway-stripe\/includes\/payment-methods\/class-wc-stripe-upe-payment-gateway.php(1396): WC_Stripe_UPE_Payment_Gateway->process_payment_with_saved_payment_method()\n#1 ****wp-content\/plugins\/woocommerce-gateway-stripe\/includes\/class-wc-gateway-stripe.php(439): WC_Stripe_UPE_Payment_Gateway->retry_after_error()\n#2 ****wp-content\/plugins\/woocommerce-gateway-stripe\/includes\/payment-methods\/class-wc-stripe-upe-payment-gateway.php(696): WC_Gateway_Stripe->process_payment()\n#3 ****wp-content\/plugins\/woocommerce\/src\/StoreApi\/Legacy.php(54): WC_Stripe_UPE_Payment_Gateway->process_payment()\n#4 ****wp-includes\/class-wp-hook.php(324): Automattic\\WooCommerce\\StoreApi\\Legacy->process_legacy_payment()\n#5 ****wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()\n#6 ****wp-includes\/plugin.php(565): WP_Hook->do_action()\n#7 ****wp-content\/plugins\/woocommerce\/src\/StoreApi\/Utilities\/CheckoutTrait.php(82): do_action_ref_array()\n#8 ****wp-content\/plugins\/woocommerce\/src\/StoreApi\/Routes\/V1\/Checkout.php(252): Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\Checkout->process_payment()\n#9 ****wp-content\/plugins\/woocommerce\/src\/StoreApi\/Routes\/V1\/AbstractRoute.php(121): Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\Checkout->get_route_post_response()\n#10 ****wp-content\/plugins\/woocommerce\/src\/StoreApi\/Routes\/V1\/Checkout.php(125): Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\AbstractRoute->get_response_by_request_method()\n#11 ****wp-includes\/rest-api\/class-wp-rest-server.php(1230): Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\Checkout->get_response()\n#12 ****wp-includes\/rest-api\/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request()\n#13 ****wp-includes\/rest-api\/class-wp-rest-server.php(439): WP_REST_Server->dispatch()\n#14 ****wp-includes\/rest-api.php(428): WP_REST_Server->serve_request()\n#15 ****wp-includes\/class-wp-hook.php(324): rest_api_loaded()\n#16 ****wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()\n#17 ****wp-includes\/plugin.php(565): WP_Hook->do_action()\n#18 ****wp-includes\/class-wp.php(418): do_action_ref_array()\n#19 ****wp-includes\/class-wp.php(813): WP->parse_request()\n#20 ****wp-includes\/functions.php(1336): WP->main()\n#21 ****wp-blog-header.php(16): wp()\n#22 ****index.php(17): require('...')\n#23 {main}\n thrown",
    
    "file": "****wp-content\/plugins\/woocommerce-gateway-stripe\/includes\/payment-methods\/class-wc-stripe-upe-payment-gateway.php",
    
    "line": 916
    
    }
    
    },
    
    "additional_errors": []
    
    }

    Call to a member function get_token() on null in *

    can you please help me to figure it out this issue?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey there, @rajilesh! Thanks for contacting us. I’m happy to help you.

    As I understand you only have this issue with Indian addresses, correct? If you try another country it works correctly?

    Does this happen with all orders with an Indian address or only some?

    Can you please share a screenshot of what you see on WooCommerce > Settings > general > general options?

    Furthermore, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
    Fatal error logs (if any) under WooCommerce > Status > Logs. Then you can use the selector to search for Fatal Errors.
    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Looking forward to your reply.

    Have a wonderful day!

    Hi there ?? We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘getting 500 error when i use indian address for dollar currency in checkout api’ is closed to new replies.