feat(router): add api models and openapi changes for payments submit eligibility api#9568
feat(router): add api models and openapi changes for payments submit eligibility api#9568Gnanasundari24 merged 5 commits intomainfrom
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.
in v2, this should come from header. Authorization
There was a problem hiding this comment.
This is a V1 api model
There was a problem hiding this comment.
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.
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>, |
crates/api_models/src/payments.rs
Outdated
| 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.
When payment_method is a mandatory field, how come payment_method_type is optional?
There was a problem hiding this comment.
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.
This is Next action means, then is this CheckEligibility?
There was a problem hiding this comment.
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
…tch into add-eligibility-post-api
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 devlocally to test api-reference changesChecklist
cargo +nightly fmt --allcargo clippy