-
Notifications
You must be signed in to change notification settings - Fork 0
/
atoms.app.appnima.payment.js
1 lines (1 loc) · 1.84 KB
/
atoms.app.appnima.payment.js
1
(function(){"use strict";var __hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};Atoms.Organism.AppnimaCreditCard=function(_super){function AppnimaCreditCard(){return AppnimaCreditCard.__super__.constructor.apply(this,arguments)}return __extends(AppnimaCreditCard,_super),AppnimaCreditCard["extends"]=!0,AppnimaCreditCard["default"]={children:[{"Organism.Header":{id:"header",children:[{"Atom.Icon":{icon:"ios7-checkmark-outline"}},{"Atom.Heading":{id:"title"}}]}},{"Organism.Section":{id:"section",children:[{"Molecule.Form":{id:"cards",children:[{"Atom.Select":{}},{"Atom.Button":{style:"fluid accept",text:"Payment"}}]}},{"Molecule.Form":{id:"card"}}]}},{"Organism.Footer":{}}]},AppnimaCreditCard.events=["error"],AppnimaCreditCard.prototype.render=function(){return AppnimaCreditCard.__super__.render.apply(this,arguments),null==window.Appnima?alert("ERROR: App/nima library not exists."):void 0},AppnimaCreditCard.prototype.purchase=function(amount,description,provider){var _ref,_ref1;return null==amount&&(amount=0),null==provider&&(provider=0),window.Appnima.User.session(),null!=(null!=(_ref=window.Appnima)?_ref.key:void 0)&&null!=(null!=(_ref1=window.Appnima)?_ref1.token:void 0)?(__.Dialog.Loading.show(),Appnima.Payments.getCreditCards().then(function(_this){return function(error,result){var creditcards;return __.Dialog.Loading.hide(),creditcards=result.creditcards,null!=description&&_this.header.title.el.html(description),_this.section.cards.el.show(),_this.section.card.el.hide(),_this.show()}}(this))):alert("ERROR: Unknown App/nima key or token")},AppnimaCreditCard}(Atoms.Organism.Dialog),new Atoms.Organism.AppnimaCreditCard}).call(this);