Shopify started to pro upgrade issue gr852
This is about Jira GR8-52
User ID: 2632760
[
[0] #<ProSubscription:0x00005573c0ff68b8> {
:id => 64177,
:credit_card_id => 101097,
:price => 899,
:created_at => Thu, 01 Aug 2019 05:31:00 UTC +00:00,
:updated_at => Thu, 14 Nov 2019 08:31:50 UTC +00:00,
:active => false,
:last_invoice => Sat, 01 Jan 2000 00:00:00 UTC +00:00,
:level => "premium",
:subscription_type => "monthly",
:user_id => 3270091,
:downgraded_at => Thu, 14 Nov 2019 08:31:50 UTC +00:00,
:promo_price => nil,
:promo_end => nil,
:app_type => "formBuilder",
:to_downgrade_at => nil,
:to_activate_at => nil
},
[1] #<ProSubscription:0x00005573c0ff64f8> {
:id => 70223,
:credit_card_id => 101097,
:price => 1599,
:created_at => Thu, 14 Nov 2019 08:31:48 UTC +00:00,
:updated_at => Tue, 14 Jan 2020 10:01:37 UTC +00:00,
:active => false,
:last_invoice => Sat, 01 Jan 2000 00:00:00 UTC +00:00,
:level => "pro",
:subscription_type => "monthly",
:user_id => 3270091,
:downgraded_at => Tue, 14 Jan 2020 10:01:37 UTC +00:00,
:promo_price => nil,
:promo_end => nil,
:app_type => "formBuilder",
:to_downgrade_at => Tue, 14 Jan 2020 11:07:07 UTC +00:00,
:to_activate_at => nil
},
[2] #<ProSubscription:0x00005573c0ff62c8> {
:id => 72800,
:credit_card_id => 101097,
:price => 0,
:created_at => Sat, 04 Jan 2020 14:35:41 UTC +00:00,
:updated_at => Sun, 19 Jan 2020 18:39:51 UTC +00:00,
:active => true,
:last_invoice => Sat, 01 Jan 2000 00:00:00 UTC +00:00,
:level => "premium",
:subscription_type => "monthly",
:user_id => 3270091,
:downgraded_at => nil,
:promo_price => nil,
:promo_end => nil,
:app_type => "formBuilder",
:to_downgrade_at => nil,
:to_activate_at => Tue, 14 Jan 2020 11:07:07 UTC +00:00
}
]
[
[0] #<Transaction:0x00005573c0f692d8> {
:id => 599354,
:external_id => "15808409",
:data => {
"description" => "Pro membership for user 3270091 plugin",
"price" => "8.99",
"id" => 15808409,
"created_at" => "2019-08-01T13:31:00+08:00",
"billing_on" => "2019-08-31",
"balance_used" => 8.99,
"balance_remaining" => 0.009999999999999787,
"risk_level" => 0.3025
},
:created_at => Thu, 01 Aug 2019 05:31:01 UTC +00:00,
:updated_at => Thu, 01 Aug 2019 05:31:01 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 64177,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Thu, 01 Aug 2019 05:31:00 UTC +00:00,
:charge_errors => nil,
:price => 899,
:credit_card_id => 91534,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[1] #<Transaction:0x00005573c0f68e78> {
:id => 613611,
:external_id => "16544137",
:data => {
"description" => "Pro membership for user 3270091 plugin",
"price" => "8.99",
"id" => 16544137,
"created_at" => "2019-09-01T18:44:36+07:00",
"billing_on" => "2019-09-30",
"balance_used" => 8.99,
"balance_remaining" => 0.009999999999999787,
"risk_level" => 0.2961
},
:created_at => Sun, 01 Sep 2019 11:02:46 UTC +00:00,
:updated_at => Sun, 01 Sep 2019 11:44:36 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 64177,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Sun, 01 Sep 2019 11:44:35 UTC +00:00,
:charge_errors => nil,
:price => 899,
:credit_card_id => 91534,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[2] #<Transaction:0x00005573c0f68ab8> {
:id => 627413,
:external_id => "17291243",
:data => {
"description" => "Pro membership for user 3270091 plugin",
"price" => "8.99",
"id" => 17291243,
"created_at" => "2019-10-01T18:49:40+07:00",
"billing_on" => "2019-10-30",
"balance_used" => 8.99,
"balance_remaining" => 0.009999999999999787,
"risk_level" => 0.4422
},
:created_at => Tue, 01 Oct 2019 11:07:25 UTC +00:00,
:updated_at => Tue, 01 Oct 2019 11:49:41 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 64177,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Tue, 01 Oct 2019 11:49:34 UTC +00:00,
:charge_errors => nil,
:price => 899,
:credit_card_id => 91534,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[3] #<Transaction:0x00005573c0f68810> {
:id => 641135,
:external_id => "18212097",
:data => {
"description" => "Pro membership for user 3270091 plugin",
"price" => "8.99",
"id" => 18212097,
"created_at" => "2019-11-01T18:38:49+07:00",
"billing_on" => "2019-11-29",
"balance_used" => 8.99,
"balance_remaining" => 0.009999999999999787,
"risk_level" => 0.6297
},
:created_at => Fri, 01 Nov 2019 11:11:48 UTC +00:00,
:updated_at => Fri, 01 Nov 2019 11:38:50 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 64177,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Fri, 01 Nov 2019 11:38:49 UTC +00:00,
:charge_errors => nil,
:price => 899,
:credit_card_id => 91534,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[4] #<Transaction:0x00005573c0f68568> {
:id => 645570,
:external_id => "48jyznjc",
:data => {
"id" => "48jyznjc",
"type" => "sale",
"amount" => "15.99",
"status" => "submitted_for_settlement",
"created_at" => "2019-11-14T08:31:49.000Z"
},
:created_at => Thu, 14 Nov 2019 08:31:50 UTC +00:00,
:updated_at => Thu, 14 Nov 2019 08:31:50 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 70223,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Thu, 14 Nov 2019 08:31:49 UTC +00:00,
:charge_errors => nil,
:price => 1599,
:credit_card_id => 97729,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[5] #<Transaction:0x00005573c0f682c0> {
:id => 660914,
:external_id => "3phanwpb",
:data => {
"id" => "3phanwpb",
"type" => "sale",
"amount" => "15.99",
"status" => "submitted_for_settlement",
"created_at" => "2019-12-14T12:13:45.000Z"
},
:created_at => Sat, 14 Dec 2019 11:07:07 UTC +00:00,
:updated_at => Sat, 14 Dec 2019 12:13:48 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 70223,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Sat, 14 Dec 2019 12:13:45 UTC +00:00,
:charge_errors => nil,
:price => 1599,
:credit_card_id => 97729,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[6] #<Transaction:0x00005573c0f73fa8> {
:id => 674622,
:external_id => nil,
:data => nil,
:created_at => Tue, 14 Jan 2020 11:05:39 UTC +00:00,
:updated_at => Sat, 01 Feb 2020 11:43:51 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 72800,
:status => "pending",
:failed_charge_attempts => 12,
:last_charge_attempt => Sat, 01 Feb 2020 11:43:50 UTC +00:00,
:charge_errors => "Amount must be greater than zero.",
:price => nil,
:credit_card_id => 101097,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
}
]
Here is what i discovered:-
- The last transaction with ID:674622 is associated with pro_subscription_id: 72800, for some reason, possibly during braintree upgrade, this subscription was updated to amount 0? Not sure why?
- If they were upgraded via braintree, why is that pro_subscription cancelled with this cancel feedback?
[
[0] #<CancelFeedback:0x00005573bd5d63b8> {
:id => 62080,
:reason => "Downgraded",
:subscription_type => "pro",
:subscription_id => 70223,
:details => "Automatic downgrade on subscription changes",
:created_at => Tue, 14 Jan 2020 10:01:37 UTC +00:00,
:updated_at => Tue, 14 Jan 2020 10:01:37 UTC +00:00,
:cancelled_by => nil,
:deleted_at => nil,
:source => nil
}
]
---
---
## User ID: 3968188
> tried to upgrade Popup from Starter to Pro. Seems like they ended up upgrading using Braintree
```ruby
[
[0] #<Transaction:0x00005573c0cd2498> {
:id => 671002,
:external_id => "22724369",
:data => {
"description" => "Pro membership for user 3968188 plugin",
"price" => "3.99",
"id" => 22724369,
"created_at" => "2020-01-07T13:23:58-06:00",
"billing_on" => "2020-02-06",
"balance_used" => 3.99,
"balance_remaining" => 0.009999999999999787,
"risk_level" => 0.0912425
},
:created_at => Tue, 07 Jan 2020 19:23:59 UTC +00:00,
:updated_at => Tue, 07 Jan 2020 19:23:59 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 72941,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Tue, 07 Jan 2020 19:23:57 UTC +00:00,
:charge_errors => nil,
:price => 399,
:credit_card_id => 100422,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
},
[1] #<Transaction:0x00005573c0cd21f0> {
:id => 672434,
:external_id => "a71qwhyj",
:data => {
"id" => "a71qwhyj",
"type" => "sale",
"amount" => "10.99",
"status" => "settling",
"created_at" => "2020-01-09T16:09:03.000Z"
},
:created_at => Thu, 09 Jan 2020 16:09:07 UTC +00:00,
:updated_at => Thu, 09 Jan 2020 16:09:07 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 73055,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Thu, 09 Jan 2020 16:09:02 UTC +00:00,
:charge_errors => nil,
:price => 1099,
:credit_card_id => 100524,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
}
]
Pro Subscriptions
[
[0] #<ProSubscription:0x00005573c0d6c0c0> {
:id => 72941,
:credit_card_id => 100422,
:price => 399,
:created_at => Tue, 07 Jan 2020 19:23:57 UTC +00:00,
:updated_at => Thu, 09 Jan 2020 16:09:08 UTC +00:00,
:active => false,
:last_invoice => Sat, 01 Jan 2000 00:00:00 UTC +00:00,
:level => "premium",
:subscription_type => "monthly",
:user_id => 3968188,
:downgraded_at => Thu, 09 Jan 2020 16:09:08 UTC +00:00,
:promo_price => nil,
:promo_end => nil,
:app_type => "popup",
:to_downgrade_at => nil,
:to_activate_at => nil
},
[1] #<ProSubscription:0x00005573c0d7bd18> {
:id => 73055,
:credit_card_id => 100524,
:price => 1099,
:created_at => Thu, 09 Jan 2020 16:09:02 UTC +00:00,
:updated_at => Thu, 09 Jan 2020 16:09:02 UTC +00:00,
:active => true,
:last_invoice => Sat, 01 Jan 2000 00:00:00 UTC +00:00,
:level => "pro",
:subscription_type => "monthly",
:user_id => 3968188,
:downgraded_at => nil,
:promo_price => nil,
:promo_end => nil,
:app_type => "popup",
:to_downgrade_at => nil,
:to_activate_at => nil
}
]

What i discovered?
- This is definately a bug, not sure how/why error received an error while upgrading. And looking at the shopify charge history, user even perhaps user did not accept the charge, so it says
Recurring charge expired? Regardless I have a MR that should help us debug which plan they are signing up/upgrading for in future.
User ID: 3968188
Looks like they wanted to upgrade Form Builder from Pro to Business.
ERROR
Shopify response: #<ShopifyAPI::UsageCharge:0x0000555b0bfe68a0 @attributes={"description"=>"Pro membership for user 3975654 plugin", "price"=>64.523}, @prefix_options={:recurring_application_charge_id=>"12080775227"}, @persisted=false, @remote_errors=#<ActiveResource::ResourceInvalid: Failed. Response code = 422. Response message = Unprocessable Entity.>, @validation_context=nil, @errors=#<ActiveResource::Errors:0x0000555b0bfe5860 @base=#<ShopifyAPI::UsageCharge:0x0000555b0bfe68a0 ...>, @messages={:base=>["Failed to create usage charge"]}, @details={:base=>[{:error=>"Failed to create usage charge"}]}
Transaction & ProSubscription
[
[0] #<ProSubscription:0x00005573c0e59640> {
:id => 73010,
:credit_card_id => 100479,
:price => 1599,
:created_at => Wed, 08 Jan 2020 22:53:22 UTC +00:00,
:updated_at => Fri, 10 Jan 2020 21:27:38 UTC +00:00,
:active => true,
:last_invoice => Sat, 01 Jan 2000 00:00:00 UTC +00:00,
:level => "pro",
:subscription_type => "monthly",
:user_id => 3975654,
:downgraded_at => nil,
:promo_price => nil,
:promo_end => nil,
:app_type => "formBuilder",
:to_downgrade_at => Mon, 10 Feb 2020 21:27:38 UTC +00:00,
:to_activate_at => nil
}
]
=> nil
irb(main):090:0> ap t
[
[0] #<Transaction:0x00005573c0e8d5f8> {
:id => 671201,
:external_id => "22775799",
:data => {
"description" => "Pro membership for user 3975654 plugin",
"price" => "15.99",
"id" => 22775799,
"created_at" => "2020-01-08T23:53:23+01:00",
"billing_on" => "2020-02-07",
"balance_used" => 15.99,
"balance_remaining" => 0.009999999999999787,
"risk_level" => 0.2665
},
:created_at => Wed, 08 Jan 2020 22:53:24 UTC +00:00,
:updated_at => Wed, 08 Jan 2020 22:53:24 UTC +00:00,
:app_subscription_id => nil,
:pro_subscription_id => 73010,
:status => "charged",
:failed_charge_attempts => 0,
:last_charge_attempt => Wed, 08 Jan 2020 22:53:22 UTC +00:00,
:charge_errors => nil,
:price => 1599,
:credit_card_id => 100479,
:refund_enum => nil,
:refund_at => nil,
:refund_amount => nil,
:refund_data => nil,
:primary_platform => "shopify"
}
]

What I discovered?
- User only has one subscription and pro_subscription each, so there should not really be an issue here. What does
Subscription charge expired mean?. Shopify response is not clear enough, it just says :
Unprocessable Entity.: Failed to create usage charge