https://www.proprietariodireto.com.br/_next/static/chunks/pages/payment-test-4d27c1f8d223839ee21d.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[886],{40121:function(r,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var e=n(30266),u=n(809),a=n.n(u),c=n(67294),s=n(39957),i=n(86664),o=n(26026),p=n(85893),f=(0,s.J)("pk_live_51PpvwnLiWPOeHrmIxRaaroK5Q5hIuqXX1IzEvnfB4919LK4nRmrfVcv3Xd1e0SGE5gfxbjgX228mLMRwrKHCxIbX00Hpasli0y"),l={style:{base:{color:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},hidePostalCode:!0};function v(){var r=(0,i.useStripe)(),t=(0,i.useElements)(),n=(0,c.useState)("392"),u=n[0],s=n[1],f=(0,c.useState)(null),v=f[0],h=f[1],d=(0,c.useState)(!1),b=d[0],m=d[1],w=function(){var n=(0,e.Z)(a().mark((function n(e){var c,s,p,f,l,v,d;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.preventDefault(),m(!0),c=t.getElement(i.CardElement),n.next=5,r.createPaymentMethod({type:"card",card:c});case 5:if(s=n.sent,p=s.error,f=s.paymentMethod,!p){n.next=12;break}return h(p.message),m(!1),n.abrupt("return");case 12:return l={plan_id:u,payment_method:"credit_card",payment_method_id:f.id,accept_quick_proposal:"0"},n.next=15,(0,o.$u)(l).then((function(r){console.log(r)}));case 15:return n.next=17,r.confirmCardPayment(clientSecret);case 17:v=n.sent,(d=v.error)?h(d.message):alert("Assinatura criada com sucesso!"),m(!1);case 21:case"end":return n.stop()}}),n)})));return function(r){return n.apply(this,arguments)}}();return(0,p.jsxs)("form",{onSubmit:w,children:[(0,p.jsx)("label",{children:"Plano"}),(0,p.jsxs)("select",{value:u,onChange:function(r){return s(r.target.value)},children:[(0,p.jsx)("option",{value:"392",children:"Bronze - Mensal"}),(0,p.jsx)("option",{value:"silver",children:"Prata - Trimestral"}),(0,p.jsx)("option",{value:"gold",children:"Ouro - Semestral"})]}),(0,p.jsx)(i.CardElement,{options:l}),(0,p.jsx)("button",{type:"submit",disabled:!r||b,children:b?"Processando...":"Assinar"}),v&&(0,p.jsx)("div",{children:v})]})}function h(){return(0,p.jsx)(i.Elements,{stripe:f,children:(0,p.jsx)(v,{})})}},26026:function(r,t,n){"use strict";n.d(t,{$g:function(){return s},Pu:function(){return i},C_:function(){return o},GH:function(){return p},tY:function(){return f},Go:function(){return l},nA:function(){return v},nh:function(){return h},Gq:function(){return d},$u:function(){return b},BF:function(){return m},QT:function(){return w}});var e=n(30266),u=n(809),a=n.n(u),c=n(67923),s=function(){var r=(0,e.Z)(a().mark((function r(t){var n,e,u=arguments;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:null,r.prev=1,e=n?"?type=".concat(n):"",r.abrupt("return",c.Z.get("/subscriber/info/"+t+e));case 6:return r.prev=6,r.t0=r.catch(1),r.abrupt("return",r.t0);case 9:case"end":return r.stop()}}),r,null,[[1,6]])})));return function(t){return r.apply(this,arguments)}}(),i=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.get("/subscriber/summary/"+t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}(),o=function(){var r=(0,e.Z)(a().mark((function r(){var t,n=arguments;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r.prev=1,r.abrupt("return",c.Z.post("subscription/reactivate",t));case 5:return r.prev=5,r.t0=r.catch(1),r.abrupt("return",r.t0);case 8:case"end":return r.stop()}}),r,null,[[1,5]])})));return function(){return r.apply(this,arguments)}}(),p=function(){var r=(0,e.Z)(a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.get("/subscribers/info-for-thank-you"));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(){return r.apply(this,arguments)}}(),f=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.get("/subscribers/getsubscribers/"+t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}(),l=function(){var r=(0,e.Z)(a().mark((function r(){var t,n=arguments;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r.prev=1,r.abrupt("return",c.Z.post("subscription/reactivate",t));case 5:return r.prev=5,r.t0=r.catch(1),r.abrupt("return",r.t0);case 8:case"end":return r.stop()}}),r,null,[[1,5]])})));return function(){return r.apply(this,arguments)}}(),v=function(){var r=(0,e.Z)(a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.get("payment-gateway"));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(){return r.apply(this,arguments)}}(),h=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.post("subscription/stripe/confirm",t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}(),d=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.post("subscription/ne
1w",t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}(),b=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.post("subscription-stripe/new",t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}(),m=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.post("/subscribers/pix",t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}(),w=function(){var r=(0,e.Z)(a().mark((function r(t){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.abrupt("return",c.Z.get("/subscribers/pix/status/"+t));case 4:return r.prev=4,r.t0=r.catch(0),r.abrupt("return",r.t0);case 7:case"end":return r.stop()}}),r,null,[[0,4]])})));return function(t){return r.apply(this,arguments)}}()},88835:function(r,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment-test",function(){return n(40121)}])}},function(r){r.O(0,[6664,9774,2888,179],(function(){return t=88835,r(r.s=t);var t}));var t=r.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.