@tiledesk/tiledesk-server 2.7.26 → 2.7.27
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +5 -0
- package/app.js +1 -1
- package/config/labels/widget.json +31 -0
- package/event/emailEvent.js +58 -2
- package/models/faq.js +5 -0
- package/models/kb_setting.js +38 -3
- package/package.json +4 -3
- package/pubmodules/s/index.js +2 -2
- package/pubmodules/s/models/subscription-payment.js +2 -2
- package/pubmodules/s/stripe/index.js +2 -2
- package/routes/kb.js +952 -542
- package/routes/openai.js +3 -3
- package/routes/project.js +21 -6
- package/routes/quotes.js +13 -4
- package/services/QuoteManager.js +163 -16
- package/services/emailService.js +53 -1
- package/services/requestService.js +16 -5
- package/template/email/beenInvitedNewUser.html +221 -216
- package/template/email/checkpointReachedEmail.html +92 -0
- package/test/kbRoute.js +1186 -311
- package/test/mock/projectMock.js +2 -3
- package/test/openaiRoute.js +3 -0
- package/test/requestService.js +3 -0
- package/utils/aiUtils.js +41 -5
@@ -1,2 +1,2 @@
|
|
1
|
-
var _0x3a1b=['stripe\x20sig:\x20','»»»\x20»»»\x20\x20update\x20customer\x20-\x20cc\x20from\x20body\x20','/stripesubs/:subscriptionid','»»»»\x20stripe\x20apiKey:\x20','***\x20***\x20customer.subscription.deleted\x20','findOne','split','/updatesubscription','type','log','***\x20***\x20invoice.payment_succeeded\x20-\x20linesNum:\x20','save','»»»\x20»»»\x20cancelsubscription\x20projectid','subscription_create','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20find\x20Project\x20','--\x20>\x20subscription\x20get\x20by\x20id\x20from\x20stripe\x20','customer','subscription','stripe\x20client_reference_id','object','--\x20>\x20checkoutSession\x20get\x20by\x20id\x20from\x20stripe\x20','stripe\x20user_id:','--\x20>\x20updatesubscription\x20\x20project\x20','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20-\x20err\x20','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile\x20>\x20name','get','client_reference_id','saveOnDB\x20plan_name','subscriptionId','***\x20***\x20invoice.payment_succeeded\x20-\x20BILLING\x20REASON\x20','paymentMethods','error','get\x20PaymentMethods\x20list\x20>\x20paymentMethods\x20>\x20paymentMethods.data\x20','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile','rawBody','subscriptions','»»»\x20»»»\x20cancelsubscription\x20userid','express','ObjectId','current_period_start','expiration_date_year','***\x20***\x20invoice.payment_succeeded\x20-\x20index:\x20','--\x20>\x20cancelsubscription\x20\x20err\x20','stripe\x20apiKey','customer.subscription.deleted\x20subscriptionPayment\x20user\x20id:\x20','stripe\x20seats_numAsString:\x20','/payment_methods/:customerid','del','get\x20PaymentMethods\x20list\x20>\x20paymentMethods\x20','forEach','data','message','status','asc','list','---\x20>\x20ERROR\x20','exec','unix','basic','stripe\x20project_id:\x20','userid','projectid','!!!!!!!!\x20HI\x20!!!!!!!!\x20checkout.session.completed','total_count','stripe','find','subscriptionid','***\x20***\x20checkout.session.completed\x20-\x20getSubscription\x20***\x20end\x20***\x20:\x20','YYYY-MM-DDTHH:mm:ss.SSS','credit_card_cvc','env','then','saveFirstInvoicePaymentSucceeded\x20subscriptionid','default_payment_method','***\x20***\x20checkout.session.completed\x20-\x20getSubscritionById\x20***\x20start\x20***\x20:\x20','--\x20>\x20checkoutSession\x20params.sessionid\x20','jwt','***\x20***\x20checkout.session.completed\x20-\x20getSubscritionById\x20err\x20','Error\x20saving\x20object.','current_period_end','info','»»»\x20»»»\x20\x20paymentMethod\x20attached\x20','free','Sandbox','profile','Router','catch','sessionid','send','/webhook','***\x20***\x20!!!!!!!!!!!!!!!!!!!!!!\x20checkout.session.completed\x20-\x20subscription\x20ID:\x20','json','authenticate','customerid','debug','mongoose','--\x20>\x20subscription\x20get\x20by\x20id\x20from\x20stripe\x20\x20err\x20','--\x20>\x20get\x20customer\x20from\x20db\x20>\x20customer\x20+\x20paymentMethods\x20','../../../middleware/valid-token','put','moment','invoice.payment_succeeded','****\x20Stripe\x20error\x20constructEvent:\x20','Types','customer.subscription.deleted','saveOnDB\x20seats_num','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile\x20>\x20agents\x20typeof','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20subsptn_payment:\x20','--\x20>\x20checkoutSession\x20get\x20by\x20id\x20from\x20stripe\x20\x20err\x20','params','»»»\x20»»»\x20get\x20customer\x20from\x20db\x20','»»»\x20»»»\x20\x20paymentMethod\x20create\x20\x20error\x20','constructEvent','../../../config/winston','exports','credit_card_num','body','savedSubscriptionPayment\x20','\x20!!!!!!!!\x20HI\x20!!!!!!!!!!!\x20customer.subscription.deleted','../models/subscription-payment','»»»\x20»»»\x20updatesubscription\x20projectid','--\x20>\x20cancelsubscription\x20Error\x20getting\x20project\x20','expiration_date_month','\x20!!!!!!!!\x20HI\x20!!!!!!!!\x20invoice.payment_succeeded','--\x20>\x20GET\x20SUBSCRIPTION\x20PAYMENTS\x20ERRORt\x20','savedSubscriptionPayment\x20>>\x20','create','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20subsptn_payment\x20>\x20project_id:\x20','webhooks','get\x20PaymentMethods\x20list\x20req.params\x20>\x20customer_id\x20','stripe\x20apiSecretKey','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20subsptn_payment\x20typeof\x20subsptn_payment:\x20','sessions','agents','attach','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20','/:subscriptionid','PAYMENT_STRIPE_API_SECRET_KEY','\x20typeof\x20','../../../middleware/passport','»»»»\x20stripe\x20endpointSecret:\x20','user_id','typeof\x20','update','stripe\x20checkout.session.completed','post','sort','format','raw','***\x20***\x20invoice.payment_succeeded\x20-\x20subscription\x20ID:\x20','customers','payment','checkout.session.completed','***\x20***\x20invoice.payment_succeeded\x20-\x20start:\x20','--\x20>\x20subscription\x20get\x20by\x20id\x20freq.params.subscriptionid\x20','***\x20***\x20subscription\x20ID\x20','PAYMENT_STRIPE_SECRET','body-parser','name','period'];(function(_0x335769,_0x3a1b3f){var _0x1d34d4=function(_0x31ddf7){while(--_0x31ddf7){_0x335769['push'](_0x335769['shift']());}};_0x1d34d4(++_0x3a1b3f);}(_0x3a1b,0x13b));var _0x1d34=function(_0x335769,_0x3a1b3f){_0x335769=_0x335769-0x0;var _0x1d34d4=_0x3a1b[_0x335769];return _0x1d34d4;};var express=require(_0x1d34('0x2a'));var router=express[_0x1d34('0x5a')]();var winston=require(_0x1d34('0x76'));var Project=require('../../../models/project');var SubscriptionPayment=require(_0x1d34('0x7c'));var moment=require(_0x1d34('0x69'));var mongoose=require(_0x1d34('0x64'));var passport=require('passport');require(_0x1d34('0x90'))(passport);var validtoken=require(_0x1d34('0x67'));const apiKey=process[_0x1d34('0x4b')]['PAYMENT_STRIPE_APIKEY'];winston[_0x1d34('0x63')](_0x1d34('0x30')+apiKey);const stripe=require('stripe')(apiKey);const endpointSecret=process['env'][_0x1d34('0x1')];winston[_0x1d34('0x63')]('stripe\x20endpointSecret'+endpointSecret);const apiSecretKey=process[_0x1d34('0x4b')][_0x1d34('0x8e')];winston['debug'](_0x1d34('0x87')+apiSecretKey);const bodyParser=require(_0x1d34('0x2'));router['post'](_0x1d34('0x5e'),bodyParser[_0x1d34('0x99')]({'type':'application/json'}),function(_0x228c69,_0x32c0cf){winston[_0x1d34('0x63')](_0x1d34('0x91')+endpointSecret);winston['debug'](_0x1d34('0x8')+apiKey);winston[_0x1d34('0x63')](_0x1d34('0x87')+apiSecretKey);const _0x9f503=_0x228c69['headers']['stripe-signature'];winston['debug'](_0x1d34('0x5'),_0x9f503);let _0x881450;try{_0x881450=stripe[_0x1d34('0x85')][_0x1d34('0x75')](_0x228c69[_0x1d34('0x27')],_0x9f503,endpointSecret);}catch(_0xbe4dfa){winston[_0x1d34('0x24')](_0x1d34('0x6b'),_0xbe4dfa[_0x1d34('0x38')]);return _0x32c0cf[_0x1d34('0x39')](0x190)[_0x1d34('0x5d')]('Webhook\x20Error:\x20'+_0xbe4dfa[_0x1d34('0x38')]);}if(_0x881450[_0x1d34('0xd')]===_0x1d34('0x9d')){winston[_0x1d34('0x63')](_0x1d34('0x43'));const _0x6bcc05=_0x881450['data'][_0x1d34('0x18')];winston[_0x1d34('0x55')](_0x1d34('0x95'),_0x6bcc05);var _0x6d6211=_0x6bcc05[_0x1d34('0x1f')];winston[_0x1d34('0x55')](_0x1d34('0x17'),_0x6d6211);var _0x1f16e9=_0x6d6211['split']('_')[0x0];winston[_0x1d34('0x55')](_0x1d34('0x1a')+_0x1f16e9);var _0x16fef1=_0x6d6211['split']('_')[0x1];winston['info'](_0x1d34('0x40')+_0x16fef1);var _0x4695f7=_0x6d6211['split']('_')[0x2];winston[_0x1d34('0x55')]('stripe\x20plan_name:\x20'+_0x4695f7);var _0x31188b=_0x6d6211[_0x1d34('0xb')]('_')[0x3];winston[_0x1d34('0x55')]('stripe\x20seats_num:\x20'+_0x31188b+_0x1d34('0x93'),typeof _0x31188b);var _0x1dc5aa=Number(_0x31188b);winston['info'](_0x1d34('0x32')+_0x1dc5aa+_0x1d34('0x8f'),typeof _0x1dc5aa);var _0x10f817=_0x881450[_0x1d34('0x37')][_0x1d34('0x18')][_0x1d34('0x16')];winston[_0x1d34('0x55')](_0x1d34('0x5f'),_0x10f817);getSubscritionById(_0x10f817)[_0x1d34('0x4c')](function(_0x11a9de){var _0x1d1af5=_0x11a9de['object'];winston[_0x1d34('0x55')]('***\x20***\x20checkout.session.completed\x20-\x20getSubscritionById\x20subscr\x20object_type:\x20',_0x1d1af5);var _0x4beb50=moment[_0x1d34('0x3e')](_0x11a9de[_0x1d34('0x2c')])['format']('YYYY-MM-DDTHH:mm:ss.SSS');winston[_0x1d34('0x55')](_0x1d34('0x4f'),_0x4beb50);var _0x1cb09a=moment['unix'](_0x11a9de[_0x1d34('0x54')])['format']('YYYY-MM-DDTHH:mm:ss.SSS');winston[_0x1d34('0x55')](_0x1d34('0x48'),_0x1cb09a);var _0x49714d={'profile':{'name':_0x4695f7,'type':_0x1d34('0x9c'),'subscription_creation_date':_0x4beb50,'subStart':_0x4beb50,'subEnd':_0x1cb09a,'subscriptionId':_0x10f817,'last_stripe_event':_0x881450[_0x1d34('0xd')],'agents':_0x1dc5aa}};updateProjectProfile(_0x16fef1,_0x49714d,_0x1d34('0x9d'));saveOnDB(_0x10f817,_0x16fef1,_0x11a9de,_0x1f16e9,_0x881450[_0x1d34('0xd')],_0x4695f7,_0x1dc5aa);})[_0x1d34('0x5b')](function(_0x3a2f63){winston[_0x1d34('0x24')](_0x1d34('0x52'),_0x3a2f63);});}if(_0x881450['type']==='invoice.payment_succeeded'){winston[_0x1d34('0x55')](_0x1d34('0x80'));winston[_0x1d34('0x55')](_0x1d34('0x22'),_0x881450[_0x1d34('0x37')][_0x1d34('0x18')]['billing_reason']);var _0x17e0e1=_0x881450[_0x1d34('0x37')][_0x1d34('0x18')]['lines'][_0x1d34('0x44')];winston[_0x1d34('0x55')](_0x1d34('0xf'),_0x17e0e1);var _0x4139f7=_0x17e0e1-0x1;winston[_0x1d34('0x55')](_0x1d34('0x2e'),_0x4139f7);var _0x349d0a=moment[_0x1d34('0x3e')](_0x881450[_0x1d34('0x37')][_0x1d34('0x18')]['lines'][_0x1d34('0x37')][_0x4139f7][_0x1d34('0x4')]['start'])[_0x1d34('0x98')](_0x1d34('0x49'));winston[_0x1d34('0x55')](_0x1d34('0x9e'),_0x349d0a);var _0x2923e5=moment[_0x1d34('0x3e')](_0x881450[_0x1d34('0x37')]['object']['lines']['data'][_0x4139f7][_0x1d34('0x4')]['end'])[_0x1d34('0x98')](_0x1d34('0x49'));winston[_0x1d34('0x55')]('***\x20***\x20invoice.payment_succeeded\x20-\x20end:\x20',_0x2923e5);var _0x10f817=_0x881450[_0x1d34('0x37')][_0x1d34('0x18')]['subscription'];winston['info']('***\x20***\x20invoice.payment_succeeded\x20-\x20subscription\x20ID:\x20',_0x10f817);if(_0x10f817==null){_0x10f817=_0x881450[_0x1d34('0x37')]['object']['lines'][_0x1d34('0x37')][0x0][_0x1d34('0x16')];winston[_0x1d34('0x55')](_0x1d34('0x9a'),_0x10f817);}if(_0x881450[_0x1d34('0x37')]['object']['billing_reason']!=='subscription_create'){getSubByIdAndCheckoutSessionCompletedEvnt(_0x10f817)[_0x1d34('0x4c')](function(_0x328248){winston[_0x1d34('0x55')](_0x1d34('0x70'),_0x328248);winston[_0x1d34('0x55')](_0x1d34('0x88'),typeof _0x328248);if(_0x328248){var _0x43a0a5=_0x328248['project_id'];winston['info'](_0x1d34('0x84'),_0x43a0a5);Project['findOne']({'_id':_0x43a0a5},function(_0x25f30e,_0x4a78cf){if(_0x25f30e){winston[_0x1d34('0x55')](_0x1d34('0x13'),_0x25f30e);return _0x25f30e;}if(_0x4a78cf){winston[_0x1d34('0x55')](_0x1d34('0x8c'),_0x4a78cf);winston[_0x1d34('0x55')](_0x1d34('0x26'),_0x4a78cf[_0x1d34('0x59')]);var _0x232cf9=_0x4a78cf['profile'][_0x1d34('0x8a')];winston[_0x1d34('0x55')]('***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile\x20>\x20agents',_0x232cf9);var _0x3025d6=_0x4a78cf[_0x1d34('0x59')][_0x1d34('0x3')];winston['info'](_0x1d34('0x6f'),typeof _0x232cf9);var _0x34df62=_0x328248[_0x1d34('0x92')];winston[_0x1d34('0x55')](_0x1d34('0x1d'),_0x3025d6);var _0x100707={'profile':{'name':_0x3025d6,'type':'payment','subStart':_0x349d0a,'subEnd':_0x2923e5,'subscriptionId':_0x10f817,'last_stripe_event':_0x881450[_0x1d34('0xd')],'agents':_0x232cf9}};updateProjectProfile(_0x43a0a5,_0x100707,_0x1d34('0x6a'));saveOnDB(_0x10f817,_0x43a0a5,_0x881450,_0x34df62,_0x881450[_0x1d34('0xd')],_0x3025d6,_0x232cf9);}});}})[_0x1d34('0x5b')](function(_0x44b423){winston['error'](_0x1d34('0x1c'),_0x44b423);});}else if(_0x881450[_0x1d34('0x37')]['object']['billing_reason']===_0x1d34('0x12')){console[_0x1d34('0xe')]('USECASE\x20\x20invoice.payment_succeeded\x20\x20billing_reason\x20subscription_create\x20');saveFirstInvoicePaymentSucceeded(_0x10f817,_0x881450,_0x881450['type']);}}if(_0x881450[_0x1d34('0xd')]===_0x1d34('0x6d')){winston['info'](_0x1d34('0x7b'));winston[_0x1d34('0x55')]('customer.subscription.deleted\x20event\x20',_0x881450);var _0x10f817=_0x881450[_0x1d34('0x37')][_0x1d34('0x18')]['id'];winston[_0x1d34('0x55')](_0x1d34('0x0'),_0x10f817);getSubByIdAndCheckoutSessionCompletedEvnt(_0x10f817)['then'](function(_0x2f9727){winston['info']('***\x20***\x20»»»\x20»»»\x20customer.subscription.deleted\x20subscriptionPayment\x20',_0x2f9727);if(_0x2f9727){var _0x3632b4=_0x2f9727['project_id'];winston[_0x1d34('0x55')]('customer.subscription.deleted\x20subscriptionPayment\x20project\x20id:\x20',_0x3632b4);var _0x1aaef2=_0x2f9727[_0x1d34('0x92')];winston['info'](_0x1d34('0x31'),_0x1aaef2);}var _0xd9b0e8={'profile':{'subscriptionId':_0x10f817,'name':_0x1d34('0x58'),'type':_0x1d34('0x57'),'agents':0x1,'last_stripe_event':_0x881450[_0x1d34('0xd')]}};updateProjectProfile(_0x3632b4,_0xd9b0e8,'subscription.deleted');saveOnDB(_0x10f817,_0x3632b4,_0x881450[_0x1d34('0x37')][_0x1d34('0x18')],_0x1aaef2,_0x881450[_0x1d34('0xd')],_0x4695f7,0x1);})[_0x1d34('0x5b')](function(_0x52eab3){winston['error'](_0x1d34('0x9'),_0x52eab3);});}_0x32c0cf[_0x1d34('0x60')]({'received':!![]});});function getSubByIdAndCheckoutSessionCompletedEvnt(_0x254f0d){return new Promise(function(_0x25d18a,_0xbdf96a){SubscriptionPayment[_0x1d34('0xa')]({'subscription_id':_0x254f0d,'stripe_event':'checkout.session.completed'},function(_0x4c2784,_0x16cb92){if(_0x4c2784)_0xbdf96a(_0x4c2784);var _0x2c37ed=_0x16cb92;_0x25d18a(_0x2c37ed);});});};function getSubscritionById(_0x25f4e7){return new Promise(function(_0x11f853,_0x289408){const _0x5b4003=require(_0x1d34('0x45'))(apiSecretKey);_0x5b4003[_0x1d34('0x28')]['retrieve'](_0x25f4e7,function(_0x51749c,_0x2a29af){if(_0x51749c)_0x289408(_0x51749c);var _0x2a29af=_0x2a29af;_0x11f853(_0x2a29af);});});};function updateProjectProfile(_0x5e5793,_0x161921,_0x41ae89){Project['findByIdAndUpdate'](_0x5e5793,_0x161921,{'new':!![],'upsert':!![]},function(_0x5be7e3,_0x3c3cc6){if(_0x5be7e3){winston[_0x1d34('0x24')]('updateProjectProfile\x20Error\x20',_0x5be7e3);}else{winston['debug'](_0x3c3cc6);}});}function saveOnDB(_0x3dbc43,_0x3b64f7,_0x468017,_0x24be8c,_0x507043,_0x64e559,_0x55c91b){winston['info'](_0x1d34('0x20'),_0x64e559);winston[_0x1d34('0x55')](_0x1d34('0x6e'),_0x55c91b);var _0x3fbf6e=new SubscriptionPayment({'_id':new mongoose[(_0x1d34('0x6c'))][(_0x1d34('0x2b'))](),'subscription_id':_0x3dbc43,'project_id':_0x3b64f7,'user_id':_0x24be8c,'stripe_event':_0x507043,'plan_name':_0x64e559,'agents':_0x55c91b,'object':_0x468017});_0x3fbf6e[_0x1d34('0x10')](function(_0x4b178a,_0x5857ef){if(_0x4b178a){winston[_0x1d34('0x24')](_0x1d34('0x3c'),_0x4b178a);return res[_0x1d34('0x39')](0x1f4)['send']({'success':![],'msg':_0x1d34('0x53')});}winston[_0x1d34('0x55')](_0x1d34('0x7a'),_0x5857ef);});}function saveFirstInvoicePaymentSucceeded(_0x422e68,_0x330455,_0x149369){console[_0x1d34('0xe')](_0x1d34('0x4d'),_0x422e68);console['log']('saveFirstInvoicePaymentSucceeded\x20stripe_event',_0x149369);var _0x147e02=new SubscriptionPayment({'_id':new mongoose[(_0x1d34('0x6c'))][(_0x1d34('0x2b'))](),'subscription_id':_0x422e68,'stripe_event':_0x149369,'object':_0x330455});_0x147e02[_0x1d34('0x10')](function(_0x5d8b38,_0xe7648b){if(_0x5d8b38){winston[_0x1d34('0x24')](_0x1d34('0x3c'),_0x5d8b38);return res[_0x1d34('0x39')](0x1f4)['send']({'success':![],'msg':_0x1d34('0x53')});}console[_0x1d34('0xe')](_0x1d34('0x82'),_0xe7648b);});}router[_0x1d34('0x68')]('/cancelsubscription',[passport[_0x1d34('0x61')]([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],function(_0x355564,_0x23f28f){var _0xf0deb1=_0x355564['body'][_0x1d34('0x42')];var _0xc6a178=_0x355564[_0x1d34('0x79')][_0x1d34('0x41')];winston[_0x1d34('0x55')](_0x1d34('0x11'),_0xf0deb1);winston[_0x1d34('0x55')](_0x1d34('0x29'),_0xc6a178);Project[_0x1d34('0xa')]({'_id':_0xf0deb1},function(_0x16bcf3,_0x3188bf){if(_0x16bcf3){winston[_0x1d34('0x24')](_0x1d34('0x7e'),_0x16bcf3);return _0x16bcf3;}if(_0x3188bf){winston['info']('--\x20>\x20cancelsubscription\x20\x20project\x20',_0x3188bf);var _0x252950=_0x3188bf[_0x1d34('0x59')]['subscriptionId'];const _0x445966=require('stripe')(apiSecretKey);_0x445966[_0x1d34('0x28')][_0x1d34('0x34')](_0x252950,function(_0x539cba,_0x31dc30){if(_0x539cba){winston[_0x1d34('0x24')](_0x1d34('0x2f'),_0x539cba);return _0x23f28f[_0x1d34('0x39')](0x1f4)['send']({'success':![],'msg':_0x539cba});}winston['info']('--\x20>\x20cancelsubscription\x20confirmation\x20',_0x31dc30);_0x23f28f[_0x1d34('0x60')](_0x31dc30);});}});});router[_0x1d34('0x68')](_0x1d34('0xc'),[passport['authenticate']([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],function(_0x568682,_0x55b15d){var _0x405c9b=_0x568682[_0x1d34('0x79')][_0x1d34('0x42')];var _0x98bb63=_0x568682['body'][_0x1d34('0x41')];var _0x560c01=_0x568682[_0x1d34('0x79')]['price'];winston[_0x1d34('0x55')](_0x1d34('0x7d'),_0x405c9b);winston[_0x1d34('0x55')]('»»»\x20»»»\x20updatesubscription\x20userid',_0x98bb63);winston[_0x1d34('0x55')]('»»»\x20»»»\x20updatesubscription\x20price',_0x560c01);const _0xcc0791=require(_0x1d34('0x45'))(apiSecretKey);Project[_0x1d34('0xa')]({'_id':_0x405c9b},function(_0xead730,_0xdccd43){if(_0xead730){winston['error']('--\x20>\x20updatesubscription\x20Error\x20getting\x20project\x20',_0xead730);return _0xead730;}if(_0xdccd43){winston['info'](_0x1d34('0x1b'),_0xdccd43);var _0x39e747=_0xdccd43['profile'][_0x1d34('0x21')];_0xcc0791[_0x1d34('0x28')]['update'](_0x39e747);}});});router[_0x1d34('0x1e')](_0x1d34('0x8d'),[passport[_0x1d34('0x61')](['basic',_0x1d34('0x51')],{'session':![]}),validtoken],function(_0x1e9c90,_0x523fdc){SubscriptionPayment['find']({'subscription_id':_0x1e9c90[_0x1d34('0x72')]['subscriptionid']})[_0x1d34('0x97')]({'object.created':_0x1d34('0x3a')})[_0x1d34('0x3d')](function(_0x3c4003,_0x1b735a){if(_0x3c4003){winston[_0x1d34('0x24')](_0x1d34('0x81'),project);return _0x523fdc[_0x1d34('0x39')](0x1f4)[_0x1d34('0x5d')]({'success':![],'msg':_0x3c4003});}_0x523fdc[_0x1d34('0x60')](_0x1b735a);});});router[_0x1d34('0x1e')](_0x1d34('0x7'),[passport[_0x1d34('0x61')]([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],function(_0x3ff1c2,_0x56fca5){winston[_0x1d34('0x55')](_0x1d34('0x9f'),_0x3ff1c2[_0x1d34('0x72')][_0x1d34('0x47')]);var _0xa884a9=require('stripe')(apiSecretKey);_0xa884a9[_0x1d34('0x28')]['retrieve'](_0x3ff1c2['params']['subscriptionid'],function(_0x410d5b,_0x3250c9){if(_0x410d5b){winston[_0x1d34('0x24')](_0x1d34('0x65'),_0x410d5b);return _0x56fca5[_0x1d34('0x39')](0x1f4)[_0x1d34('0x5d')]({'success':![],'msg':_0x410d5b});}winston[_0x1d34('0x55')](_0x1d34('0x14'),_0x3250c9);_0x56fca5[_0x1d34('0x60')](_0x3250c9);});});router['get']('/checkoutSession/:sessionid',[passport[_0x1d34('0x61')]([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],function(_0xabd064,_0x577ded){winston[_0x1d34('0x55')](_0x1d34('0x50'),_0xabd064[_0x1d34('0x72')][_0x1d34('0x5c')]);var _0x145855=require(_0x1d34('0x45'))(apiSecretKey);_0x145855['checkout'][_0x1d34('0x89')]['retrieve'](_0xabd064[_0x1d34('0x72')]['sessionid'],function(_0x1cf4c6,_0x4aac59){if(_0x1cf4c6){winston[_0x1d34('0x55')](_0x1d34('0x71'),_0x1cf4c6);return _0x577ded['status'](0x1f4)[_0x1d34('0x5d')]({'success':![],'msg':_0x1cf4c6});}winston[_0x1d34('0x55')](_0x1d34('0x19'),_0x4aac59);_0x577ded[_0x1d34('0x60')](_0x4aac59);});});router['get']('/customer/:projectid',[passport[_0x1d34('0x61')]([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],function(_0x2d9a83,_0xbae95c){winston[_0x1d34('0x63')](_0x1d34('0x73'),_0x2d9a83['params']);var _0xd393d2=_0x2d9a83[_0x1d34('0x72')][_0x1d34('0x42')];winston[_0x1d34('0x63')]('»»»\x20»»»\x20get\x20customer\x20from\x20db\x20-\x20projectid',_0xd393d2);SubscriptionPayment[_0x1d34('0x46')]({'project_id':_0xd393d2,'stripe_event':'checkout.session.completed'},async function(_0x113de1,_0x536676){if(_0x113de1){winston[_0x1d34('0x63')]('--\x20>\x20get\x20customer\x20from\x20db\x20-\x20Error\x20',_0x113de1);return _0x113de1;}if(_0x536676){_0x536676[0x0][_0x1d34('0x18')][_0x1d34('0x15')];winston[_0x1d34('0x63')]('--\x20>\x20get\x20customer\x20from\x20db\x20-\x20subscription\x20>\x20customer\x20id\x20',_0x536676[0x0]['object'][_0x1d34('0x15')]);const _0x1fbe94=_0x536676[0x0][_0x1d34('0x18')][_0x1d34('0x15')];const _0x47c7fc=require(_0x1d34('0x45'))(apiSecretKey);const _0x2965cc=await _0x47c7fc[_0x1d34('0x9b')]['retrieve'](_0x1fbe94);winston['debug']('--\x20>\x20get\x20customer\x20from\x20db\x20>\x20customer\x20from\x20stripe\x20API\x20',_0x2965cc);const _0x55424e=await _0x47c7fc[_0x1d34('0x23')]['list']({'customer':_0x1fbe94,'type':'card'});_0x2965cc[_0x1d34('0x23')]=_0x55424e;winston['debug'](_0x1d34('0x66'),_0x536676);_0xbae95c[_0x1d34('0x60')](_0x2965cc);}});});router[_0x1d34('0x96')]('/customers/:customerid',[passport[_0x1d34('0x61')]([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],async function(_0x15c90b,_0x4a143b){var _0x26ec2b=_0x15c90b[_0x1d34('0x72')]['customerid'];winston[_0x1d34('0x63')]('»»»\x20»»»\x20\x20update\x20customer\x20-\x20customerid\x20from\x20params\x20',_0x26ec2b);winston['debug'](_0x1d34('0x6'),_0x15c90b[_0x1d34('0x79')]);const _0x58686d=require(_0x1d34('0x45'))(apiSecretKey);let _0x57d141;try{_0x57d141=await _0x58686d[_0x1d34('0x23')][_0x1d34('0x83')]({'type':'card','card':{'number':_0x15c90b[_0x1d34('0x79')][_0x1d34('0x78')],'exp_month':_0x15c90b[_0x1d34('0x79')][_0x1d34('0x7f')],'exp_year':_0x15c90b[_0x1d34('0x79')][_0x1d34('0x2d')],'cvc':_0x15c90b[_0x1d34('0x79')][_0x1d34('0x4a')]}});}catch(_0x5efdaf){winston[_0x1d34('0x24')](_0x1d34('0x74'),_0x5efdaf);return _0x4a143b['status'](0x1f6)['send']({'success':![],'msg':_0x5efdaf});}winston[_0x1d34('0x63')]('»»»\x20»»»\x20\x20paymentMethod',_0x57d141);try{const _0x37c410=await _0x58686d[_0x1d34('0x23')][_0x1d34('0x8b')](_0x57d141['id'],{'customer':_0x26ec2b});winston[_0x1d34('0x63')](_0x1d34('0x56'),_0x37c410);}catch(_0x33623d){winston[_0x1d34('0x24')]('»»»\x20»»»\x20\x20paymentMethod\x20attached\x20\x20error\x20',_0x33623d);return _0x4a143b[_0x1d34('0x39')](0x1f5)[_0x1d34('0x5d')]({'success':![],'msg':_0x33623d});}const _0x3309d3=await _0x58686d['customers'][_0x1d34('0x94')](_0x26ec2b,{'invoice_settings':{'default_payment_method':_0x57d141['id']}});_0x4a143b[_0x1d34('0x60')](_0x3309d3);});router[_0x1d34('0x1e')](_0x1d34('0x33'),[passport['authenticate']([_0x1d34('0x3f'),_0x1d34('0x51')],{'session':![]}),validtoken],async function(_0x544033,_0x19360b){winston['info']('get\x20PaymentMethods\x20list\x20req.params',_0x544033[_0x1d34('0x72')]);var _0x15bb22=_0x544033[_0x1d34('0x72')][_0x1d34('0x62')];winston['debug'](_0x1d34('0x86'),_0x15bb22);const _0xae629b=require(_0x1d34('0x45'))(apiSecretKey);const _0x58d9c1=await _0xae629b[_0x1d34('0x9b')]['retrieve'](_0x15bb22);const _0x36d3c3=_0x58d9c1['invoice_settings'][_0x1d34('0x4e')];let _0xf478a3;try{_0xf478a3=await _0xae629b[_0x1d34('0x23')][_0x1d34('0x3b')]({'customer':_0x15bb22,'type':'card'});winston['debug'](_0x1d34('0x35'),_0xf478a3);}catch(_0x250dca){return _0x19360b['status'](0x1f5)[_0x1d34('0x5d')]({'success':![],'msg':_0x250dca});}winston[_0x1d34('0x63')]('get\x20PaymentMethods\x20list\x20>\x20paymentMethods\x20>\x20default_payment_method_id\x20',_0x36d3c3);_0xf478a3['data'][_0x1d34('0x36')](_0x1eb5ef=>{if(_0x1eb5ef['id']!==_0x36d3c3){winston[_0x1d34('0x63')](_0x1d34('0x25'),_0x1eb5ef['id']);detachPaymentFunc(_0x1eb5ef['id'],function(_0x4fcf68){winston['info']('detachPaymentFunc\x20result\x20',_0x4fcf68);});}});_0x19360b[_0x1d34('0x60')](_0xf478a3);});async function detachPaymentFunc(_0xb34667,_0x610af0){winston[_0x1d34('0x63')]('detachPaymentFunct\x20>\x20paymentMethodid\x20',_0xb34667);const _0x1baf8f=require(_0x1d34('0x45'))(apiSecretKey);let _0x228feb;try{_0x228feb=await _0x1baf8f[_0x1d34('0x23')]['detach'](_0xb34667);_0x610af0(_0x228feb);}catch(_0x160e4a){_0x610af0(_0x160e4a);}}module[_0x1d34('0x77')]=router;
|
2
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBheW1lbnRzL3N0cmlwZS9pbmRleC5qcyJdLCJuYW1lcyI6WyJleHByZXNzIiwicmVxdWlyZSIsInJvdXRlciIsIndpbnN0b24iLCJQcm9qZWN0IiwiU3Vic2NyaXB0aW9uUGF5bWVudCIsIm1vbWVudCIsIm1vbmdvb3NlIiwicGFzc3BvcnQiLCJ2YWxpZHRva2VuIiwiYXBpS2V5IiwicHJvY2VzcyIsInN0cmlwZSIsImVuZHBvaW50U2VjcmV0IiwiYXBpU2VjcmV0S2V5IiwiYm9keVBhcnNlciIsIl8weDIyOGM2OSIsIl8weDMyYzBjZiIsIl8weDlmNTAzIiwiXzB4ODgxNDUwIiwiXzB4YmU0ZGZhIiwiXzB4NmJjYzA1IiwiXzB4NmQ2MjExIiwiXzB4MWYxNmU5IiwiXzB4MTZmZWYxIiwiXzB4NDY5NWY3IiwiXzB4MzExODhiIiwiXzB4MWRjNWFhIiwiTnVtYmVyIiwiXzB4MTBmODE3IiwiZ2V0U3Vic2NyaXRpb25CeUlkIiwiXzB4MTFhOWRlIiwiXzB4MWQxYWY1IiwiXzB4NGJlYjUwIiwiXzB4MWNiMDlhIiwiXzB4NDk3MTRkIiwidXBkYXRlUHJvamVjdFByb2ZpbGUiLCJzYXZlT25EQiIsIl8weDNhMmY2MyIsIl8weDE3ZTBlMSIsIl8weDQxMzlmNyIsIl8weDM0OWQwYSIsI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5kIFByb2plY3QgJywgZXJyKTtcbiAgICAgICAgICAgICAgcmV0dXJuIChlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHByb2plY3QpIHtcbiAgICAgICAgICAgICAgd2luc3Rvbi5pbmZvKCcqKiogKioqIGdldFN1YkJ5SWRBbmRDaGVja291dFNlc3Npb25Db21wbGV0ZWRFdm50ICBwcm9qZWN0ICcsIHByb2plY3QpO1xuICAgICAgICAgICAgICB3aW5zdG9uLmluZm8oJyoqKiAqKiogZ2V0U3ViQnlJZEFuZENoZWNrb3V0U2Vzc2lvbkNvbXBsZXRlZEV2bnQgIHByb2plY3QgPiBwcm9maWxlJywgcHJvamVjdC5wcm9maWxlKTtcblxuICAgICAgICAgICAgICB2YXIgc2VhdHNfbnVtID0gcHJvamVjdC5wcm9maWxlLmFnZW50cztcbiAgICAgICAgICAgICAgd2luc3Rvbi5pbmZvKCcqKiogKioqIGdldFN1YkJ5SWRBbmRDaGVja291dFNlc3Npb25Db21wbGV0ZWRFdm50ICBwcm9qZWN0ID4gcHJvZmlsZSA+IGFnZW50cycsIHNlYXRzX251bSk7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICB2YXIgcGxhbl9uYW1lID0gcHJvamVjdC5wcm9maWxlLm5hbWU7XG4gICAgICAgICAgICAgIHdpbnN0b24uaW5mbygnKioqICoqKiBnZXRTdWJCeUlkQW5kQ2hlY2tvdXRTZXNzaW9uQ29tcGxldGVkRXZudCAgcHJvamVjdCA+IHByb2ZpbGUgPiBhZ2VudHMgdHlwZW9mJywgdHlwZW9mIHNlYXRzX251bSk7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICB2YXIgdXNlcklkID0gc3Vic3B0bl9wYXltZW50LnVzZXJfaWRcbiAgICAgICAgICAgICAgd2luc3Rvbi5pbmZvKCcqKiogKioqIGdldFN1YkJ5SWRBbmRDaGVja291dFNlc3Npb25Db21wbGV0ZWRFdm50ICBwcm9qZWN0ID4gcHJvZmlsZSA+IG5hbWUnLCBwbGFuX25hbWUpO1xuXG4gICAgICAgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG4gICAgICAgICAgICAgIC8vICBCT0RZIFxuICAgICAgICAgICAgICAvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuICAgICAgICAgICAgICB2YXIgYm9keSA9IHtcbiAgICAgICAgICAgICAgICBwcm9maWxlOiB7XG4gICAgICAgICAgICAgICAgICBuYW1lOiBwbGFuX25hbWUsXG4gICAgICAgICAgICAgICAgICB0eXBlOiAncGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICBzdWJTdGFydDogc3Vic2NyaXB0aW9uU3RhcnREYXRlLFxuICAgICAgICAgICAgICAgICAgc3ViRW5kOiBzdWJzY3JpcHRpb25FbmREYXRlLFxuICAgICAgICAgICAgICAgICAgc3Vic2NyaXB0aW9uSWQ6IHN1YnNjcmlwdGlvbklkLFxuICAgICAgICAgICAgICAgICAgbGFzdF9zdHJpcGVfZXZlbnQ6IGV2ZW50LnR5cGUsXG4gICAgICAgICAgICAgICAgICBhZ2VudHM6IHNlYXRzX251bVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8qKiAyQiAqL1xuICAgICAgICAgICAgICB1cGRhdGVQcm9qZWN0UHJvZmlsZShwcm9qZWN0SWQsIGJvZHksICdpbnZvaWNlLnBheW1lbnRfc3VjY2VlZGVkJyk7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAvKiogMkMgKi9cbiAgICAgICAgICAgICAgc2F2ZU9uREIoc3Vic2NyaXB0aW9uSWQsIHByb2plY3RJZCwgZXZlbnQsIHVzZXJJZCwgZXZlbnQudHlwZSwgcGxhbl9uYW1lLCBzZWF0c19udW0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgfSkuY2F0Y2goZnVuY3Rpb24gKGVycikge1xuICA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BheW1lbnRJbnRlbnQpO1xuLy8gICAgICAgICBicmVhaztcbi8vICAgICAgIGNhc2UgJ3BheW1lbnRfbWV0aG9kLmF0dGFjaGVkJzpcbi8vICAgICAgICAgY29uc3QgcGF5bWVudE1ldGhvZCA9IGV2ZW50LmRhdGEub2JqZWN0O1xuLy8gICAgICAgICBoYW5kbGVQYXltZW50TWV0aG9kQXR0YWNoZWQocGF5bWVudE1ldGhvZCk7XG4vLyAgICAgICAgIGJyZWFrO1xuLy8gICAgICAgLy8gLi4uIGhhbmRsZSBvdGhlciBldmVudCB0eXBlc1xuLy8gICAgICAgZGVmYXVsdDpcbi8vICAgICAgICAgLy8gVW5leHBlY3RlZCBldmVudCB0eXBlXG4vLyAgICAgICAgIHJldHVybiByZXNwb25zZS5zdGF0dXMoNDAwKS5lbmQoKTtcbi8vICAgICB9XG5cbi8vICAgICAvLyBSZXR1cm4gYSByZXNwb25zZSB0byBhY2tub3dsZWRnZSByZWNlaXB0IG9mIHRoZSBldmVudFxuLy8gICAgIHJlc3BvbnNlLmpzb24oe3JlY2VpdmVkOiB0cnVlfSk7XG4vLyB9KTtcblxuXG5cblxubW9kdWxlLmV4cG9ydHMgPSByb3V0ZXI7Il0sImZpbGUiOiJwYXltZW50cy9zdHJpcGUvaW5kZXguanMifQ==
|
1
|
+
var _0x4204=['\x20!!!!!!!!\x20HI\x20!!!!!!!!\x20invoice.payment_succeeded','stripe\x20apiKey','rawBody','object','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20subsptn_payment\x20typeof\x20subsptn_payment:\x20','--\x20>\x20cancelsubscription\x20Error\x20getting\x20project\x20','userid','!!!!!!!!\x20HI\x20!!!!!!!!\x20checkout.session.completed','***\x20***\x20invoice.payment_succeeded\x20-\x20index:\x20','get\x20PaymentMethods\x20list\x20req.params','lines','subscription.deleted','canceled_at','format','»»»\x20»»»\x20\x20paymentMethod\x20attached\x20\x20error\x20','log','end','del','raw','default_payment_method','exports','save','saveOnDB\x20plan_name','saveFirstInvoicePaymentSucceeded\x20stripe_event','then','sessionid','payment','findOne','detach','***\x20***\x20customer.subscription.deleted\x20','»»»\x20»»»\x20get\x20customer\x20from\x20db\x20-\x20projectid','project_id','USECASE\x20\x20invoice.payment_succeeded\x20\x20billing_reason\x20subscription_create\x20','***\x20***\x20checkout.session.completed\x20-\x20getSubscritionById\x20subscr\x20object_type:\x20','PAYMENT_STRIPE_APIKEY','data','customer.subscription.deleted','list','customers','stripe\x20plan_name:\x20','detachPaymentFunct\x20>\x20paymentMethodid\x20','env','start','***\x20***\x20invoice.payment_succeeded\x20-\x20start:\x20','credit_card_cvc','find','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20','***\x20***\x20invoice.payment_succeeded\x20-\x20subscription\x20ID:\x20','invoice_settings','»»»»\x20stripe\x20endpointSecret:\x20','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20subsptn_payment:\x20','billing_reason','»»»\x20»»»\x20\x20paymentMethod\x20attached\x20','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile\x20>\x20agents','--\x20>\x20checkoutSession\x20get\x20by\x20id\x20from\x20stripe\x20\x20err\x20','../../../middleware/passport','price','customer.subscription.deleted\x20subscriptionPayment\x20project\x20id:\x20','error','/checkoutSession/:sessionid','sort','get\x20PaymentMethods\x20list\x20req.params\x20>\x20customer_id\x20','projectid','sessions','--\x20>\x20get\x20customer\x20from\x20db\x20-\x20subscription\x20>\x20customer\x20id\x20','jwt','application/json','Error\x20saving\x20object.','customer.subscription.deleted\x20profile\x20to\x20update\x20(event.data.object.canceled_at)\x20','/customers/:customerid','basic','name','stripe\x20project_id:\x20','--\x20>\x20get\x20customer\x20from\x20db\x20>\x20customer\x20from\x20stripe\x20API\x20','***\x20***\x20checkout.session.completed\x20-\x20getSubscritionById\x20err\x20','get\x20PaymentMethods\x20list\x20>\x20paymentMethods\x20','send','subscription_create','»»»\x20»»»\x20cancelsubscription\x20projectid','update','»»»\x20»»»\x20updatesubscription\x20projectid','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20-\x20err\x20','customer','../../../config/winston','\x20typeof\x20','catch','invoice.payment_succeeded','profile','stripe\x20checkout.session.completed','attach','detachPaymentFunc\x20result\x20','headers','agents','--\x20>\x20subscription\x20get\x20by\x20id\x20from\x20stripe\x20\x20err\x20','customer.subscription.deleted\x20profile\x20to\x20update\x20','»»»\x20»»»\x20\x20paymentMethod\x20create\x20\x20error\x20','Types','/:subscriptionid','passport','---\x20>\x20ERROR\x20','--\x20>\x20subscription\x20get\x20by\x20id\x20from\x20stripe\x20','»»»\x20»»»\x20cancelsubscription\x20userid','stripe\x20user_id:','»»»\x20»»»\x20updatesubscription\x20userid','YYYY-MM-DDTHH:mm:ss.SSS','json','Webhook\x20Error:\x20','stripe','***\x20***\x20!!!!!!!!!!!!!!!!!!!!!!\x20checkout.session.completed\x20-\x20subscription\x20ID:\x20','exec','»»»»\x20stripe\x20apiKey:\x20','/updatesubscription','body','mongoose','retrieve','webhooks','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile\x20>\x20name','status','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile\x20>\x20agents\x20typeof','split','params','client_reference_id','subscriptionid','paymentMethods','moment','debug','saveFirstInvoicePaymentSucceeded\x20subscriptionid','savedSubscriptionPayment\x20','stripe\x20endpointSecret','stripe\x20client_reference_id','get','free','checkout.session.completed','--\x20>\x20updatesubscription\x20Error\x20getting\x20project\x20','--\x20>\x20get\x20customer\x20from\x20db\x20>\x20customer\x20+\x20paymentMethods\x20','type','stripe\x20seats_numAsString:\x20','\x20!!!!!!!!\x20HI\x20!!!!!!!!!!!\x20customer.subscription.deleted','authenticate','--\x20>\x20subscription\x20get\x20by\x20id\x20freq.params.subscriptionid\x20','subscription','--\x20>\x20cancelsubscription\x20confirmation\x20','***\x20***\x20»»»\x20»»»\x20customer.subscription.deleted\x20subscriptionPayment\x20','***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20project\x20>\x20profile','period','Sandbox','post','saveOnDB\x20seats_num','***\x20***\x20invoice.payment_succeeded\x20-\x20BILLING\x20REASON\x20','****\x20Stripe\x20error\x20constructEvent:\x20','PAYMENT_STRIPE_API_SECRET_KEY','--\x20>\x20updatesubscription\x20\x20project\x20','constructEvent','message','--\x20>\x20get\x20customer\x20from\x20db\x20-\x20Error\x20','ObjectId','body-parser','stripe-signature','info','put','/customer/:projectid','stripe\x20apiSecretKey','card','--\x20>\x20GET\x20SUBSCRIPTION\x20PAYMENTS\x20ERRORt\x20','updateProjectProfile\x20Error\x20','user_id','subscriptions','»»»\x20»»»\x20\x20update\x20customer\x20-\x20cc\x20from\x20body\x20','get\x20PaymentMethods\x20list\x20>\x20paymentMethods\x20>\x20paymentMethods.data\x20','--\x20>\x20cancelsubscription\x20\x20err\x20','stripe\x20sig:\x20','»»»\x20»»»\x20\x20update\x20customer\x20-\x20customerid\x20from\x20params\x20','unix'];(function(_0x1da2f4,_0x42046f){var _0x3e4df4=function(_0x545494){while(--_0x545494){_0x1da2f4['push'](_0x1da2f4['shift']());}};_0x3e4df4(++_0x42046f);}(_0x4204,0xe0));var _0x3e4d=function(_0x1da2f4,_0x42046f){_0x1da2f4=_0x1da2f4-0x0;var _0x3e4df4=_0x4204[_0x1da2f4];return _0x3e4df4;};var express=require('express');var router=express['Router']();var winston=require(_0x3e4d('0x20'));var Project=require('../../../models/project');var SubscriptionPayment=require('../models/subscription-payment');var moment=require(_0x3e4d('0x49'));var mongoose=require(_0x3e4d('0x3e'));var passport=require(_0x3e4d('0x2f'));require(_0x3e4d('0x4'))(passport);var validtoken=require('../../../middleware/valid-token');const apiKey=process[_0x3e4d('0xa3')][_0x3e4d('0x9c')];winston[_0x3e4d('0x4a')](_0x3e4d('0x7b')+apiKey);const stripe=require(_0x3e4d('0x38'))(apiKey);const endpointSecret=process['env']['PAYMENT_STRIPE_SECRET'];winston['debug'](_0x3e4d('0x4d')+endpointSecret);const apiSecretKey=process[_0x3e4d('0xa3')][_0x3e4d('0x63')];winston['debug'](_0x3e4d('0x6e')+apiSecretKey);const bodyParser=require(_0x3e4d('0x69'));router[_0x3e4d('0x5f')]('/webhook',bodyParser[_0x3e4d('0x8c')]({'type':_0x3e4d('0xf')}),function(_0xa0f554,_0x451ef1){winston[_0x3e4d('0x4a')](_0x3e4d('0xab')+endpointSecret);winston[_0x3e4d('0x4a')](_0x3e4d('0x3b')+apiKey);winston['debug'](_0x3e4d('0x6e')+apiSecretKey);const _0x48b549=_0xa0f554[_0x3e4d('0x28')][_0x3e4d('0x6a')];winston['debug'](_0x3e4d('0x77'),_0x48b549);let _0x7722d8;try{_0x7722d8=stripe[_0x3e4d('0x40')][_0x3e4d('0x65')](_0xa0f554[_0x3e4d('0x7c')],_0x48b549,endpointSecret);}catch(_0x4e4c76){winston[_0x3e4d('0x7')](_0x3e4d('0x62'),_0x4e4c76[_0x3e4d('0x66')]);return _0x451ef1[_0x3e4d('0x42')](0x190)[_0x3e4d('0x19')](_0x3e4d('0x37')+_0x4e4c76['message']);}if(_0x7722d8['type']===_0x3e4d('0x51')){winston[_0x3e4d('0x4a')](_0x3e4d('0x81'));const _0x7d403a=_0x7722d8[_0x3e4d('0x9d')][_0x3e4d('0x7d')];winston[_0x3e4d('0x6b')](_0x3e4d('0x25'),_0x7d403a);var _0x13999f=_0x7d403a[_0x3e4d('0x46')];winston[_0x3e4d('0x6b')](_0x3e4d('0x4e'),_0x13999f);var _0x2d7be7=_0x13999f[_0x3e4d('0x44')]('_')[0x0];winston[_0x3e4d('0x6b')](_0x3e4d('0x33')+_0x2d7be7);var _0x404cbc=_0x13999f[_0x3e4d('0x44')]('_')[0x1];winston[_0x3e4d('0x6b')](_0x3e4d('0x15')+_0x404cbc);var _0x1a9ce0=_0x13999f[_0x3e4d('0x44')]('_')[0x2];winston['info'](_0x3e4d('0xa1')+_0x1a9ce0);var _0x1bbf22=_0x13999f[_0x3e4d('0x44')]('_')[0x3];winston['info']('stripe\x20seats_num:\x20'+_0x1bbf22+'typeof\x20',typeof _0x1bbf22);var _0x101627=Number(_0x1bbf22);winston[_0x3e4d('0x6b')](_0x3e4d('0x55')+_0x101627+_0x3e4d('0x21'),typeof _0x101627);var _0x5b76b3=_0x7722d8['data'][_0x3e4d('0x7d')]['subscription'];winston['info'](_0x3e4d('0x39'),_0x5b76b3);getSubscritionById(_0x5b76b3)[_0x3e4d('0x92')](function(_0x5e7407){var _0x5bbc27=_0x5e7407[_0x3e4d('0x7d')];winston[_0x3e4d('0x6b')](_0x3e4d('0x9b'),_0x5bbc27);var _0x24caa3=moment[_0x3e4d('0x79')](_0x5e7407['current_period_start'])[_0x3e4d('0x87')](_0x3e4d('0x35'));winston[_0x3e4d('0x6b')]('***\x20***\x20checkout.session.completed\x20-\x20getSubscritionById\x20***\x20start\x20***\x20:\x20',_0x24caa3);var _0xaf6537=moment[_0x3e4d('0x79')](_0x5e7407['current_period_end'])[_0x3e4d('0x87')]('YYYY-MM-DDTHH:mm:ss.SSS');winston[_0x3e4d('0x6b')]('***\x20***\x20checkout.session.completed\x20-\x20getSubscription\x20***\x20end\x20***\x20:\x20',_0xaf6537);var _0x28d9a4={'profile':{'name':_0x1a9ce0,'type':_0x3e4d('0x94'),'subscription_creation_date':_0x24caa3,'subStart':_0x24caa3,'subEnd':_0xaf6537,'subscriptionId':_0x5b76b3,'last_stripe_event':_0x7722d8['type'],'agents':_0x101627}};updateProjectProfile(_0x404cbc,_0x28d9a4,_0x3e4d('0x51'));saveOnDB(_0x5b76b3,_0x404cbc,_0x5e7407,_0x2d7be7,_0x7722d8['type'],_0x1a9ce0,_0x101627);})[_0x3e4d('0x22')](function(_0x12b28f){winston[_0x3e4d('0x7')](_0x3e4d('0x17'),_0x12b28f);});}if(_0x7722d8[_0x3e4d('0x54')]===_0x3e4d('0x23')){winston[_0x3e4d('0x6b')](_0x3e4d('0x7a'));winston[_0x3e4d('0x6b')](_0x3e4d('0x61'),_0x7722d8[_0x3e4d('0x9d')]['object'][_0x3e4d('0x0')]);var _0x14c4ce=_0x7722d8[_0x3e4d('0x9d')][_0x3e4d('0x7d')][_0x3e4d('0x84')]['total_count'];winston[_0x3e4d('0x6b')]('***\x20***\x20invoice.payment_succeeded\x20-\x20linesNum:\x20',_0x14c4ce);var _0x3797ee=_0x14c4ce-0x1;winston[_0x3e4d('0x6b')](_0x3e4d('0x82'),_0x3797ee);var _0xf75913=moment[_0x3e4d('0x79')](_0x7722d8[_0x3e4d('0x9d')][_0x3e4d('0x7d')]['lines']['data'][_0x3797ee][_0x3e4d('0x5d')][_0x3e4d('0xa4')])[_0x3e4d('0x87')](_0x3e4d('0x35'));winston['info'](_0x3e4d('0xa5'),_0xf75913);var _0x2ba585=moment[_0x3e4d('0x79')](_0x7722d8[_0x3e4d('0x9d')][_0x3e4d('0x7d')]['lines']['data'][_0x3797ee][_0x3e4d('0x5d')][_0x3e4d('0x8a')])[_0x3e4d('0x87')](_0x3e4d('0x35'));winston[_0x3e4d('0x6b')]('***\x20***\x20invoice.payment_succeeded\x20-\x20end:\x20',_0x2ba585);var _0x5b76b3=_0x7722d8[_0x3e4d('0x9d')]['object'][_0x3e4d('0x59')];winston[_0x3e4d('0x6b')]('***\x20***\x20invoice.payment_succeeded\x20-\x20subscription\x20ID:\x20',_0x5b76b3);if(_0x5b76b3==null){_0x5b76b3=_0x7722d8['data']['object'][_0x3e4d('0x84')]['data'][0x0][_0x3e4d('0x59')];winston[_0x3e4d('0x6b')](_0x3e4d('0xa9'),_0x5b76b3);}if(_0x7722d8['data'][_0x3e4d('0x7d')][_0x3e4d('0x0')]!==_0x3e4d('0x1a')){getSubByIdAndCheckoutSessionCompletedEvnt(_0x5b76b3)[_0x3e4d('0x92')](function(_0x298d75){winston[_0x3e4d('0x6b')](_0x3e4d('0xac'),_0x298d75);winston[_0x3e4d('0x6b')](_0x3e4d('0x7e'),typeof _0x298d75);if(_0x298d75){var _0x24ae21=_0x298d75[_0x3e4d('0x99')];winston[_0x3e4d('0x6b')]('***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20subsptn_payment\x20>\x20project_id:\x20',_0x24ae21);Project['findOne']({'_id':_0x24ae21},function(_0x3b8b7a,_0x37d6a3){if(_0x3b8b7a){winston[_0x3e4d('0x6b')]('***\x20***\x20getSubByIdAndCheckoutSessionCompletedEvnt\x20\x20find\x20Project\x20',_0x3b8b7a);return _0x3b8b7a;}if(_0x37d6a3){winston[_0x3e4d('0x6b')](_0x3e4d('0xa8'),_0x37d6a3);winston[_0x3e4d('0x6b')](_0x3e4d('0x5c'),_0x37d6a3[_0x3e4d('0x24')]);var _0x3189bd=_0x37d6a3[_0x3e4d('0x24')][_0x3e4d('0x29')];winston[_0x3e4d('0x6b')](_0x3e4d('0x2'),_0x3189bd);var _0x344bdb=_0x37d6a3[_0x3e4d('0x24')][_0x3e4d('0x14')];winston[_0x3e4d('0x6b')](_0x3e4d('0x43'),typeof _0x3189bd);var _0x5bf653=_0x298d75[_0x3e4d('0x72')];winston[_0x3e4d('0x6b')](_0x3e4d('0x41'),_0x344bdb);var _0x9e7803={'profile':{'name':_0x344bdb,'type':'payment','subStart':_0xf75913,'subEnd':_0x2ba585,'subscriptionId':_0x5b76b3,'last_stripe_event':_0x7722d8[_0x3e4d('0x54')],'agents':_0x3189bd}};updateProjectProfile(_0x24ae21,_0x9e7803,_0x3e4d('0x23'));saveOnDB(_0x5b76b3,_0x24ae21,_0x7722d8,_0x5bf653,_0x7722d8['type'],_0x344bdb,_0x3189bd);}});}})[_0x3e4d('0x22')](function(_0x2efd0d){winston[_0x3e4d('0x7')](_0x3e4d('0x1e'),_0x2efd0d);});}else if(_0x7722d8[_0x3e4d('0x9d')]['object'][_0x3e4d('0x0')]===_0x3e4d('0x1a')){console[_0x3e4d('0x89')](_0x3e4d('0x9a'));saveFirstInvoicePaymentSucceeded(_0x5b76b3,_0x7722d8,_0x7722d8[_0x3e4d('0x54')]);}}if(_0x7722d8[_0x3e4d('0x54')]===_0x3e4d('0x9e')){winston[_0x3e4d('0x6b')](_0x3e4d('0x56'));winston['info']('customer.subscription.deleted\x20event\x20',_0x7722d8);var _0x5b76b3=_0x7722d8['data']['object']['id'];winston[_0x3e4d('0x6b')]('***\x20***\x20subscription\x20ID\x20',_0x5b76b3);getSubByIdAndCheckoutSessionCompletedEvnt(_0x5b76b3)[_0x3e4d('0x92')](function(_0xce2fd5){winston[_0x3e4d('0x6b')](_0x3e4d('0x5b'),_0xce2fd5);if(_0xce2fd5){var _0x7fad1e=_0xce2fd5['project_id'];winston[_0x3e4d('0x6b')](_0x3e4d('0x6'),_0x7fad1e);var _0x5777cf=_0xce2fd5['user_id'];winston[_0x3e4d('0x6b')]('customer.subscription.deleted\x20subscriptionPayment\x20user\x20id:\x20',_0x5777cf);}var _0x3436b3={'profile':{'subscriptionId':_0x5b76b3,'name':_0x3e4d('0x5e'),'type':_0x3e4d('0x50'),'agents':0x1,'last_stripe_event':_0x7722d8['type'],'subEnd':_0x7722d8[_0x3e4d('0x9d')][_0x3e4d('0x7d')][_0x3e4d('0x86')]}};winston[_0x3e4d('0x6b')](_0x3e4d('0x11'),_0x7722d8['data'][_0x3e4d('0x7d')]['canceled_at']);winston[_0x3e4d('0x6b')](_0x3e4d('0x2b'),_0x3436b3[_0x3e4d('0x24')]);updateProjectProfile(_0x7fad1e,_0x3436b3,_0x3e4d('0x85'));saveOnDB(_0x5b76b3,_0x7fad1e,_0x7722d8[_0x3e4d('0x9d')][_0x3e4d('0x7d')],_0x5777cf,_0x7722d8[_0x3e4d('0x54')],_0x1a9ce0,0x1);})[_0x3e4d('0x22')](function(_0x5b8719){winston[_0x3e4d('0x7')](_0x3e4d('0x97'),_0x5b8719);});}_0x451ef1[_0x3e4d('0x36')]({'received':!![]});});function getSubByIdAndCheckoutSessionCompletedEvnt(_0x58b9f9){return new Promise(function(_0x25bac5,_0x5d32b6){SubscriptionPayment[_0x3e4d('0x95')]({'subscription_id':_0x58b9f9,'stripe_event':_0x3e4d('0x51')},function(_0x43c2b3,_0x2adc61){if(_0x43c2b3)_0x5d32b6(_0x43c2b3);var _0x278c71=_0x2adc61;_0x25bac5(_0x278c71);});});};function getSubscritionById(_0xc9b0af){return new Promise(function(_0xdd8f6f,_0x143126){const _0x461ef4=require(_0x3e4d('0x38'))(apiSecretKey);_0x461ef4[_0x3e4d('0x73')][_0x3e4d('0x3f')](_0xc9b0af,function(_0x582df8,_0x30d9aa){if(_0x582df8)_0x143126(_0x582df8);var _0x30d9aa=_0x30d9aa;_0xdd8f6f(_0x30d9aa);});});};function updateProjectProfile(_0x9f428e,_0x1d6769,_0xf8420f){Project['findByIdAndUpdate'](_0x9f428e,_0x1d6769,{'new':!![],'upsert':!![]},function(_0xd6e791,_0x1dc7a5){if(_0xd6e791){winston[_0x3e4d('0x7')](_0x3e4d('0x71'),_0xd6e791);}else{winston[_0x3e4d('0x4a')](_0x1dc7a5);}});}function saveOnDB(_0x5b29c9,_0x30d1a6,_0x288c55,_0x3d517f,_0x5f3c2e,_0x5bfba4,_0x126ee1){winston[_0x3e4d('0x6b')](_0x3e4d('0x90'),_0x5bfba4);winston['info'](_0x3e4d('0x60'),_0x126ee1);var _0x25dc2f=new SubscriptionPayment({'_id':new mongoose[(_0x3e4d('0x2d'))][(_0x3e4d('0x68'))](),'subscription_id':_0x5b29c9,'project_id':_0x30d1a6,'user_id':_0x3d517f,'stripe_event':_0x5f3c2e,'plan_name':_0x5bfba4,'agents':_0x126ee1,'object':_0x288c55});_0x25dc2f[_0x3e4d('0x8f')](function(_0x4b0964,_0x4c188b){if(_0x4b0964){winston[_0x3e4d('0x7')](_0x3e4d('0x30'),_0x4b0964);return res['status'](0x1f4)[_0x3e4d('0x19')]({'success':![],'msg':_0x3e4d('0x10')});}winston['info'](_0x3e4d('0x4c'),_0x4c188b);});}function saveFirstInvoicePaymentSucceeded(_0x547858,_0x925f12,_0x28bdad){console['log'](_0x3e4d('0x4b'),_0x547858);console[_0x3e4d('0x89')](_0x3e4d('0x91'),_0x28bdad);var _0x3bf6a8=new SubscriptionPayment({'_id':new mongoose[(_0x3e4d('0x2d'))][(_0x3e4d('0x68'))](),'subscription_id':_0x547858,'stripe_event':_0x28bdad,'object':_0x925f12});_0x3bf6a8['save'](function(_0xfd6256,_0x12265b){if(_0xfd6256){winston['error']('---\x20>\x20ERROR\x20',_0xfd6256);return res['status'](0x1f4)[_0x3e4d('0x19')]({'success':![],'msg':_0x3e4d('0x10')});}console[_0x3e4d('0x89')]('savedSubscriptionPayment\x20>>\x20',_0x12265b);});}router[_0x3e4d('0x6c')]('/cancelsubscription',[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),_0x3e4d('0xe')],{'session':![]}),validtoken],function(_0x543832,_0x5618c7){var _0x74c7d7=_0x543832[_0x3e4d('0x3d')][_0x3e4d('0xb')];var _0x417755=_0x543832['body']['userid'];winston[_0x3e4d('0x6b')](_0x3e4d('0x1b'),_0x74c7d7);winston[_0x3e4d('0x6b')](_0x3e4d('0x32'),_0x417755);Project[_0x3e4d('0x95')]({'_id':_0x74c7d7},function(_0x4f3320,_0x3c05de){if(_0x4f3320){winston[_0x3e4d('0x7')](_0x3e4d('0x7f'),_0x4f3320);return _0x4f3320;}if(_0x3c05de){winston['info']('--\x20>\x20cancelsubscription\x20\x20project\x20',_0x3c05de);var _0x3e701d=_0x3c05de[_0x3e4d('0x24')]['subscriptionId'];const _0x1c4005=require(_0x3e4d('0x38'))(apiSecretKey);_0x1c4005['subscriptions'][_0x3e4d('0x8b')](_0x3e701d,function(_0x173b6d,_0x1da329){if(_0x173b6d){winston['error'](_0x3e4d('0x76'),_0x173b6d);return _0x5618c7[_0x3e4d('0x42')](0x1f4)[_0x3e4d('0x19')]({'success':![],'msg':_0x173b6d});}winston[_0x3e4d('0x6b')](_0x3e4d('0x5a'),_0x1da329);_0x5618c7['json'](_0x1da329);});}});});router[_0x3e4d('0x6c')](_0x3e4d('0x3c'),[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),_0x3e4d('0xe')],{'session':![]}),validtoken],function(_0x36e30e,_0x40af49){var _0x2df365=_0x36e30e['body'][_0x3e4d('0xb')];var _0x4badc8=_0x36e30e['body'][_0x3e4d('0x80')];var _0x183588=_0x36e30e[_0x3e4d('0x3d')][_0x3e4d('0x5')];winston[_0x3e4d('0x6b')](_0x3e4d('0x1d'),_0x2df365);winston[_0x3e4d('0x6b')](_0x3e4d('0x34'),_0x4badc8);winston[_0x3e4d('0x6b')]('»»»\x20»»»\x20updatesubscription\x20price',_0x183588);const _0x16fbf3=require(_0x3e4d('0x38'))(apiSecretKey);Project[_0x3e4d('0x95')]({'_id':_0x2df365},function(_0x515838,_0x3c240d){if(_0x515838){winston[_0x3e4d('0x7')](_0x3e4d('0x52'),_0x515838);return _0x515838;}if(_0x3c240d){winston['info'](_0x3e4d('0x64'),_0x3c240d);var _0x56b00e=_0x3c240d[_0x3e4d('0x24')]['subscriptionId'];_0x16fbf3[_0x3e4d('0x73')][_0x3e4d('0x1c')](_0x56b00e);}});});router['get'](_0x3e4d('0x2e'),[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),_0x3e4d('0xe')],{'session':![]}),validtoken],function(_0x59c3cf,_0x2fe1c4){SubscriptionPayment['find']({'subscription_id':_0x59c3cf[_0x3e4d('0x45')][_0x3e4d('0x47')]})[_0x3e4d('0x9')]({'object.created':'asc'})[_0x3e4d('0x3a')](function(_0x5af4ee,_0x235127){if(_0x5af4ee){winston['error'](_0x3e4d('0x70'),project);return _0x2fe1c4[_0x3e4d('0x42')](0x1f4)[_0x3e4d('0x19')]({'success':![],'msg':_0x5af4ee});}_0x2fe1c4[_0x3e4d('0x36')](_0x235127);});});router[_0x3e4d('0x4f')]('/stripesubs/:subscriptionid',[passport['authenticate'](['basic','jwt'],{'session':![]}),validtoken],function(_0xaa7d9,_0x469106){winston[_0x3e4d('0x6b')](_0x3e4d('0x58'),_0xaa7d9[_0x3e4d('0x45')][_0x3e4d('0x47')]);var _0x15fe93=require(_0x3e4d('0x38'))(apiSecretKey);_0x15fe93[_0x3e4d('0x73')][_0x3e4d('0x3f')](_0xaa7d9[_0x3e4d('0x45')][_0x3e4d('0x47')],function(_0x286861,_0x42438b){if(_0x286861){winston[_0x3e4d('0x7')](_0x3e4d('0x2a'),_0x286861);return _0x469106[_0x3e4d('0x42')](0x1f4)[_0x3e4d('0x19')]({'success':![],'msg':_0x286861});}winston[_0x3e4d('0x6b')](_0x3e4d('0x31'),_0x42438b);_0x469106[_0x3e4d('0x36')](_0x42438b);});});router[_0x3e4d('0x4f')](_0x3e4d('0x8'),[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),'jwt'],{'session':![]}),validtoken],function(_0x5059cf,_0x4c9b10){winston[_0x3e4d('0x6b')]('--\x20>\x20checkoutSession\x20params.sessionid\x20',_0x5059cf['params'][_0x3e4d('0x93')]);var _0x341664=require('stripe')(apiSecretKey);_0x341664['checkout'][_0x3e4d('0xc')][_0x3e4d('0x3f')](_0x5059cf[_0x3e4d('0x45')][_0x3e4d('0x93')],function(_0x5e949d,_0x53245d){if(_0x5e949d){winston[_0x3e4d('0x6b')](_0x3e4d('0x3'),_0x5e949d);return _0x4c9b10['status'](0x1f4)[_0x3e4d('0x19')]({'success':![],'msg':_0x5e949d});}winston[_0x3e4d('0x6b')]('--\x20>\x20checkoutSession\x20get\x20by\x20id\x20from\x20stripe\x20',_0x53245d);_0x4c9b10['json'](_0x53245d);});});router['get'](_0x3e4d('0x6d'),[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),'jwt'],{'session':![]}),validtoken],function(_0x4f16e2,_0x1d4275){winston[_0x3e4d('0x4a')]('»»»\x20»»»\x20get\x20customer\x20from\x20db\x20',_0x4f16e2[_0x3e4d('0x45')]);var _0x2c9352=_0x4f16e2[_0x3e4d('0x45')][_0x3e4d('0xb')];winston[_0x3e4d('0x4a')](_0x3e4d('0x98'),_0x2c9352);SubscriptionPayment[_0x3e4d('0xa7')]({'project_id':_0x2c9352,'stripe_event':'checkout.session.completed'},async function(_0xbd6945,_0x18d55d){if(_0xbd6945){winston[_0x3e4d('0x4a')](_0x3e4d('0x67'),_0xbd6945);return _0xbd6945;}if(_0x18d55d){_0x18d55d[0x0][_0x3e4d('0x7d')][_0x3e4d('0x1f')];winston[_0x3e4d('0x4a')](_0x3e4d('0xd'),_0x18d55d[0x0][_0x3e4d('0x7d')][_0x3e4d('0x1f')]);const _0x139a6d=_0x18d55d[0x0][_0x3e4d('0x7d')]['customer'];const _0x750e37=require('stripe')(apiSecretKey);const _0x1218df=await _0x750e37[_0x3e4d('0xa0')][_0x3e4d('0x3f')](_0x139a6d);winston[_0x3e4d('0x4a')](_0x3e4d('0x16'),_0x1218df);const _0x311838=await _0x750e37[_0x3e4d('0x48')]['list']({'customer':_0x139a6d,'type':_0x3e4d('0x6f')});_0x1218df[_0x3e4d('0x48')]=_0x311838;winston[_0x3e4d('0x4a')](_0x3e4d('0x53'),_0x18d55d);_0x1d4275[_0x3e4d('0x36')](_0x1218df);}});});router[_0x3e4d('0x5f')](_0x3e4d('0x12'),[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),_0x3e4d('0xe')],{'session':![]}),validtoken],async function(_0x4b1e2f,_0x2dfcde){var _0x2ef736=_0x4b1e2f[_0x3e4d('0x45')]['customerid'];winston['debug'](_0x3e4d('0x78'),_0x2ef736);winston[_0x3e4d('0x4a')](_0x3e4d('0x74'),_0x4b1e2f[_0x3e4d('0x3d')]);const _0x4de7e8=require(_0x3e4d('0x38'))(apiSecretKey);let _0x3bffb6;try{_0x3bffb6=await _0x4de7e8['paymentMethods']['create']({'type':'card','card':{'number':_0x4b1e2f['body']['credit_card_num'],'exp_month':_0x4b1e2f[_0x3e4d('0x3d')]['expiration_date_month'],'exp_year':_0x4b1e2f[_0x3e4d('0x3d')]['expiration_date_year'],'cvc':_0x4b1e2f['body'][_0x3e4d('0xa6')]}});}catch(_0x4b61c0){winston[_0x3e4d('0x7')](_0x3e4d('0x2c'),_0x4b61c0);return _0x2dfcde[_0x3e4d('0x42')](0x1f6)[_0x3e4d('0x19')]({'success':![],'msg':_0x4b61c0});}winston[_0x3e4d('0x4a')]('»»»\x20»»»\x20\x20paymentMethod',_0x3bffb6);try{const _0x14aea2=await _0x4de7e8[_0x3e4d('0x48')][_0x3e4d('0x26')](_0x3bffb6['id'],{'customer':_0x2ef736});winston[_0x3e4d('0x4a')](_0x3e4d('0x1'),_0x14aea2);}catch(_0x3da3f3){winston[_0x3e4d('0x7')](_0x3e4d('0x88'),_0x3da3f3);return _0x2dfcde[_0x3e4d('0x42')](0x1f5)[_0x3e4d('0x19')]({'success':![],'msg':_0x3da3f3});}const _0x3c244f=await _0x4de7e8[_0x3e4d('0xa0')][_0x3e4d('0x1c')](_0x2ef736,{'invoice_settings':{'default_payment_method':_0x3bffb6['id']}});_0x2dfcde[_0x3e4d('0x36')](_0x3c244f);});router['get']('/payment_methods/:customerid',[passport[_0x3e4d('0x57')]([_0x3e4d('0x13'),_0x3e4d('0xe')],{'session':![]}),validtoken],async function(_0x37fe6c,_0x31ab00){winston['info'](_0x3e4d('0x83'),_0x37fe6c['params']);var _0x21ea98=_0x37fe6c[_0x3e4d('0x45')]['customerid'];winston[_0x3e4d('0x4a')](_0x3e4d('0xa'),_0x21ea98);const _0x46a9db=require(_0x3e4d('0x38'))(apiSecretKey);const _0x347f34=await _0x46a9db[_0x3e4d('0xa0')]['retrieve'](_0x21ea98);const _0x53f025=_0x347f34[_0x3e4d('0xaa')][_0x3e4d('0x8d')];let _0x5bbbcf;try{_0x5bbbcf=await _0x46a9db['paymentMethods'][_0x3e4d('0x9f')]({'customer':_0x21ea98,'type':_0x3e4d('0x6f')});winston[_0x3e4d('0x4a')](_0x3e4d('0x18'),_0x5bbbcf);}catch(_0x4ac527){return _0x31ab00['status'](0x1f5)[_0x3e4d('0x19')]({'success':![],'msg':_0x4ac527});}winston['debug']('get\x20PaymentMethods\x20list\x20>\x20paymentMethods\x20>\x20default_payment_method_id\x20',_0x53f025);_0x5bbbcf[_0x3e4d('0x9d')]['forEach'](_0x8ba7ab=>{if(_0x8ba7ab['id']!==_0x53f025){winston['debug'](_0x3e4d('0x75'),_0x8ba7ab['id']);detachPaymentFunc(_0x8ba7ab['id'],function(_0x1b194f){winston[_0x3e4d('0x6b')](_0x3e4d('0x27'),_0x1b194f);});}});_0x31ab00[_0x3e4d('0x36')](_0x5bbbcf);});async function detachPaymentFunc(_0x2ae20e,_0x51787c){winston[_0x3e4d('0x4a')](_0x3e4d('0xa2'),_0x2ae20e);const _0x4cb464=require(_0x3e4d('0x38'))(apiSecretKey);let _0x2c8b4c;try{_0x2c8b4c=await _0x4cb464[_0x3e4d('0x48')][_0x3e4d('0x96')](_0x2ae20e);_0x51787c(_0x2c8b4c);}catch(_0x5eafae){_0x51787c(_0x5eafae);}}module[_0x3e4d('0x8e')]=router;
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBheW1lbnRzL3N0cmlwZS9pbmRleC5qcyJdLCJuYW1lcyI6WyJleHByZXNzIiwicmVxdWlyZSIsInJvdXRlciIsIndpbnN0b24iLCJQcm9qZWN0IiwiU3Vic2NyaXB0aW9uUGF5bWVudCIsIm1vbWVudCIsIm1vbmdvb3NlIiwicGFzc3BvcnQiLCJ2YWxpZHRva2VuIiwiYXBpS2V5IiwicHJvY2VzcyIsInN0cmlwZSIsImVuZHBvaW50U2VjcmV0IiwiYXBpU2VjcmV0S2V5IiwiYm9keVBhcnNlciIsIl8weGEwZjU1NCIsIl8weDQ1MWVmMSIsIl8weDQ4YjU0OSIsIl8weDc3MjJkOCIsIl8weDRlNGM3NiIsIl8weDdkNDAzYSIsIl8weDEzOTk5ZiIsIl8weDJkN2JlNyIsIl8weDQwNGNiYyIsIl8weDFhOWNlMCIsIl8weDFiYmYyMiIsIl8weDEwMTYyNyIsIk51bWJlciIsIl8weDViNzZiMyIsImdldFN1YnNjcml0aW9uQ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lZEV2bnQgIHByb2plY3QgPiBwcm9maWxlID4gYWdlbnRzJywgc2VhdHNfbnVtKTtcbiAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgIHZhciBwbGFuX25hbWUgPSBwcm9qZWN0LnByb2ZpbGUubmFtZTtcbiAgICAgICAgICAgICAgd2luc3Rvbi5pbmZvKCcqKiogKioqIGdldFN1YkJ5SWRBbmRDaGVja291dFNlc3Npb25Db21wbGV0ZWRFdm50ICBwcm9qZWN0ID4gcHJvZmlsZSA+IGFnZW50cyB0eXBlb2YnLCB0eXBlb2Ygc2VhdHNfbnVtKTtcbiAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgIHZhciB1c2VySWQgPSBzdWJzcHRuX3BheW1lbnQudXNlcl9pZFxuICAgICAgICAgICAgICB3aW5zdG9uLmluZm8oJyoqKiAqKiogZ2V0U3ViQnlJZEFuZENoZWNrb3V0U2Vzc2lvbkNvbXBsZXRlZEV2bnQgIHByb2plY3QgPiBwcm9maWxlID4gbmFtZScsIHBsYW5fbmFtZSk7XG5cbiAgICAgICAgICAgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cbiAgICAgICAgICAgICAgLy8gIEJPRFkgXG4gICAgICAgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG4gICAgICAgICAgICAgIHZhciBib2R5ID0ge1xuICAgICAgICAgICAgICAgIHByb2ZpbGU6IHtcbiAgICAgICAgICAgICAgICAgIG5hbWU6IHBsYW5fbmFtZSxcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgIHN1YlN0YXJ0OiBzdWJzY3JpcHRpb25TdGFydERhdGUsXG4gICAgICAgICAgICAgICAgICBzdWJFbmQ6IHN1YnNjcmlwdGlvbkVuZERhdGUsXG4gICAgICAgICAgICAgICAgICBzdWJzY3JpcHRpb25JZDogc3Vic2NyaXB0aW9uSWQsXG4gICAgICAgICAgICAgICAgICBsYXN0X3N0cmlwZV9ldmVudDogZXZlbnQudHlwZSxcbiAgICAgICAgICAgICAgICAgIGFnZW50czogc2VhdHNfbnVtXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLyoqIDJCICovXG4gICAgICAgICAgICAgIHVwZGF0ZVByb2plY3RQcm9maWxlKHByb2plY3RJZCwgYm9keSwgJ2ludm9pY2UucGF5bWVudF9zdWNjZWVkZWQnKTtcbiAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgIC8qKiAyQyAqL1xuICAgICAgICAgICAgICBzYXZlT25EQihzdWJzY3JpcHRpb25JZCwgcHJvamVjdElkLCBldmVudCwgdXNlcklkLCBldmVudC50eXBlLCBwbGFuX25hbWUsIHNlYXRzX251bSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICB9KS5jYXRjaChmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgIHdpbnN0b24uZXJyb3IoJyoqKiAqKiogZ2V0U3ViQnlJZEFuZENoZWNrb3V0U2Vzc2lvbkNvbXBsZXRlZEV2bnQgLSBlcnIgJywgZXJyKTtcbiAgICAgIH0pO1xuICAgICAgLy8gfSwgNTAwMCk7XG4gICAgfSBcbiAgICBlbHNlIGlmIChldmVudC5kYXRhLm9iamVjdC5iaWxsaW5nX3JlYXNvbiA9PT0gJ3N1YnNjcmlwdGlvbl9jcmVhdGUnKSB7XG4gICAgICBjb25zb2xlLmxvZygnVVNFQ0FTRSAgaW52b2ljZS5wYXltZW50X3N1Y2NlZWRlZCAgYmlsbGluZ19yZWFzb24gc3Vic2NyaXB0aW9uX2NyZWF0ZSAnKSBcbiAgICAgIHNhdmVGaXJzdEludm9pY2VQYXltZW50U3VjY2VlZGVkKHN1YnNjcmlwdGlvbklkLCBldmVudCwgZXZlbnQudHlwZSk7XG4gICAgfSBcbiAgXG4gIH1cblxuICAvKipcbiAgICoqISAqKiogSEFORExFIFRI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