Use case of state variable in Stripe Connect

Use case of state variable in Stripe Connect

When integrating Stripe Connect for end-2-end payment, common issue is how to receive callback to arbitrary domain or url params. For instance, you may need to return to arbitrary subdomain like https://{subdomain}.proshopdigital.io/callback.Like as other services, we can register only one redirect URL in the stripe dashboard. In this case, we can use state variable for …

Why is Mongoose Entity Save not working?

Why is Mongoose Entity Save not working?

When you are working with Mongoose in Node.js, you may have an issue that mongoose entity is not saved. For example; wallet.tokens = tokens;await wallet.save(); This happens element of entity is Mixedtype.Mongoose is an idiot that cannot detect updates when element type is mixed.So in this case, you can enforce updates by doing below. wallet.markUpdated(‘tokens’);await …

Highlight specific words in textarea

I had a chance that I need to highlight some invalid characters that users input in <textarea/> tag. At first glance, I thought I could wrap all individual letters inside of <span> tag but I realized that textarea tag cannot contain any other child tags. I researched some solution and found this nice plugin. https://github.com/lonekorean/highlight-within-textarea …

Paypal payout integration in Node.js

In the web application development, you may have to integrate PayPal payment API because PayPal is one of the most popular payment method in modern ecommerce online merchants. In Node.js based applications, there is a simple SDK https://www.npmjs.com/package/paypal-rest-sdk Next, you need to create sandbox account on PayPal developer account dashboard https://developer.paypal.com/developer/applications Obtain client_id and client_secret …

What is Wix?

Wix is a website builder with user friend UI builder, databases and custom backend. Wix provides Wix editor with 500+ predesigned templates and drag & drop website builder.Wix provides ability to code custom logic with Javascript and wix libraries to implement custom business logic and customized UI animations.We can link own domain to the website …

Touching Parents Timestamps with “$touches” in Laravel

When you’d need to update updated_at field of parent model, you can just use $touches of Laravel eloquent. Let’s assume, you have Posts and each Post has multiple Comments.Then it’s one to many relationship between Post and Comments.If a user added a comment for the post, we should update updated_at of the post as well.We …

Trade-off running atomic daemons in Node.js

When you develop daemons that runs periodically in Node.js, you’d have some tricky issues.I have used to node-schedule npm package and I had several problems. As it runs by certain time interval, it could overlap each other as well as it will run another process without completing all jobs. For example, you have a daemon …