Class: Payola::DestroyCard

Inherits:
Object
  • Object
show all
Defined in:
app/services/payola/destroy_card.rb

Class Method Summary collapse

Class Method Details

.call(card_id, stripe_customer_id) ⇒ Object



3
4
5
6
7
# File 'app/services/payola/destroy_card.rb', line 3

def self.call(card_id, stripe_customer_id)
  secret_key = Payola.secret_key
  customer = Stripe::Customer.retrieve(stripe_customer_id, secret_key)
  customer.sources.retrieve(card_id).delete()
end