-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(router): blocklist #3056
feat(router): blocklist #3056
Conversation
…hyperswitch into feat/block_paymentmethod
…hyperswitch into feat/block_paymentmethod
…umn fingerprint_id in payment attempt
… pm_fingerprint, pm_hash
…hyperswitch into feat/block_paymentmethod
… improvements and succinction
CREATE TYPE "BlocklistDataKind" AS ENUM ( | ||
'payment_method', | ||
'card_bin', | ||
'extended_card_bin' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to have this as a database enum. can be a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't be having much changes around this enum, so it being enum in DB should be fine.
cc: @vspecky
If status is being changed to failed, then return a 200 with appropriate |
merchant_id: &str, | ||
fingerprint: &str, | ||
) -> CustomResult<storage::BlocklistLookup, errors::StorageError> { | ||
let conn = connection::pg_connection_write(self).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pg_connection_read
let merchant_id = payment_data.payment_attempt.merchant_id; | ||
let merchant_fingerprint_secret = | ||
blocklist_utils::get_merchant_fingerprint_secret(state, &merchant_id).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move all of the blocklist logic to a separate function.
&merchant_id, | ||
card_number_fingerprint, | ||
)); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine all of these queries in a single query. You can use the WHERE IN
sql clause.
…-router * 'main' of github.com:juspay/hyperswitch: (84 commits) chore(config): add merchant_secret config for webhooks for cashtocode and volt in wasm dashboard (#3333) chore(version): 2024.01.12.0 fix: update amount_capturable based on intent_status and payment flow (#3278) feat: add support for card extended bin in payment attempt (#3312) feat(connector): [cybersource] Implement 3DS flow for cards (#3290) chore: remove connector auth TOML files from `.gitignore` and `.dockerignore` (#3330) fix(refund): add merchant_connector_id in refund (#3303) feat(connector): [BOA/CYB] Store AVS response in connector_metadata (#3271) feat(outgoingwebhookevent): adding api for query to fetch outgoing webhook events log (#3310) feat(router): payment_method block (#3056) feat(connector): [Volt] Add support for refund webhooks (#3326) feat(users): invite user without email (#3328) feat(euclid_wasm): config changes for NMI (#3329) refactor(router): restricted list payment method Customer to api-key based (#3100) feat(connector): [BOA/Cyb] Include merchant metadata in capture and void requests (#3308) fix(router): add config to avoid connector tokenization for `apple pay` `simplified flow` (#3234) refactor(router): flagged order_details validation to skip validation (#3116) fix(core): surcharge with saved card failure (#3318) feat(payment_link): Added sdk layout option payment link (#3207) chore(version): 2024.01.11.0 ...
* 'main' of github.com:juspay/hyperswitch: (22 commits) chore(version): 2024.01.12.1 chore: add api reference for blocklist (#3336) chore(config): add merchant_secret config for webhooks for cashtocode and volt in wasm dashboard (#3333) chore(version): 2024.01.12.0 fix: update amount_capturable based on intent_status and payment flow (#3278) feat: add support for card extended bin in payment attempt (#3312) feat(connector): [cybersource] Implement 3DS flow for cards (#3290) chore: remove connector auth TOML files from `.gitignore` and `.dockerignore` (#3330) fix(refund): add merchant_connector_id in refund (#3303) feat(connector): [BOA/CYB] Store AVS response in connector_metadata (#3271) feat(outgoingwebhookevent): adding api for query to fetch outgoing webhook events log (#3310) feat(router): payment_method block (#3056) feat(connector): [Volt] Add support for refund webhooks (#3326) feat(users): invite user without email (#3328) feat(euclid_wasm): config changes for NMI (#3329) refactor(router): restricted list payment method Customer to api-key based (#3100) feat(connector): [BOA/Cyb] Include merchant metadata in capture and void requests (#3308) fix(router): add config to avoid connector tokenization for `apple pay` `simplified flow` (#3234) refactor(router): flagged order_details validation to skip validation (#3116) fix(core): surcharge with saved card failure (#3318) ...
All the comments are addressed in this PR :) |
Type of Change
Description
This feature will allow the merchants to block the following according to their needs:
Additional Changes
Motivation and Context
Requested by Merchant.
How did you test it?
Refer to the attached postman collection for the API contracts for the blocklist APIs. Currently we support blocking three types of resources i.e. card numbers (payment intrument), card bin, and extended card bin.
For Card Bin and Extended Card Bin :-
For Payment Instrument :-
blocklist_api_postman.zip
Checklist
cargo +nightly fmt --all
cargo clippy