restarone / violet_rails

an app engine for your business. Seamlessly implement business logic with a powerful API. Out of the box CMS, blog, forum and email functionality. Developer friendly & easily extendable for your next SaaS/XaaS project. Built with Rails 6, Devise, Sidekiq & PostgreSQL
https://violet.restarone.solutions
MIT License
96 stars 43 forks source link

client authenticated webhook #1552

Open donrestarone opened 1 year ago

donrestarone commented 1 year ago

currently, we are using client side web hooks without authentication. The goal is to use the rails session/authentication to automatically authenticate the incoming request (verify cryptographically that the request is from the violet rails client side)

donrestarone commented 1 year ago

Excerpt from: https://prashant.restarone.solutions/forum/threads/everybodyisdoingdrugs-scope-printify-violet-integration

An update in regards to calculating the Stripe's processing fee and showing it to the customer before prompting to checkout-page.

I checked the stripe's API documentation and could not find such API. Later, I reached out to Stripe's dev support team in their official discord channel, and they informed that there was no such API and suggested to manually calculate the processing fees on our end. LINK

Screenshot 2023-05-12 at 7 52 59 AM

I also analyzed the fitprint implementation done on our test-net. Fitprint is also using such manual calculation to show the processing fees.

Screenshot 2023-05-12 at 7 37 48 AM

The processing fees that we see on the stripe's checkout page, after we click on "COMPLETE ORDER" button as shown in above picture, is also a part of the line_items(analogous to an item of an order comprised of many items). So, the processing fees that we are seeing on the stripe's checkout page is not from stripe itself.

Screenshot 2023-05-12 at 7 46 52 AM

Conclusion:

The printify does provide shipping charge through its API. After the total amount (products price + shipping charge), we can also show the stripe processing fee on client-side by doing calculation like mentioned in here.