-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(router): add api models and openapi changes for payments submit eligibility api #9568
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
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
pub struct PaymentsEligibilityRequest { | ||
/// Token used for client side verification | ||
#[schema(value_type = String, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] | ||
pub client_secret: Secret<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.
in v2, this should come from header. Authorization
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.
This is a V1 api model
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.
Its not about v1 and v2, unification of auth required this needs to be in headers. So move this header in a separate PR
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.
Add a tracking issue @sai-harsha-vardhan
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.
Done - #9577
pub struct PaymentsEligibilityRequest { | ||
/// Token used for client side verification | ||
#[schema(value_type = String, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] | ||
pub client_secret: Secret<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.
Its not about v1 and v2, unification of auth required this needs to be in headers. So move this header in a separate PR
pub struct PaymentsEligibilityRequest { | ||
/// Token used for client side verification | ||
#[schema(value_type = String, example = "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo")] | ||
pub client_secret: Secret<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.
Add a tracking issue @sai-harsha-vardhan
pub payment_method: api_enums::PaymentMethod, | ||
/// The payment method type to be used for the payment | ||
#[schema(value_type = Option<PaymentMethodType>)] | ||
pub payment_method_type: Option<api_enums::PaymentMethodType>, |
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.
When payment_method is a mandatory field, how come payment_method_type is optional?
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.
This is required for card payment_method as sending credit / debit is optional
/// The next action call is Complete Authorize | ||
CompleteAuthorize, | ||
/// The next action is to await for a merchant callback | ||
AwaitMerchantCallback, |
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.
This is Next action means, then is this CheckEligibility
?
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.
SDK Next action indicates the action to be done by SDK, in this case SDK has to await for merchant callback and merchant is the one who is doing CheckEligibility here
Type of Change
Description
add api models and openapi changes for payments submit eligibility api
Additional Changes
Motivation and Context
Introduce a /eligibility POST API that the SDK can call before payments confirm to decide the course of action for that particular payment. This can include the next action block, extended payment method information, payment method eligibility, temp payment method data, etc.
How did you test it?
Testing is not required as this PR contains only api model changes, core flow to be added
Run
mintlify dev
locally to test api-reference changesChecklist
cargo +nightly fmt --all
cargo clippy