Skip to content

Commit

Permalink
feat(connector): add dynamic duitnow qr code, google pay and applpe p…
Browse files Browse the repository at this point in the history
…ay for fiuu (#6204)

Co-authored-by: Chikke Srujan <[email protected]>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and venkatesh-juspay committed Oct 10, 2024
1 parent a3c2694 commit 50aa48b
Show file tree
Hide file tree
Showing 6 changed files with 634 additions and 168 deletions.
76 changes: 75 additions & 1 deletion crates/connector_configs/toml/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4106,9 +4106,83 @@ api_secret="Shared Secret"
payment_method_type = "UnionPay"
[[fiuu.real_time_payment]]
payment_method_type = "duit_now"
[[fiuu.wallet]]
payment_method_type = "google_pay"
[[fiuu.wallet]]
payment_method_type = "apple_pay"
[[fiuu.bank_redirect]]
payment_method_type = "online_banking_fpx"
[fiuu.connector_auth.SignatureKey]
api_key="Verify Key"
key1="Merchant ID"
api_secret="Secret Key"
api_secret="Secret Key"
[[fiuu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"

[[fiuu.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[fiuu.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[fiuu.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
76 changes: 75 additions & 1 deletion crates/connector_configs/toml/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3103,9 +3103,83 @@ api_secret="Shared Secret"
payment_method_type = "UnionPay"
[[fiuu.real_time_payment]]
payment_method_type = "duit_now"
[[fiuu.wallet]]
payment_method_type = "google_pay"
[[fiuu.wallet]]
payment_method_type = "apple_pay"
[[fiuu.bank_redirect]]
payment_method_type = "online_banking_fpx"
[fiuu.connector_auth.SignatureKey]
api_key="Verify Key"
key1="Merchant ID"
api_secret="Secret Key"
api_secret="Secret Key"
[[fiuu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"

[[fiuu.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[fiuu.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[fiuu.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
76 changes: 75 additions & 1 deletion crates/connector_configs/toml/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4100,9 +4100,83 @@ api_secret="Shared Secret"
payment_method_type = "UnionPay"
[[fiuu.real_time_payment]]
payment_method_type = "duit_now"
[[fiuu.wallet]]
payment_method_type = "google_pay"
[[fiuu.wallet]]
payment_method_type = "apple_pay"
[[fiuu.bank_redirect]]
payment_method_type = "online_banking_fpx"
[fiuu.connector_auth.SignatureKey]
api_key="Verify Key"
key1="Merchant ID"
api_secret="Secret Key"
api_secret="Secret Key"
[[fiuu.metadata.google_pay]]
name="merchant_name"
label="Google Pay Merchant Name"
placeholder="Enter Google Pay Merchant Name"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="merchant_id"
label="Google Pay Merchant Id"
placeholder="Enter Google Pay Merchant Id"
required=true
type="Text"
[[fiuu.metadata.google_pay]]
name="gateway_merchant_id"
label="Google Pay Merchant Key"
placeholder="Enter Google Pay Merchant Key"
required=true
type="Text"

[[fiuu.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
placeholder="Enter Merchant Certificate (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="certificate_keys"
label="Merchant PrivateKey (Base64 Encoded)"
placeholder="Enter Merchant PrivateKey (Base64 Encoded)"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_identifier"
label="Apple Merchant Identifier"
placeholder="Enter Apple Merchant Identifier"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="display_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="initiative"
label="Domain"
placeholder="Enter Domain"
required=true
type="Select"
options=["web","ios"]
[[fiuu.metadata.apple_pay]]
name="initiative_context"
label="Domain Name"
placeholder="Enter Domain Name"
required=true
type="Text"
[[fiuu.metadata.apple_pay]]
name="merchant_business_country"
label="Merchant Business Country"
placeholder="Enter Merchant Business Country"
required=true
type="Select"
options=[]
[[fiuu.metadata.apple_pay]]
name="payment_processing_details_at"
label="Payment Processing Details At"
placeholder="Enter Payment Processing Details At"
required=true
type="Radio"
options=["Connector","Hyperswitch"]
20 changes: 7 additions & 13 deletions crates/hyperswitch_connectors/src/connectors/fiuu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub mod transformers;

use std::collections::HashMap;

use common_enums::{CaptureMethod, PaymentMethod, PaymentMethodType};
use common_enums::{CaptureMethod, PaymentMethodType};
use common_utils::{
errors::{self as common_errors, CustomResult},
ext_traits::BytesExt,
Expand Down Expand Up @@ -230,19 +230,13 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData

fn get_url(
&self,
req: &PaymentsAuthorizeRouterData,
_req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
match req.payment_method {
PaymentMethod::RealTimePayment => {
let base_url = connectors.fiuu.third_base_url.clone();
Ok(format!("{}RMS/API/staticqr/index.php", base_url))
}
_ => Ok(format!(
"{}RMS/API/Direct/1.4.0/index.php",
self.base_url(connectors)
)),
}
Ok(format!(
"{}RMS/API/Direct/1.4.0/index.php",
self.base_url(connectors)
))
}

fn get_request_body(
Expand All @@ -257,7 +251,7 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
)?;

let connector_router_data = fiuu::FiuuRouterData::from((amount, req));
let payment_request = fiuu::FiuuPaymentsRequest::try_from(&connector_router_data)?;
let payment_request = fiuu::FiuuPaymentRequest::try_from(&connector_router_data)?;
let connector_req = build_form_from_struct(payment_request)
.change_context(errors::ConnectorError::ParsingFailed)?;
Ok(RequestContent::FormData(connector_req))
Expand Down
Loading

0 comments on commit 50aa48b

Please sign in to comment.