How to use the payment.price function in payment

To help you get started, we’ve selected a few payment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sinfo / eventdeck / client / js / views / participation.js View on Github external
submitCallback: function (data) {
            var changedAttributes = _.compactObject(self.model.changedAttributes(data))

            if (data['payment.price'] || data['payment.date'] || data['payment.invoice'] || data['payment.status'] || data['payment.via']) {
              data.payment = {
                price: data['payment.price'] || self.model.payment && self.model.payment.price,
                date: data['payment.date'] || self.model.payment && self.model.payment.date,
                invoice: data['payment.invoice'] || self.model.payment && self.model.payment.invoice,
                status: data['payment.status'] || self.model.payment && self.model.payment.status,
                via: data['payment.via'] || self.model.payment && self.model.payment.via
              }

              delete data['payment.price']
              delete data['payment.date']
              delete data['payment.invoice']
              delete data['payment.status']
              delete data['payment.via']

              if (!changedAttributes) {
                changedAttributes = {}
              }
github sinfo / eventdeck / client / js / views / participation.js View on Github external
submitCallback: function (data) {
            var changedAttributes = _.compactObject(self.model.changedAttributes(data))

            if (data['payment.price'] || data['payment.date'] || data['payment.invoice'] || data['payment.status'] || data['payment.via']) {
              data.payment = {
                price: data['payment.price'] || self.model.payment && self.model.payment.price,
                date: data['payment.date'] || self.model.payment && self.model.payment.date,
                invoice: data['payment.invoice'] || self.model.payment && self.model.payment.invoice,
                status: data['payment.status'] || self.model.payment && self.model.payment.status,
                via: data['payment.via'] || self.model.payment && self.model.payment.via
              }

              delete data['payment.price']
              delete data['payment.date']
              delete data['payment.invoice']
              delete data['payment.status']
              delete data['payment.via']

              if (!changedAttributes) {
                changedAttributes = {}
              }

              changedAttributes.payment = data.payment
            }

            log('data', data, changedAttributes)

            if (!changedAttributes) {
              return self.parent.handleViewClick()

payment

A general purpose library for building credit card forms, validating inputs and formatting numbers. Base on jquery.payment by @stripe, but without the jQuery.

MIT
Latest version published 5 months ago

Package Health Score

71 / 100
Full package analysis