feat(connector): [Stripe] Add support for WeChat Pay and Qr code support in next action (#1555)

Co-authored-by: AkshayaFoiger <akshaya.shankar@juspay.in>
Co-authored-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
This commit is contained in:
Sangamesh Kulkarni
2023-07-06 15:29:18 +05:30
committed by GitHub
parent ca4e242d20
commit a15a77dea3
8 changed files with 140 additions and 27 deletions

View File

@ -9,6 +9,7 @@ use common_utils::{
use masking::{PeekInterface, Secret};
use router_derive::Setter;
use time::PrimitiveDateTime;
use url::Url;
use utoipa::ToSchema;
use crate::{
@ -177,7 +178,7 @@ pub struct PaymentsRequest {
/// The URL to redirect after the completion of the operation
#[schema(value_type = Option<String>, example = "https://hyperswitch.io")]
pub return_url: Option<url::Url>,
pub return_url: Option<Url>,
/// Indicates that you intend to make future payments with this Payments payment method. Providing this parameter will attach the payment method to the Customer, if present, after the Payment is confirmed and any required actions from the user are complete.
#[schema(value_type = Option<FutureUsage>, example = "off_session")]
pub setup_future_usage: Option<api_enums::FutureUsage>,
@ -920,6 +921,8 @@ pub enum WalletData {
SamsungPay(Box<SamsungPayWalletData>),
/// The wallet data for WeChat Pay Redirection
WeChatPayRedirect(Box<WeChatPayRedirection>),
/// The wallet data for WeChat Pay
WeChatPay(Box<WeChatPay>),
}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
@ -959,6 +962,9 @@ pub struct ApplePayThirdPartySdkData {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPayRedirection {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct WeChatPay {}
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct PaypalRedirection {}
@ -1229,8 +1235,13 @@ pub enum NextActionData {
DisplayBankTransferInformation {
bank_transfer_steps_and_charges_details: BankTransferNextStepsData,
},
/// contains third party sdk session token response
/// Contains third party sdk session token response
ThirdPartySdkSessionToken { session_token: Option<SessionToken> },
/// Contains url for Qr code image, this qr code has to be shown in sdk
QrCodeInformation {
#[schema(value_type = String)]
image_data_url: Url,
},
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
@ -1242,6 +1253,11 @@ pub struct BankTransferNextStepsData {
pub receiver: ReceiverDetails,
}
#[derive(Clone, Debug, serde::Deserialize)]
pub struct QrCodeNextStepsInstruction {
pub image_data_url: Url,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum BankTransferInstructions {