"use strict";(self.webpackChunkrichie_education=self.webpackChunkrichie_education||[]).push([[59441],{59441:function(t,n,e){e.r(n),e(32390),e(10853),e(35054),e(55862);var r=e(16725),u=e(36601),c=e(3787);function a(t,n,e,r,u,c,a){try{var o=t[c](a),i=o.value}catch(t){return void e(t)}o.done?n(i):Promise.resolve(i).then(r,u)}function o(t){return function(){var n=this,e=arguments;return new Promise((function(r,u){var c=t.apply(n,e);function o(t){a(c,r,u,o,i,"next",t)}function i(t){a(c,r,u,o,i,"throw",t)}o(void 0)}))}}n.default=function(t){var n=t.url,e=t.payment_id,a=t.onSuccess,i=t.onError;return(0,c.b)(o(regeneratorRuntime.mark((function t(){var c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(n,{body:JSON.stringify({state:"success",id:e,type:"payment"}),headers:{"Content-Type":"application/json"},method:"POST"});case 3:if((c=t.sent).ok){t.next=6;break}throw new Error("Payment registration has failed with status ".concat(c.status," - ").concat(c.statusText));case 6:a(),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(0),(0,u.p)(t.t0),i(r.k.ERROR_DEFAULT);case 13:case"end":return t.stop()}}),t,null,[[0,9]])}))),[]),null}},3787:function(t,n,e){e.d(n,{b:function(){return u}});var r=e(89526),u=function(t,n){return(0,r.useEffect)((function(){var n=t();return function(){n.then((function(t){return t&&t()}))}}),n)}}}]);
//# sourceMappingURL=59441.7e8e1b24cfb893b4e2e3.index.js.map