feat(apple_pay): add support for pre decrypted apple pay token (#2056)

Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in>
This commit is contained in:
Shankar Singh C
2023-09-07 22:49:10 +05:30
committed by GitHub
parent 81c6480bdf
commit 75ee632782
34 changed files with 1174 additions and 227 deletions

View File

@ -119,6 +119,8 @@ pub enum ConnectorError {
MissingConnectorTransactionID,
#[error("Missing connector refund ID")]
MissingConnectorRefundID,
#[error("Missing apple pay tokenization data")]
MissingApplePayTokenData,
#[error("Webhooks not implemented for this connector")]
WebhooksNotImplemented,
#[error("Failed to decode webhook event body")]
@ -250,6 +252,22 @@ pub enum WebhooksFlowError {
MissingRequiredField { field_name: &'static str },
}
#[derive(Debug, thiserror::Error)]
pub enum ApplePayDecryptionError {
#[error("Failed to base64 decode input data")]
Base64DecodingFailed,
#[error("Failed to decrypt input data")]
DecryptionFailed,
#[error("Certificate parsing failed")]
CertificateParsingFailed,
#[error("Certificate parsing failed")]
MissingMerchantId,
#[error("Key Deserialization failure")]
KeyDeserializationFailed,
#[error("Failed to Derive a shared secret key")]
DerivingSharedSecretKeyFailed,
}
impl ConnectorError {
pub fn is_connector_timeout(&self) -> bool {
self == &Self::RequestTimeoutReceived