feat(core): accept payment_confirm_source header in capture call and store in payment_intent (#2116)

This commit is contained in:
Hrithikesh
2023-09-11 12:12:28 +05:30
committed by GitHub
parent 28b102de24
commit 2f272d2962
35 changed files with 207 additions and 21 deletions

View File

@ -124,7 +124,7 @@ pub struct PaymentsRequest {
pub currency: Option<api_enums::Currency>,
/// This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method.
#[schema(value_type = Option<CaptureMethod>, example = "PaymentProcessor")]
#[schema(value_type = Option<CaptureMethod>, example = "automatic")]
pub capture_method: Option<api_enums::CaptureMethod>,
/// The Amount to be captured/ debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,
@ -300,6 +300,11 @@ pub struct PaymentsRequest {
pub profile_id: Option<String>,
}
#[derive(Default, Debug, Clone, Copy)]
pub struct HeaderPayload {
pub payment_confirm_source: Option<api_enums::PaymentSource>,
}
#[derive(
Default, Debug, serde::Serialize, Clone, PartialEq, ToSchema, router_derive::PolymorphicSchema,
)]
@ -1775,7 +1780,7 @@ pub struct PaymentsResponse {
pub capture_on: Option<PrimitiveDateTime>,
/// This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method.
#[schema(value_type = Option<CaptureMethod>, example = "PaymentProcessor")]
#[schema(value_type = Option<CaptureMethod>, example = "automatic")]
pub capture_method: Option<api_enums::CaptureMethod>,
/// The payment method that is to be used