Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to mark API execution as failed (and don't charge them) #3

Open
shesek opened this issue Apr 3, 2018 · 0 comments
Open

Allow to mark API execution as failed (and don't charge them) #3

shesek opened this issue Apr 3, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@shesek
Copy link
Collaborator

shesek commented Apr 3, 2018

Allow services to signal that API execution has failed, which should free up the payment token and allow it to be used for another API call.

  • If the X-Charge response header is set to yes, consider the request a success and mark the payment token as spent. If the X-Charge header is set to any other value (normally no), consider the request a failure and mark the payment token as usable.

  • If the X-Charge response header is not specified,

    • If the --explicit-charge config option is set, consider the request a failure.

    • If the --explicit-charge config option is not set, consider the request a success if the status code is 2xx or 3xx, otherwise consider it a failure.

Freeing up the payment token means removing it from the spent table, which means we should log the execution error to a separate (new) table.

@shesek shesek added the enhancement New feature or request label Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant