Skip to content

Instantly share code, notes, and snippets.

@pavloo
Created November 19, 2013 11:11
Show Gist options
  • Save pavloo/7543840 to your computer and use it in GitHub Desktop.
Save pavloo/7543840 to your computer and use it in GitHub Desktop.
createRegularPayment: (period) ->
payment = @get('store').createRecord('RegularPayment',
{
period: period.period
date: period.date
})
payment.save().then (regular) ->
console.log 'here'
template = @get('store').createRecord('paymentTemplate',
{
title: @get('paymentTitle')
field_value: @get('contractNumber')
payment_provider: @get('provider')
account: @get('selectedAccount')
amount: @get('amount')
currency: @get('selectedAccount.currency_iso_code')
regular_payment: regular
})
template.save()
@_resetAndRedirect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment