Sha256: 1ff44f314b362c9d1c3cb54554b1519290adb4ceb5f5484d457c2a758777c058

Contents?: true

Size: 346 Bytes

Versions: 1

Compression:

Stored size: 346 Bytes

Contents

module Tang
  class DeleteCustomer
    def self.call(customer)
      if customer.stripe_id.present?
        begin
          c = Stripe::Customer.retrieve(customer.stripe_id)
          c.delete
        rescue Stripe::StripeError => e
          customer.errors[:base] << e.message
        end 
      end     
      return customer
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tang-0.0.1 app/services/tang/delete_customer.rb