All payments fail for virtual goods
-
I have a WooCommerce store that sells virtual goods. Instead of the standard WooCommerce checkout flow I have a custom checkout where I am creating a custom order programatically using the following piece of code:
global $woocommerce; $billing_address = array( … has all the billing fields … ); $order = wc_create_order(); $order->add_product(wc_get_product({product_id_goes_here}), 1); $order->set_address($billing_address, 'billing'); $order->calculate_totals(); $order->save(); $payment_url = $order->get_checkout_payment_url(); // redirecting to the payment page like a custom order from the wp-admin wp_safe_redirect($payment_url);In the payment page I have the list of payment gateways including Paypal through the new Woocommerce PayPal plugin. Please note that all my checkouts are guest checkouts. So when the I am trying to make the payments logged out of WordPress – all payments fail. Whereas when I try to make the payments being logged into to WordPress the payments go through. Please note that in the sandbox mode all payments are successful. My live PayPal account has the exact same settings as the Sandbox.
In order to debug, I have created a separate WordPress + Woocommerce installation with the exact same configuration but with the standard Woocommerce Cart -> Checkout -> Payment flow. In this case the payment is successful for both cases when I am logged into WordPress and when not.This is the log I have for the failed payments-
2021-11-17T18:08:13+00:00 DEBUG PATCH https://api.paypal.com/v2/checkout/orders/2E601447GN075780E Request Body: [{"op":"replace","value":{"reference_id":"default","amount":{"currency_code":"EUR","value":"1.00","breakdown":{"item_total":{"currency_code":"EUR","value":"1.00"},"shipping":{"currency_code":"EUR","value":"0.00"},"tax_total":{"currency_code":"EUR","value":"0.00"}}},"description":"","items":[{"name":"Test Payment","unit_amount":{"currency_code":"EUR","value":"1.00"},"quantity":1,"description":"Sprigiona la tua creativit\u00e0 e scopri come personalizzare qualsiasi ambiente in modo semplice e divertente!\r\nInsieme a Lorenzo S","sku":"","category":"DIGITAL_GOODS","tax":{"currency_code":"EUR","value":"0.00"}}],"payee":{"merchant_id":"5ELAVBVFK8DRQ"},"custom_id":"afaeba-675","invoice_id":"afaeba-675"},"path":"\/purchase_units\/@reference_id=='default'"}] Response Debug ID: 528a8d7f88bfe Response: Array ( [code] => 204 [message] => No Content ) 2021-11-17T18:08:13+00:00 DEBUG https://api.paypal.com/v2/checkout/orders/2E601447GN075780E Response Debug ID: 41d0eb1c4ff04 Response: Array ( [code] => 200 [message] => OK ) 2021-11-17T18:08:16+00:00 DEBUG POST https://api.paypal.com/v2/checkout/orders/2E601447GN075780E/capture Response Debug ID: ad1b59ebc5cd7 Response: Array ( [code] => 201 [message] => Created )Please let me know what is the issue with my custom store where I cannot accept payments using the PayPal plugin.
please help. thanks in advance
Also here is the system report -
### WordPress Environment ### WordPress address (URL): http://46.101.118.149/hubandstart Site address (URL): http://46.101.118.149/hubandstart WC Version: 5.9.0 REST API Version: ✔ 5.9.0 WC Blocks Version: ✔ 6.1.0 Action Scheduler Version: ✔ 3.3.0 WC Admin Version: ✔ 2.8.0 Log Directory Writable: ✔ WP Version: 5.8.2 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: it_IT External object cache: – ### Server Environment ### Server Info: Apache/2.4.29 (Ubuntu) PHP Version: 7.2.24-0ubuntu0.18.04.10 PHP Post Max Size: 64 MB PHP Time Limit: 120 PHP Max Input Vars: 1000 cURL Version: 7.58.0 OpenSSL/1.1.1 SUHOSIN Installed: – MySQL Version: 5.7.36-0ubuntu0.18.04.1 Max Upload Size: 64 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected. DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 5.9.0 WC Database Prefix: jtlb_ Total Database Size: 10.34MB Database Data Size: 8.09MB Database Index Size: 2.25MB jtlb_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB jtlb_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_woocommerce_order_itemmeta: Data: 0.08MB + Index: 0.09MB + Engine InnoDB jtlb_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB jtlb_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB jtlb_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB jtlb_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_actionscheduler_actions: Data: 0.05MB + Index: 0.13MB + Engine InnoDB jtlb_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_actionscheduler_logs: Data: 0.05MB + Index: 0.03MB + Engine InnoDB jtlb_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_comments: Data: 0.05MB + Index: 0.09MB + Engine InnoDB jtlb_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_options: Data: 3.48MB + Index: 0.06MB + Engine InnoDB jtlb_postmeta: Data: 1.48MB + Index: 0.45MB + Engine InnoDB jtlb_posts: Data: 0.30MB + Index: 0.09MB + Engine InnoDB jtlb_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_usermeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB jtlb_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB jtlb_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB jtlb_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB jtlb_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB jtlb_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB jtlb_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB jtlb_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB jtlb_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB jtlb_wpml_mails: Data: 1.52MB + Index: 0.00MB + Engine InnoDB jtlb_yoast_indexable: Data: 0.17MB + Index: 0.16MB + Engine InnoDB jtlb_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB jtlb_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB jtlb_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB jtlb_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB ### Post Type Counts ### artificialia-post: 2 attachment: 297 customize_changeset: 19 form-data: 1 job: 3 nav_menu_item: 32 page: 27 post: 1 product: 10 revision: 28 shop_order: 104 soundstudio-post: 2 tutor: 8 wpcf7_contact_form: 5 ### Security ### Secure connection (HTTPS): ❌ Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates. Hide errors from visitors: ✔ ### Active Plugins (22) ### Query Monitor: by John Blackbourn – 3.7.1 All-in-One WP Migration: by ServMask – 1000.00 Contact Form 7: by Takayuki Miyoshi – 5.5.2 Yoast Duplicate Post: by Enrico Battocchi & Team Yoast – 4.1.2 Google Tag Manager for WordPress: by Thomas Geiger – 1.13.1 Fix Contact Form 7 Blank Fields: by Robson Sanches – 1.0.1 Kadence WooCommerce Email Designer: by Kadence WP – 1.4.8 MB Admin Columns: by MetaBox.io – 1.6.0 MB Term Meta: by MetaBox.io – 1.2.10 Meta Box Conditional Logic: by MetaBox.io – 1.6.14 Meta Box Group: by MetaBox.io – 1.3.12 Meta Box Include Exclude: by MetaBox.io – 1.0.11 Meta Box: by MetaBox.io – 5.4.8 Post Types Order: by Nsp Code – 1.9.5.7 Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.5 Safe SVG: by Daryll Doyle – 1.9.9 Category Order and Taxonomy Terms Order: by Nsp-Code – 1.5.7.7 WooCommerce Stripe Gateway: by WooCommerce – 5.7.0 WooCommerce PayPal Payments: by WooCommerce – 1.6.1 WooCommerce: by Automattic – 5.9.0 Yoast SEO: by Team Yoast – 17.6 WP Mail Logging: by Wysija – 1.9.9 ### Inactive Plugins (3) ### WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.1.3 Wordfence Security: by Wordfence – 7.5.6 WP Downgrade | Specific Core Version: by Reisetiger – 1.2.2 ### Dropin Plugins (1) ### db.php: Query Monitor Database Class ### Must Use Plugins (1) ### Health Check Troubleshooting Mode: by – 1.7.2 ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: right Thousand Separator: . Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: simple (simple) grouped (grouped) variable (variable) external (external) Taxonomies: Product Visibility: exclude-from-search (exclude-from-search) exclude-from-catalog (exclude-from-catalog) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #266 - /shop/ Cart: #76 - /cart/ Checkout: #77 - /checkout/ My account: #78 - /my-account/ Terms and conditions: #3 - /privacy-policy/ ### Theme ### Name: Jeetlab Wp Theme Version: 3.0.2 Author URL: http://www.jeetlab.in/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: jtlb-theme/woocommerce/archive-product.php jtlb-theme/woocommerce/checkout/form-checkout.php jtlb-theme/woocommerce/checkout/form-pay.php jtlb-theme/woocommerce/checkout/order-receipt.php jtlb-theme/woocommerce/checkout/payment-method.php jtlb-theme/woocommerce/checkout/thankyou.php jtlb-theme/woocommerce/content-product.php jtlb-theme/woocommerce/content-single-product.php jtlb-theme/woocommerce/emails/email-addresses.php jtlb-theme/woocommerce/emails/email-downloads.php jtlb-theme/woocommerce/global/breadcrumb.php jtlb-theme/woocommerce/global/sidebar.php jtlb-theme/woocommerce/global/wrapper-end.php jtlb-theme/woocommerce/global/wrapper-start.php jtlb-theme/woocommerce/loop/loop-end.php jtlb-theme/woocommerce/loop/loop-start.php jtlb-theme/woocommerce/loop/no-products-found.php jtlb-theme/woocommerce/order/order-details-customer.php jtlb-theme/woocommerce/single-product/add-to-cart/simple.php ### WooCommerce PayPal Payments ### Onboarded: Yes Shop country code: IT PayPal card processing available in country: Yes Pay Later messaging available in country: No Vault enabled: Yes ### Action Scheduler ### Complete: 109 Oldest: 2021-10-18 10:48:04 +0200 Newest: 2021-11-17 19:36:46 +0100 ### Status report information ### Generated at: 2021-11-17 19:47:43 +01:00
The topic ‘All payments fail for virtual goods’ is closed to new replies.