<commit_before>class PaymentController extends KDController

  DEFAULT_PROVIDER = "stripe"

  subscribe: (token, planTitle, planInterval, options, callback)->
    params          = {token, planTitle, planInterval}

    params.email    = options.email     if options.email
    params.provider = options.provider  or DEFAULT_PROVIDER

    @api().subscribe params, callback

  subscriptions: (callback)-> @api().subscriptions {}, callback

  invoices: (callback)-> @api().invoices {}, callback

  creditCard: (callback)-> @api().creditCard {}, callback

  updateCreditCard: (token, callback)->
    params          = {token}
    params.provider = options.provider  or DEFAULT_PROVIDER

    @api().updateCreditCard params, callback

  api:-> KD.remote.api.Payment


  ##########################################################

  fetchPaymentMethods: (callback) ->

    {dash}                 = Bongo
    methods                = null
    preferredPaymentMethod = null
    {appStorageController} = KD.singletons<commit_msg>payment: fix reference error<commit_after>class PaymentController extends KDController

  DEFAULT_PROVIDER = "stripe"

  subscribe: (token, planTitle, planInterval, options, callback)->
    params          = {token, planTitle, planInterval}

    params.email    = options.email     if options.email
    params.provider = options.provider  or DEFAULT_PROVIDER

    @api().subscribe params, callback

  subscriptions: (callback)-> @api().subscriptions {}, callback

  invoices: (callback)-> @api().invoices {}, callback

  creditCard: (callback)-> @api().creditCard {}, callback

  updateCreditCard: (token, callback)->
    params          = {token}
    params.provider = DEFAULT_PROVIDER

    @api().updateCreditCard params, callback

  api:-> KD.remote.api.Payment


  ##########################################################

  fetchPaymentMethods: (callback) ->

    {dash}                 = Bongo
    methods                = null
    preferredPaymentMethod = null
    {appStorageController} = KD.singletons
{'fraction_non_alphanumeric': 0.1605911330049261, 'fraction_numerical': 0.0, 'mean_word_length': 3.33974358974359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '967502', 'n_tokens_mistral': 554, 'n_tokens_neox': 505, 'n_words': 126}