solidusio / solidusio/solidus_subscriptions

Validation failed: Payment source can't be blank

Open
#247 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Ruby
Stars
49
Forks
53
Avg merge
4h 54m
Merged PRs (30d)
1

Description

I have been struggling to locate what the actual issue is. I've tried tracing the problem but I am not getting enough information from the errors on where the issue is? Any help would be greatly appreciated as I am working on a production product.

When I run: bundle exec rake solidus_subscriptions:process

ActiveRecord::RecordInvalidsolidus_subscriptions:process
Validation failed: Payment source can't be blank

~ $ bundle exec rake solidus_subscriptions:process
W, [2021-12-03T17:32:53.203079 #7] WARN -- : DEBUG log level not allowed in sandbox mode for security of confidential information. Changing log level to INFO...
DEPRECATION WARNING: Spree::Order state machine defined in Spree::Order::Checkout is deprecated. Future versions of Solidus will use Spree::Core::StateMachines::Order} (called from

at /app/vendor/bundle/ruby/2.7.0/bundler/gems/solidus_subscriptions-0a0659d1150a/app/decorators/models/solidus_subscriptions/spree/order/installment_details_association.rb:15)
/app/app/controllers/decorators/orders_controller_decorator.rb:9: warning: calling private without arguments inside a method may not have the intended effect
I, [2021-12-03T17:32:55.245231 #7] INFO -- [Bugsnag]: Notifying https://notify.bugsnag.com of ActiveRecord::RecordInvalid
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Payment source can't be blank
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/validations.rb:80:in raise_validation_error' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/validations.rb:53:in save!'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:318:in block in save!' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:375:in block in with_transaction_returning_status'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in transaction' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:212:in transaction'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:366:in with_transaction_returning_status' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:318:in save!'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/suppressor.rb:48:in save!' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-activerecord-0.8.0/lib/state_machines/integrations/active_record.rb:515:in block in save!'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-activerecord-0.8.0/lib/state_machines/integrations/active_record.rb:530:in block in around_save' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:150:in block in run_actions'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:170:in catch_exceptions' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:148:in run_actions'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:133:in run_callbacks' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:212:in run_callbacks'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:63:in block (2 levels) in perform' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:63:in catch'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:63:in block in perform' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:186:in within_transaction'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-0.5.0/lib/state_machines/transition_collection.rb:62:in perform' /app/vendor/bundle/ruby/2.7.0/gems/state_machines-activerecord-0.8.0/lib/state_machines/integrations/active_record.rb:530:in around_save'
/app/vendor/bundle/ruby/2.7.0/gems/state_machines-activerecord-0.8.0/lib/state_machines/integrations/active_record.rb:515:in save!' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/persistence.rb:635:in block in update!'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:375:in block in with_transaction_returning_status' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in transaction'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:212:in transaction' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:366:in with_transaction_returning_status'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/persistence.rb:633:in update!' /app/vendor/bundle/ruby/2.7.0/bundler/gems/solidus_subscriptions-0a0659d1150a/app/models/solidus_subscriptions/subscription.rb:201:in advance_actionable_date'
/app/vendor/bundle/ruby/2.7.0/bundler/gems/solidus_subscriptions-0a0659d1150a/lib/solidus_subscriptions/processor.rb:16:in block in process_subscription' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in block in transaction'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/abstract/transaction.rb:280:in block in within_new_transaction' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in block (2 levels) in synchronize'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in handle_interrupt' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in block in synchronize'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in handle_interrupt' /app/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in synchronize'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/abstract/transaction.rb:278:in within_new_transaction' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in transaction'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/transactions.rb:212:in transaction' /app/vendor/bundle/ruby/2.7.0/bundler/gems/solidus_subscriptions-0a0659d1150a/lib/solidus_subscriptions/processor.rb:14:in process_subscription'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:70:in block (2 levels) in find_each' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:70:in each'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:70:in block in find_each' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:136:in block in find_in_batches'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:238:in block in in_batches' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:222:in loop'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:222:in in_batches' /app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:135:in find_in_batches'
/app/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.3.6/lib/active_record/relation/batches.rb:69:in find_each' /app/vendor/bundle/ruby/2.7.0/bundler/gems/solidus_subscriptions-0a0659d1150a/lib/solidus_subscriptions/processor.rb:7:in run'
/app/vendor/bundle/ruby/2.7.0/bundler/gems/solidus_subscriptions-0a0659d1150a/lib/tasks/process_subscriptions.rake:6:in block (2 levels) in <main>' /app/vendor/bundle/ruby/2.7.0/gems/bugsnag-6.18.0/lib/bugsnag/integrations/rake.rb:20:in execute'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in <top (required)>' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in load'
/app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:63:in kernel_load' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/cli/exec.rb:28:in run'
/app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/cli.rb:474:in exec' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run'
/app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch'
/app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/cli.rb:30:in dispatch' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start'
/app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/cli.rb:24:in start' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/exe/bundle:49:in block in <top (required)>'
/app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/lib/bundler/friendly_errors.rb:128:in with_friendly_errors' /app/vendor/bundle/ruby/2.7.0/gems/bundler-2.2.21/exe/bundle:37:in <top (required)>'
/app/bin/bundle:3:in load' /app/bin/bundle:3:in '
Tasks: TOP => solidus_subscriptions:process
(See full trace by running task with --trace)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with bundle exec rake solidus_subscriptions:process, then trace the call from lib/solidus_subscriptions/processor.rb to app/models/solidus_subscriptions/subscription.rb:201. Determine which subscription data leads to the missing payment source and define the expected behavior before adding a regression test; the issue is done when the task no longer fails for the reported case or reports a useful, tested error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.