# Ruby on Rails Background Jobs with Sidekiq: making PaymentsServiceWrapper idempotent (p34)

**URL:** <https://forum.devtalk.com/t/ruby-on-rails-background-jobs-with-sidekiq-making-paymentsservicewrapper-idempotent-p34/134674>\
**Category:** PragProg Customers\
**Tags:** book-ruby-on-rails-background-jobs-with-sidekiq, question\
**Created:** [3 December 2023 21:09 UTC](https://forum.devtalk.com/t/ruby-on-rails-background-jobs-with-sidekiq-making-paymentsservicewrapper-idempotent-p34/134674 "2023-12-03T21:09:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![davetron5000](https://forum.devtalk.com/user_avatar/forum.devtalk.com/davetron5000/32/5597_2.png) [@davetron5000](https://forum.devtalk.com/u/davetron5000)\
**Post date:** [3 December 2023 22:02 UTC](https://forum.devtalk.com/t/ruby-on-rails-background-jobs-with-sidekiq-making-paymentsservicewrapper-idempotent-p34/134674/2 "2023-12-03T22:02:19Z")

</div>

The fake payments service doesn’t support either of those. I added idempotency to the fulfillment service and ability to check past action to the email service to demonstrate, but didn’t do that for the payments one.

If you wanted to try to do that, the [code for the server](https://github.com/davetron5000/fake-api-server) is available and you could replicate what email or fulfillment are doing for payments.

For a real world example, Stripe’s API supports both.

If you had a real world third party where you could not do either of these, you are in for a bad time, but the book recommends you not retry those jobs because you will have to check to see what happened when there is a failure.

---

_[View the full topic](https://forum.devtalk.com/t/ruby-on-rails-background-jobs-with-sidekiq-making-paymentsservicewrapper-idempotent-p34/134674)._
