Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Stripe subscription testing
Tagged: stripe subscription
- This topic has 3 replies, 3 voices, and was last updated 4 years, 2 months ago by michaelw.
-
AuthorPosts
-
August 24, 2020 at 2:14 am #15652michaelwParticipant
Hi, I’m using the payments gateway bundle so I can use stripe subscriptions for eMember memberships. I have a few questions (I’m in sandbox mode):
* A failed transaction (using either bad card number, or Stripe card number to get a specific error), the transaction feeds back to the Thanks (success) page and related activities (signup to Mailchimp etc.) happen. The debug log shows the failed transaction and reason, but the site behaviour doesn’t reflect this.
* Is there a way to test various types of failure in sandbox mode?
* The documentation suggests that cancellations etc. will all cascade through. Is there any way to test/verify this?
* If a customer makes multiple purchases (i.e. customer with same email address), it is adding multiple customers. Is there any facility to consolidate this into a single customer?
I am using WP 5.5, on Dreamhost (cache supplied by them from what I can gather, but disabled for the moment).
I’d appreciate any clarification on these issues.
Cheers.
An extract from the debug log:
[08/17/2020 12:04 PM] – SUCCESS :Stripe Subscription: Processing renewal payment failure for Order ID – 5f39d7646a33b, Plan ID: wpestore7, Customer ID: cus_Hqe3y4ysAtBDzA, Subscription ID – sub_Hqe3TNAybzsoRC
[08/24/2020 11:44 AM] – SUCCESS :===Received event notification from Stripe===
[08/24/2020 11:44 AM] – SUCCESS :
stdClass Object
(
[id] => evt_1HGwl8HPwqMb6jvOVbi2VEC2
[object] => event
[api_version] => 2020-03-02
[created] => 1597626214
[data] => stdClass Object
(
[object] => stdClass Object
(
[id] => in_1HGwl6HPwqMb6jvOFM86Z6gV
[object] => invoice
[account_country] => MY
[account_name] =>
[amount_due] => 400
[amount_paid] => 0
[amount_remaining] => 400
[application_fee_amount] =>
[attempt_count] => 1
[attempted] => 1
[auto_advance] => 1
[billing_reason] => subscription_create
[charge] => ch_1HGwl7HPwqMb6jvONwRF7DFb
[collection_method] => charge_automatically
[created] => 1597626212
[currency] => usd
[custom_fields] =>
[customer] => cus_Hqe3y4ysAtBDzA
[customer_address] =>
[customer_email] => *******@gmail.com
[customer_name] =>
[customer_phone] =>
[customer_shipping] =>
[customer_tax_exempt] => none
[customer_tax_ids] => Array
(
)
[default_payment_method] =>
[default_source] =>
[default_tax_rates] => Array
(
)
[description] =>
[discount] =>
[discounts] => Array
(
)
[due_date] =>
[ending_balance] => 0
[footer] =>
[hosted_invoice_url] => https://pay.stripe.com/invoice/acct_1H79cnHPwqMb6jvO/invst_Hqe37ZCFobvuMKASkZE2SHv7EC47MyG
[invoice_pdf] => https://pay.stripe.com/invoice/acct_1H79cnHPwqMb6jvO/invst_Hqe37ZCFobvuMKASkZE2SHv7EC47MyG/pdf
[lines] => stdClass Object
(
[object] => list
[data] => Array
(
[0] => stdClass Object
(
[id] => il_1HGwl6HPwqMb6jvOjs9mJmyk
[object] => line_item
[amount] => 400
[currency] => usd
[description] => 1 × Subscription – basic monthly (at $4.00 / month)
[discount_amounts] => Array
(
)
[discountable] => 1
[discounts] => Array
(
)
[livemode] =>
[metadata] => stdClass Object
(
)
[period] => stdClass Object
(
[end] => 1600304612
[start] => 1597626212
)
[plan] => stdClass Object
(
[id] => wpestore7
[object] => plan
[active] => 1
[aggregate_usage] =>
[amount] => 400
[amount_decimal] => 400
[billing_scheme] => per_unit
[created] => 1597030587
[currency] => usd
[interval] => month
[interval_count] => 1
[livemode] =>
[metadata] => stdClass Object
(
[eStore_prod_id] => 7
)
[nickname] =>
[product] => prod_Ho3wjKw19p8q8c
[tiers] =>
[tiers_mode] =>
[transform_usage] =>
[trial_period_days] =>
[usage_type] => licensed
)
[price] => stdClass Object
(
[id] => wpestore7
[object] => price
[active] => 1
[billing_scheme] => per_unit
[created] => 1597030587
[currency] => usd
[livemode] =>
[lookup_key] =>
[metadata] => stdClass Object
(
[eStore_prod_id] => 7
)
[nickname] =>
[product] => prod_Ho3wjKw19p8q8c
[recurring] => stdClass Object
(
[aggregate_usage] =>
[interval] => month
[interval_count] => 1
[trial_period_days] =>
[usage_type] => licensed
)
[tiers_mode] =>
[transform_quantity] =>
[type] => recurring
[unit_amount] => 400
[unit_amount_decimal] => 400
)
[proration] =>
[quantity] => 1
[subscription] => sub_Hqe3TNAybzsoRC
[subscription_item] => si_Hqe3sZBVw0xBH6
[tax_amounts] => Array
(
)
[tax_rates] => Array
(
)
[type] => subscription
)
)
[has_more] =>
[total_count] => 1
[url] => /v1/invoices/in_1HGwl6HPwqMb6jvOFM86Z6gV/lines
)
[livemode] =>
[metadata] => stdClass Object
(
)
[next_payment_attempt] =>
[number] =>
[paid] =>
[payment_intent] => pi_1HGwl7HPwqMb6jvOm2oxigmO
[period_end] => 1597626212
[period_start] => 1597626212
[post_payment_credit_notes_amount] => 0
[pre_payment_credit_notes_amount] => 0
[receipt_number] =>
[starting_balance] => 0
[statement_descriptor] =>
[status] => open
[status_transitions] => stdClass Object
(
[finalized_at] => 1597626212
[marked_uncollectible_at] =>
[paid_at] =>
[voided_at] =>
)
[subscription] => sub_Hqe3TNAybzsoRC
[subtotal] => 400
[tax] =>
[tax_percent] =>
[total] => 400
[total_discount_amounts] => Array
(
)
[total_tax_amounts] => Array
(
)
[transfer_data] =>
[webhooks_delivered_at] =>
)
)
[livemode] =>
[pending_webhooks] => 1
[request] => stdClass Object
(
[id] => req_q1IuarjIbG8iLh
[idempotency_key] =>
)
[type] => invoice.payment_failed
)
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: Checking if record exists in the database
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: successfully retrieved cart information for Order ID – 5f39d7646a33b
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: successfully retrieved customer information for Order ID – 5f39d7646a33b
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: successfully retrieved subscription information for Order ID – 5f39d7646a33b
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: Creating Payment data array
[08/24/2020 11:44 AM] – SUCCESS :
Array
(
[gateway] => stripe_subsc
[custom] => eMember_id=37&ip=119.18.0.84&subsc_ref=5
[txn_id] => sub_Hqe3TNAybzsoRC
[txn_type] => subscription
[transaction_subject] =>
[first_name] => *************
[last_name] => *************
[payer_email] => *******@gmail.com
[num_cart_items] => 1
[subscr_id] => sub_Hqe3TNAybzsoRC
[address] => *************
[phone] => *************
[coupon_used] =>
[eMember_username] => 37
[eMember_userid] => 37
[mc_gross] => 4
[mc_shipping] => 0
[mc_tax] => 0
[address_street] => *************
[address_city] => *************
[address_state] => *************
[address_country] => AU
[address_zip] => *************
[background_post] => yes
)
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: Creating cart items array
[08/24/2020 11:44 AM] – SUCCESS :
Array
(
[0] => Array
(
[item_number] => 7
[item_name] => Subscription – basic monthly
[quantity] => 1
[mc_gross] => 4
[mc_shipping] => 0
[mc_currency] => USD
)
)
[08/24/2020 11:44 AM] – SUCCESS :Stripe Subscription: Processing renewal payment failure for Order ID – 5f39d7646a33b, Plan ID: wpestore7, Customer ID: cus_Hqe3y4ysAtBDzA, Subscription ID – sub_Hqe3TNAybzsoRC
[/url]
August 24, 2020 at 11:52 pm #80899wzpModeratorFirst, Sandbox testing is not recommended for performing end-to-end testing. We only support it, to make sure that IPN are properly received; as there are issues of “transaction incompleteness” that are passed back from payment gateways in sandbox mode. Your testing would go a lot better, if you simply did a “low value” live test.
In the last week, since it was released, several WP 5.5 incompatibility issues have arisen. In order to eliminate one potential source of problems; are you able to run the previous version of WP?
August 25, 2020 at 2:45 am #80900adminKeymasterTransactions are only processed after a success message is received from the Payment Gateway API. This is not something you need to test for like the way you are trying to test. We have many thousands of users using this plugin right now. So we have very good pulse on real critical issues (if and when they arise).
Feel free to do a live transaction with an Invalid Card and you will see how the transaction gets stopped.
August 27, 2020 at 1:28 am #80901michaelwParticipantOkay, thanks for your responses. I’ll send it live and see how it goes. Cheers.
-
AuthorPosts
- You must be logged in to reply to this topic.