app/assets/javascripts/spree/backend/payments/edit.js.coffee in spree_backend-2.4.7 vs app/assets/javascripts/spree/backend/payments/edit.js.coffee in spree_backend-2.4.8

- old
+ new

@@ -5,13 +5,13 @@ constructor: (id) -> @url = Spree.url("#{Spree.routes.payments_api(order_id)}/#{id}.json" + '?token=' + Spree.api_key) @json = $.getJSON @url.toString(), (data) => @data = data - if_pending: (callback) -> + if_editable: (callback) -> @json.done (data) -> - callback() if data.state is 'pending' + callback() if data.state in ['checkout', 'pending'] update: (attributes, success) -> jqXHR = $.ajax type: 'PUT' url: @url.toString() @@ -140,10 +140,10 @@ @normalize_amount: (amount) -> separator = Spree.translations.currency_separator amount.replace(///[^\d#{separator}]///g, '') - # Attach ShowPaymentView to each pending payment in the table + # Attach ShowPaymentView to each editable payment in the table $('.admin tr[data-hook=payments_row]').each -> $el = $(@) payment = new Payment($el.prop('id').match(/\d+$/)) - payment.if_pending -> new ShowPaymentView($el, payment) + payment.if_editable -> new ShowPaymentView($el, payment)