Fix issue charging disabled / deleted user #1993
Closes #1993
Testing
I'll use the account testacc for testing - a subscription is already set up and can be checked manually and reset back to an active state after failing with the following:
First enter the Cassandra pod
kubectl exec -it cassandra-0 cqlsh
Then to check the subscription, run:
select * from minds.subscriptions where plan_id='wire' and payment_method='tokens' and entity_guid=991463054707265537 and user_guid=1003026063363674113;
To set the state back to active after running the (further down) cli job, run
UPDATE minds.subscriptions SET status='active' where plan_id='wire' and payment_method='tokens' and entity_guid=991463054707265537 and user_guid=1003026063363674113 and subscription_id='urn:subscription:offchain-1003026063363674113-991463054707265537';
Now:
- Enter the pod using kubectl, and from the engine dir, run
php cli.php payments subscriptions run
. - See no error output
- Reset the state using the above CQL UPDATE command.
- Login as sandbox admin.
- Ban testacc.
- Re-run the payments subscriptions CLI and see the error message that payment failed because the user is banned.
Edited by Ben