PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.0.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.0.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / build / index.js

index.js in Subscriptions for WooCommerce with Stripe Recurring Payments 2.0.0, at build/index.js

10 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";var e={20:(e,r,t)=>{var s=t(609),i=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function p(e,r,t){var s,n={},p=null,l=null;for(s in void 0!==t&&(p=""+t),void 0!==r.key&&(p=""+r.key),void 0!==r.ref&&(l=r.ref),r)o.call(r,s)&&!c.hasOwnProperty(s)&&(n[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===n[s]&&(n[s]=r[s]);return{$$typeof:i,type:e,key:p,ref:l,props:n,_owner:a.current}}r.Fragment=n,r.jsx=p,r.jsxs=p},609:e=>{e.exports=window.React},848:(e,r,t)=>{e.exports=t(20)}},r={};const t=window.wc.blocksCheckout,s=window.wc.blocksComponents,i=window.wp.i18n,n=window.wp.plugins,o=window.wc.priceFormat;var a=function t(s){var i=r[s];if(void 0!==i)return i.exports;var n=r[s]={exports:{}};return e[s](n,n.exports,t),n.exports}(848);(0,t.registerCheckoutFilters)("sdevs-subscription",{cartItemPrice:(e,r,t,s)=>{const{cartItem:n}=t,{totals:o}=n;return void 0===o?e:"0"===o.line_total?`<price/> ${(0,i.__)("Due Today","subscription")}`:e},subtotalPriceFormat:(e,r,t,s)=>{const{sdevs_subscription:n}=r,{sdevs_subscription:o}=r;if(n&&n.type){const e=n.type.charAt(0).toUpperCase()+n.type.slice(1),r=parseInt(n.max_no_payment,10),t=!isNaN(r)&&r>0?` x ${r}`:"",s=n.time&&n.time>1?n.time+"-":"";return"<price/> "+(0,i.__)("Every","subscription")+" "+s+e+t}return e}});const c=({cart:e,extensions:r})=>{if(0===Object.keys(r).length)return;const{cartTotals:n}=e,{sdevs_subscription:c}=r;if(0===c.length)return;const p=(0,o.getCurrencyFromPriceResponse)(n),l=Math.pow(10,p.minorUnit);return(0,a.jsx)(t.TotalsWrapper,{children:(0,a.jsx)(t.TotalsItem,{className:"wc-block-components-totals-footer-item",label:(0,i.__)("Recurring totals","subscription"),description:(0,a.jsx)("div",{style:{display:"grid"},children:c.map(e=>{const r=e.type.charAt(0).toUpperCase()+e.type.slice(1),t={currency:p.code,currency_symbol:p.symbol,decimal_separator:p.decimalSeparator,thousand_separator:p.thousandSeparator,precision:p.minorUnit,price_format:p.priceFormat},n=e=>(0,o.formatPrice)(Math.round(e*l),t),c=parseInt(e.recurring_limit,10)||0,m=e.time&&e.time>1?`${e.time}-${r}`:r;return(0,a.jsxs)("div",{style:{margin:"8px 0px 0px",float:"right"},children:[(0,a.jsxs)("div",{style:{fontSize:"18px"},children:[e.has_recurring_discount&&(0,a.jsx)("del",{"aria-hidden":"true",style:{marginRight:"6px",opacity:.6},children:n(e.full_price)}),(0,a.jsx)(s.FormattedMonetaryAmount,{currency:p,value:Math.round(e.price*l)}),(0,a.jsxs)("span",{class:"wpsubs-subscription-timing",children:[" / ",e.time&&e.time>1?e.time+"-"+r+" ":r]})]}),(0,a.jsx)("small",{children:e.description}),e.has_one_time_discount&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("small",{children:(0,i.sprintf)(
2 // translators: 1: amount paid today, 2: amount charged on each renewal.
3 // translators: 1: amount paid today, 2: amount charged on each renewal.
4 (0,i.__)("You pay %1$s today. %2$s will be charged from the next renewal.","subscription"),n(e.first_price),n(e.price))})]}),e.has_recurring_discount&&c>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("small",{children:(0,i.sprintf)(
5 // translators: 1: number of discounted payments, 2: full price charged afterwards.
6 // translators: 1: number of discounted payments, 2: full price charged afterwards.
7 (0,i.__)("Discount applies to your first %1$s payments. After that, %2$s.","subscription"),c,`${n(e.full_price)} / ${m}`)})]}),"yes"===e.can_user_cancel&&(""===e.max_no_payment||0===parseInt(e.max_no_payment))&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsxs)("small",{children:[(0,i.__)("You can cancel subscription at any time!","subscription")," "]})]}),parseInt(e.max_no_payment)>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),(0,a.jsx)("small",{children:(0,i.sprintf)(
8 // translators: 1: number of installments, 2: total amount.
9 // translators: 1: number of installments, 2: total amount.
10 (0,i.__)("This subscription will be billed in %1$s installments, for a total of %2$s.","subscription"),e.max_no_payment,n(null!=e.split_total?e.split_total:e.price*parseInt(e.max_no_payment)))})]})]})})})})})};(0,n.registerPlugin)("sdevs-subscription",{render:()=>(0,a.jsx)(t.ExperimentalOrderMeta,{children:(0,a.jsx)(c,{})}),scope:"woocommerce-checkout"})})();