MCPcopy Index your code
hub / github.com/codecombat/codecombat / renderPayPalButton

Method renderPayPalButton

app/views/core/SubscribeModal.js:112–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 }
111
112 renderPayPalButton () {
113 if (this.$('#paypal-button-container').length && !this.$('#paypal-button-container').children().length) {
114 const descriptionTranslationKey = 'subscribe.lifetime'
115 const discount = (this.basicProduct.get('amount') * 12) - this.lifetimeProduct.get('amount')
116 const discountString = (discount / 100).toFixed(2)
117 const description = $.i18n.t(descriptionTranslationKey).replace('{{discount}}', discountString)
118 return (payPal != null
119 ? payPal.makeButton({
120 buttonContainerID: '#paypal-button-container',
121 product: this.lifetimeProduct,
122 onPaymentStarted: this.onPayPalPaymentStarted,
123 onPaymentComplete: this.onPayPalPaymentComplete,
124 description
125 })
126 : undefined)
127 }
128 }
129
130 afterRender () {
131 super.afterRender()

Callers 1

renderMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected