-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
False
-
None
-
False
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
-
Given a gateway configuration like this:
Account.find(111111111111).provider_account.gateway_setting => #<PaymentGatewaySetting id: 14, gateway_settings: {"test"=>1, "private_key"=>"foo", "merchant_id"=>"bar", "public_key"=>"foobar"}, gateway_type: "stripe", account_id: 2445273191238, created_at: nil, updated_at: "2017-04-12 08:20:33.000000000 +0000", tenant_id: nil>
When trying to delete the account results in an error.
irb(main):020:0> Account.find(11111111111111).smart_destroy
[EventBroker] notifying subscribers of Applications::ApplicationDeletedEvent bc1f5fd5-6ff0-4958-8999-665f6a4c72ea
[EventBroker] notifying subscribers of Applications::ApplicationDeletedEvent 20afa1b7-8471-46d5-b661-abefecbeaa88
Traceback (most recent call last):
7: from (irb):19
6: from (irb):20:in `rescue in irb_binding'
5: from app/models/account.rb:144:in `smart_destroy'
4: from app/models/account/credit_card.rb:99:in `unstore_credit_card!'
3: from app/models/account/gateway.rb:65:in `provider_payment_gateway'
2: from app/models/account/gateway.rb:20:in `payment_gateway'
1: from app/models/account/gateway.rb:20:in `new'
ArgumentError (Missing required parameter: login)
Actually what breaks already is the call
Account.find(11111111111).provider_payment_gateway
Seems like we need to figure out a way to detect invalid gateways and decide what to do with them.