Pre Call Hook

You are here

2 posts / 0 new
Last post
Pre Call Hook
Is it possible to have JSPayment API call a method before it makes the payment. The method would return true|false for the call to happen or not?  This would be to solve the following scenario:  
  • User "A" Logs in and vews Invoice # 100
  • User "B" logs in and views Invoice # 100
  • User B pushes "Pay now" 
  • User "A" tries to pay. 
The scenario above will result in having two paymetns against the same invoice. I am trying to prevent that.     
Re: Pre Call Hook

Thanks for your post, we're happy to help. In this case invoice management would need to happen outside of PaymentsJS. I would suggest when a client logs in and reviews an invoice you prevent other users from accessing the “Pay now” feature. Basically once you initialize PaymentsJS, no other user can perform the same function within the same invoice until that process is complete. There is not a feature built into PaymentsJS to do this, which is why I mentioned it would need to happen outside of PaymentsJS.

Log in or register to post comments