Dataset Viewer
repo
stringclasses 1
value | instance_id
stringlengths 22
24
| problem_statement
stringlengths 24
24.1k
| patch
stringlengths 0
1.9M
| test_patch
stringclasses 1
value | created_at
stringdate 2022-11-25 05:12:07
2025-10-09 08:44:51
| hints_text
stringlengths 11
235k
| base_commit
stringlengths 40
40
|
---|---|---|---|---|---|---|---|
juspay/hyperswitch
|
juspay__hyperswitch-9755
|
Bug: [BUG] Migration runner fails due to Just already present
### Description:
In `docker-compose.yml`, the `migration-runner` service fails if we run `docker compose up` more than once, because, the `just` installer doesn't handle the case where just is already installed.
### Solution:
Add a conditional check to run `just` installer only if `just` is not present already.
|
diff --git a/docker-compose.yml b/docker-compose.yml
index e16dd74466b..4e2600c8344 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -63,7 +63,9 @@ services:
bash -c "
apt-get update && apt-get install -y curl xz-utils &&
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/diesel-rs/diesel/releases/latest/download/diesel_cli-installer.sh | bash &&
- curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin &&
+ if ! command -v just >/dev/null 2>&1; then
+ curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
+ fi &&
export PATH="$${PATH}:$${HOME}/.cargo/bin" &&
just migrate"
working_dir: /app
|
2025-10-08T10:15:48Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
The migration-runner service in the `docker-compose.yml` file fails during a second deployment as `just` installer raises `just already installed` error. This PR fixes that issue issue by adding a conditional statement which calls the just installer only when just command is not available.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
N/A
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Ran `docker compose up -d` twice.
<img width="476" height="491" alt="Screenshot 2025-10-08 at 3 44 53 PM" src="https://github.com/user-attachments/assets/c9de99cd-ac3a-4ab9-8c4e-5a1bb8d48d84" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
b52aafa8873fc4704bd69014cc457daf32d5523c
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9715
|
Bug: Create indexes for tracker tables in v2_compatible_migrations
|
diff --git a/v2_compatible_migrations/2025-10-07-131000_add_indexes_on_id_columns/down.sql b/v2_compatible_migrations/2025-10-07-131000_add_indexes_on_id_columns/down.sql
new file mode 100644
index 00000000000..fb18e635e20
--- /dev/null
+++ b/v2_compatible_migrations/2025-10-07-131000_add_indexes_on_id_columns/down.sql
@@ -0,0 +1,22 @@
+-- Drop unique indexes on id columns
+-- This will remove the unique indexes created for id column performance optimization and data integrity
+
+-- tracker tables
+DROP INDEX IF EXISTS customers_id_index;
+
+DROP INDEX IF EXISTS payment_intent_id_index;
+
+DROP INDEX IF EXISTS payment_attempt_id_index;
+
+DROP INDEX IF EXISTS payment_methods_id_index;
+
+DROP INDEX IF EXISTS refund_id_index;
+
+-- Accounts tables
+DROP INDEX IF EXISTS business_profile_id_index;
+
+DROP INDEX IF EXISTS merchant_account_id_index;
+
+DROP INDEX IF EXISTS merchant_connector_account_id_index;
+
+DROP INDEX IF EXISTS organization_id_index;
diff --git a/v2_compatible_migrations/2025-10-07-131000_add_indexes_on_id_columns/up.sql b/v2_compatible_migrations/2025-10-07-131000_add_indexes_on_id_columns/up.sql
new file mode 100644
index 00000000000..a8e27af1485
--- /dev/null
+++ b/v2_compatible_migrations/2025-10-07-131000_add_indexes_on_id_columns/up.sql
@@ -0,0 +1,21 @@
+-- Create unique indexes on id columns for better query performance and data integrity
+
+-- Tracker Tables
+CREATE UNIQUE INDEX IF NOT EXISTS customers_id_index ON customers (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS payment_intent_id_index ON payment_intent (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS payment_attempt_id_index ON payment_attempt (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS payment_methods_id_index ON payment_methods (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS refund_id_index ON refund (id);
+
+-- Accounts Tables
+CREATE UNIQUE INDEX IF NOT EXISTS business_profile_id_index ON business_profile (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS merchant_account_id_index ON merchant_account (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS merchant_connector_account_id_index ON merchant_connector_account (id);
+
+CREATE UNIQUE INDEX IF NOT EXISTS organization_id_index ON organization (id);
|
2025-10-07T08:02:36Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Since `id` column is introduced as varchar for a few major tracker tables in v2, index creation was missed in v2_compatible_migrations directory. This PR includes that.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
To improve DB query time.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Ran diesel migrations
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
cc4eaed5702dbcaa6c54a32714b52f479dfbe85b
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9761
|
Bug: [CHORE] add metrics for ignored incoming webhooks
In some scenarios, application need to acknowledge webhook requests with 200 even though the resource was not found for avoiding the webhooks to queue in connector systems. For such scenarios, incoming webhook flow can fail and even then the response is 200.
A metric needs to be introduced to keep an eye on the volume of such scenarios happening.
|
diff --git a/crates/router/src/core/metrics.rs b/crates/router/src/core/metrics.rs
index efb463b3a37..4110f470cee 100644
--- a/crates/router/src/core/metrics.rs
+++ b/crates/router/src/core/metrics.rs
@@ -48,6 +48,7 @@ counter_metric!(
WEBHOOK_EVENT_TYPE_IDENTIFICATION_FAILURE_COUNT,
GLOBAL_METER
);
+counter_metric!(WEBHOOK_FLOW_FAILED_BUT_ACKNOWLEDGED, GLOBAL_METER);
counter_metric!(ROUTING_CREATE_REQUEST_RECEIVED, GLOBAL_METER);
counter_metric!(ROUTING_CREATE_SUCCESS_RESPONSE, GLOBAL_METER);
diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rs
index ce183002834..0e8b879f456 100644
--- a/crates/router/src/core/webhooks/incoming.rs
+++ b/crates/router/src/core/webhooks/incoming.rs
@@ -284,6 +284,7 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(
&connector,
connector_name.as_str(),
&request_details,
+ merchant_context.get_merchant_account().get_id(),
);
match error_result {
Ok((response, webhook_tracker, serialized_request)) => {
@@ -373,6 +374,7 @@ async fn incoming_webhooks_core<W: types::OutgoingWebhookType>(
&connector,
connector_name.as_str(),
&final_request_details,
+ merchant_context.get_merchant_account().get_id(),
);
match error_result {
Ok((_, webhook_tracker, _)) => webhook_tracker,
@@ -559,8 +561,13 @@ async fn process_webhook_business_logic(
{
Ok(mca) => mca,
Err(error) => {
- let result =
- handle_incoming_webhook_error(error, connector, connector_name, request_details);
+ let result = handle_incoming_webhook_error(
+ error,
+ connector,
+ connector_name,
+ request_details,
+ merchant_context.get_merchant_account().get_id(),
+ );
match result {
Ok((_, webhook_tracker, _)) => return Ok(webhook_tracker),
Err(e) => return Err(e),
@@ -850,8 +857,13 @@ async fn process_webhook_business_logic(
match result_response {
Ok(response) => Ok(response),
Err(error) => {
- let result =
- handle_incoming_webhook_error(error, connector, connector_name, request_details);
+ let result = handle_incoming_webhook_error(
+ error,
+ connector,
+ connector_name,
+ request_details,
+ merchant_context.get_merchant_account().get_id(),
+ );
match result {
Ok((_, webhook_tracker, _)) => Ok(webhook_tracker),
Err(e) => Err(e),
@@ -865,6 +877,7 @@ fn handle_incoming_webhook_error(
connector: &ConnectorEnum,
connector_name: &str,
request_details: &IncomingWebhookRequestDetails<'_>,
+ merchant_id: &common_utils::id_type::MerchantId,
) -> errors::RouterResult<(
services::ApplicationResponse<serde_json::Value>,
WebhookResponseTracker,
@@ -881,6 +894,13 @@ fn handle_incoming_webhook_error(
// get the error response from the connector
if connector_enum.should_acknowledge_webhook_for_resource_not_found_errors() {
+ metrics::WEBHOOK_FLOW_FAILED_BUT_ACKNOWLEDGED.add(
+ 1,
+ router_env::metric_attributes!(
+ ("connector", connector_name.to_string()),
+ ("merchant_id", merchant_id.get_string_repr().to_string())
+ ),
+ );
let response = connector
.get_webhook_api_response(
request_details,
|
2025-10-09T08:44:51Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds a metric `WEBHOOK_FLOW_FAILED_BUT_ACKNOWLEDGED` to track incoming webhooks that failed processing but were acknowledged with 200 status to prevent queueing in connector systems.
The metric includes the following attributes:
- connector
- merchant_id
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
In some scenarios, applications need to acknowledge webhook requests with 200 even though the resource was not found, to avoid webhooks queueing in connector systems. This metric provides visibility into the volume of such scenarios, enabling better monitoring and alerting (if needed).
## How did you test it?
Cannot be tested. Metrics will be visible on Grafana.
Can be queried using:
```promql
webhook_flow_failed_but_acknowledged_total{connector="adyen",merchant_id="merchant_123"}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
35a20f8e4aac0fcfe6c409964391f2222f3c6770
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9747
|
Bug: [FEATURE] Multisafepay wasm changes
### Feature Description
Add the following payment methods in wasm for multisafepay
TRUSTLY
ALIPAY
WE CHAT PAY
EPS
MBway
Sofort
### Possible Implementation
[
### Have you spent some time checking if this feature request has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None
|
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index 027c82e3af8..6729c0add3d 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -2860,6 +2860,18 @@ api_secret="Merchant Id"
api_key="Enter API Key"
[multisafepay.connector_webhook_details]
merchant_secret="Source verification key"
+[[multisafepay.bank_redirect]]
+payment_method_type = "trustly"
+[[multisafepay.bank_redirect]]
+payment_method_type = "eps"
+[[multisafepay.bank_redirect]]
+payment_method_type = "sofort"
+[[multisafepay.wallet]]
+payment_method_type = "ali_pay"
+[[multisafepay.wallet]]
+payment_method_type = "we_chat_pay"
+[[multisafepay.wallet]]
+payment_method_type = "mb_way"
[[multisafepay.metadata.google_pay]]
name="merchant_name"
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index 93d7d1f26e7..170886bc095 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -2471,7 +2471,18 @@ payment_method_type = "UnionPay"
api_key = "Enter API Key"
[multisafepay.connector_webhook_details]
merchant_secret = "Source verification key"
-
+[[multisafepay.bank_redirect]]
+payment_method_type = "trustly"
+[[multisafepay.bank_redirect]]
+payment_method_type = "eps"
+[[multisafepay.bank_redirect]]
+payment_method_type = "sofort"
+[[multisafepay.wallet]]
+payment_method_type = "ali_pay"
+[[multisafepay.wallet]]
+payment_method_type = "we_chat_pay"
+[[multisafepay.wallet]]
+payment_method_type = "mb_way"
[nexinets]
[[nexinets.credit]]
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index 77ade3ef742..63b5b3f2d8e 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -2906,7 +2906,18 @@ placeholder = "Enter Allowed Auth Methods"
required = true
type = "MultiSelect"
options = ["PAN_ONLY", "CRYPTOGRAM_3DS"]
-
+[[multisafepay.bank_redirect]]
+payment_method_type = "trustly"
+[[multisafepay.bank_redirect]]
+payment_method_type = "eps"
+[[multisafepay.bank_redirect]]
+payment_method_type = "sofort"
+[[multisafepay.wallet]]
+payment_method_type = "ali_pay"
+[[multisafepay.wallet]]
+payment_method_type = "we_chat_pay"
+[[multisafepay.wallet]]
+payment_method_type = "mb_way"
[nexinets]
[[nexinets.credit]]
|
2025-10-08T10:20:42Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Add the following payment methods in wasm for multisafepay
- TRUSTLY
- ALIPAY
- WE CHAT PAY
- EPS
- MBway
- Sofort
Just dashboard changes and no need test cases from BE
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
b52aafa8873fc4704bd69014cc457daf32d5523c
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9705
|
Bug: [FEATURE] Add Client Auth for Subscriptions APIs
### Feature Description
Need to implement auth for client side interactions
### Possible Implementation
Subscriptions APIs need to support publishible_key + client_secret auth
### Have you spent some time checking if this feature request has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR!
|
diff --git a/crates/api_models/src/subscription.rs b/crates/api_models/src/subscription.rs
index 2829d58b883..7c89eec5e52 100644
--- a/crates/api_models/src/subscription.rs
+++ b/crates/api_models/src/subscription.rs
@@ -74,6 +74,12 @@ pub struct SubscriptionResponse {
/// Optional customer ID associated with this subscription.
pub customer_id: common_utils::id_type::CustomerId,
+
+ /// Payment details for the invoice.
+ pub payment: Option<PaymentResponseData>,
+
+ /// Invoice Details for the subscription.
+ pub invoice: Option<Invoice>,
}
/// Possible states of a subscription lifecycle.
@@ -127,6 +133,8 @@ impl SubscriptionResponse {
merchant_id: common_utils::id_type::MerchantId,
client_secret: Option<Secret<String>>,
customer_id: common_utils::id_type::CustomerId,
+ payment: Option<PaymentResponseData>,
+ invoice: Option<Invoice>,
) -> Self {
Self {
id,
@@ -138,6 +146,8 @@ impl SubscriptionResponse {
merchant_id,
coupon_code: None,
customer_id,
+ payment,
+ invoice,
}
}
}
@@ -181,6 +191,10 @@ impl ClientSecret {
pub fn as_str(&self) -> &str {
&self.0
}
+
+ pub fn as_string(&self) -> &String {
+ &self.0
+ }
}
#[derive(serde::Deserialize, serde::Serialize, Debug)]
@@ -197,6 +211,7 @@ impl ApiEventMetric for GetPlansResponse {}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct ConfirmSubscriptionPaymentDetails {
+ pub shipping: Option<Address>,
pub payment_method: api_enums::PaymentMethod,
pub payment_method_type: Option<api_enums::PaymentMethodType>,
pub payment_method_data: PaymentMethodDataRequest,
@@ -278,7 +293,7 @@ pub struct PaymentResponseData {
pub error_code: Option<String>,
pub error_message: Option<String>,
pub payment_method_type: Option<api_enums::PaymentMethodType>,
- pub client_secret: Option<String>,
+ pub client_secret: Option<Secret<String>>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
@@ -294,7 +309,7 @@ pub struct CreateMitPaymentRequestData {
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct ConfirmSubscriptionRequest {
/// Client secret for SDK based interaction.
- pub client_secret: Option<String>,
+ pub client_secret: Option<ClientSecret>,
/// Identifier for the associated plan_id.
pub plan_id: Option<String>,
@@ -305,15 +320,6 @@ pub struct ConfirmSubscriptionRequest {
/// Idenctifier for the coupon code for the subscription.
pub coupon_code: Option<String>,
- /// Identifier for customer.
- pub customer_id: common_utils::id_type::CustomerId,
-
- /// Billing address for the subscription.
- pub billing: Option<Address>,
-
- /// Shipping address for the subscription.
- pub shipping: Option<Address>,
-
/// Payment details for the invoice.
pub payment_details: ConfirmSubscriptionPaymentDetails,
}
@@ -328,11 +334,15 @@ impl ConfirmSubscriptionRequest {
}
pub fn get_billing_address(&self) -> Result<Address, error_stack::Report<ValidationError>> {
- self.billing.clone().ok_or(error_stack::report!(
- ValidationError::MissingRequiredField {
- field_name: "billing".to_string()
- }
- ))
+ self.payment_details
+ .payment_method_data
+ .billing
+ .clone()
+ .ok_or(error_stack::report!(
+ ValidationError::MissingRequiredField {
+ field_name: "billing".to_string()
+ }
+ ))
}
}
diff --git a/crates/diesel_models/src/invoice.rs b/crates/diesel_models/src/invoice.rs
index 59ef0b272d5..2b93b0b4a62 100644
--- a/crates/diesel_models/src/invoice.rs
+++ b/crates/diesel_models/src/invoice.rs
@@ -23,6 +23,7 @@ pub struct InvoiceNew {
pub metadata: Option<SecretSerdeValue>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
+ pub connector_invoice_id: Option<String>,
}
#[derive(
@@ -49,6 +50,7 @@ pub struct Invoice {
pub metadata: Option<SecretSerdeValue>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
+ pub connector_invoice_id: Option<String>,
}
#[derive(Clone, Debug, Eq, PartialEq, AsChangeset, Deserialize)]
@@ -56,6 +58,7 @@ pub struct Invoice {
pub struct InvoiceUpdate {
pub status: Option<String>,
pub payment_method_id: Option<String>,
+ pub connector_invoice_id: Option<String>,
pub modified_at: time::PrimitiveDateTime,
pub payment_intent_id: Option<common_utils::id_type::PaymentId>,
}
@@ -75,6 +78,7 @@ impl InvoiceNew {
status: InvoiceStatus,
provider_name: Connector,
metadata: Option<SecretSerdeValue>,
+ connector_invoice_id: Option<String>,
) -> Self {
let id = common_utils::id_type::InvoiceId::generate();
let now = common_utils::date_time::now();
@@ -94,6 +98,7 @@ impl InvoiceNew {
metadata,
created_at: now,
modified_at: now,
+ connector_invoice_id,
}
}
}
@@ -102,11 +107,13 @@ impl InvoiceUpdate {
pub fn new(
payment_method_id: Option<String>,
status: Option<InvoiceStatus>,
+ connector_invoice_id: Option<String>,
payment_intent_id: Option<common_utils::id_type::PaymentId>,
) -> Self {
Self {
payment_method_id,
status: status.map(|status| status.to_string()),
+ connector_invoice_id,
payment_intent_id,
modified_at: common_utils::date_time::now(),
}
diff --git a/crates/diesel_models/src/schema.rs b/crates/diesel_models/src/schema.rs
index bd91c7843e9..e3cd4336b4f 100644
--- a/crates/diesel_models/src/schema.rs
+++ b/crates/diesel_models/src/schema.rs
@@ -750,6 +750,8 @@ diesel::table! {
metadata -> Nullable<Jsonb>,
created_at -> Timestamp,
modified_at -> Timestamp,
+ #[max_length = 64]
+ connector_invoice_id -> Nullable<Varchar>,
}
}
diff --git a/crates/diesel_models/src/schema_v2.rs b/crates/diesel_models/src/schema_v2.rs
index 560d1fc6468..07f9683e83d 100644
--- a/crates/diesel_models/src/schema_v2.rs
+++ b/crates/diesel_models/src/schema_v2.rs
@@ -762,6 +762,8 @@ diesel::table! {
metadata -> Nullable<Jsonb>,
created_at -> Timestamp,
modified_at -> Timestamp,
+ #[max_length = 64]
+ connector_invoice_id -> Nullable<Varchar>,
}
}
diff --git a/crates/router/src/core/subscription.rs b/crates/router/src/core/subscription.rs
index 2d3fd649669..5702f9b0a45 100644
--- a/crates/router/src/core/subscription.rs
+++ b/crates/router/src/core/subscription.rs
@@ -4,10 +4,7 @@ use api_models::subscription::{
use common_enums::connector_enums;
use common_utils::id_type::GenerateId;
use error_stack::ResultExt;
-use hyperswitch_domain_models::{
- api::ApplicationResponse, merchant_context::MerchantContext,
- router_response_types::subscriptions as subscription_response_types,
-};
+use hyperswitch_domain_models::{api::ApplicationResponse, merchant_context::MerchantContext};
use super::errors::{self, RouterResponse};
use crate::{
@@ -31,7 +28,7 @@ pub async fn create_subscription(
merchant_context: MerchantContext,
profile_id: common_utils::id_type::ProfileId,
request: subscription_types::CreateSubscriptionRequest,
-) -> RouterResponse<subscription_types::ConfirmSubscriptionResponse> {
+) -> RouterResponse<SubscriptionResponse> {
let subscription_id = common_utils::id_type::SubscriptionId::generate();
let profile =
@@ -68,7 +65,7 @@ pub async fn create_subscription(
.create_payment_with_confirm_false(subscription.handler.state, &request)
.await
.attach_printable("subscriptions: failed to create payment")?;
- let invoice_entry = invoice_handler
+ let invoice = invoice_handler
.create_invoice_entry(
&state,
billing_handler.merchant_connector_id,
@@ -78,6 +75,7 @@ pub async fn create_subscription(
connector_enums::InvoiceStatus::InvoiceCreated,
billing_handler.connector_data.connector_name,
None,
+ None,
)
.await
.attach_printable("subscriptions: failed to create invoice")?;
@@ -91,11 +89,7 @@ pub async fn create_subscription(
.await
.attach_printable("subscriptions: failed to update subscription")?;
- let response = subscription.generate_response(
- &invoice_entry,
- &payment,
- subscription_response_types::SubscriptionStatus::Created,
- )?;
+ let response = subscription.to_subscription_response(Some(payment), Some(&invoice))?;
Ok(ApplicationResponse::Json(response))
}
@@ -148,14 +142,12 @@ pub async fn get_subscription_plans(
.into_iter()
.map(subscription_types::SubscriptionPlanPrices::from)
.collect::<Vec<_>>(),
- })
+ });
}
-
Ok(ApplicationResponse::Json(response))
}
/// Creates and confirms a subscription in one operation.
-/// This method combines the creation and confirmation flow to reduce API calls
pub async fn create_and_confirm_subscription(
state: SessionState,
merchant_context: MerchantContext,
@@ -163,7 +155,6 @@ pub async fn create_and_confirm_subscription(
request: subscription_types::CreateAndConfirmSubscriptionRequest,
) -> RouterResponse<subscription_types::ConfirmSubscriptionResponse> {
let subscription_id = common_utils::id_type::SubscriptionId::generate();
-
let profile =
SubscriptionHandler::find_business_profile(&state, &merchant_context, &profile_id)
.await
@@ -240,6 +231,9 @@ pub async fn create_and_confirm_subscription(
.unwrap_or(connector_enums::InvoiceStatus::InvoiceCreated),
billing_handler.connector_data.connector_name,
None,
+ invoice_details
+ .clone()
+ .map(|invoice| invoice.id.get_string_repr().to_string()),
)
.await?;
@@ -292,13 +286,23 @@ pub async fn confirm_subscription(
SubscriptionHandler::find_business_profile(&state, &merchant_context, &profile_id)
.await
.attach_printable("subscriptions: failed to find business profile")?;
- let customer =
- SubscriptionHandler::find_customer(&state, &merchant_context, &request.customer_id)
- .await
- .attach_printable("subscriptions: failed to find customer")?;
let handler = SubscriptionHandler::new(&state, &merchant_context);
+ if let Some(client_secret) = request.client_secret.clone() {
+ handler
+ .find_and_validate_subscription(&client_secret.into())
+ .await?
+ };
+
let mut subscription_entry = handler.find_subscription(subscription_id).await?;
+ let customer = SubscriptionHandler::find_customer(
+ &state,
+ &merchant_context,
+ &subscription_entry.subscription.customer_id,
+ )
+ .await
+ .attach_printable("subscriptions: failed to find customer")?;
+
let invoice_handler = subscription_entry.get_invoice_handler(profile.clone());
let invoice = invoice_handler
.get_latest_invoice(&state)
@@ -331,7 +335,7 @@ pub async fn confirm_subscription(
.create_customer_on_connector(
&state,
subscription.customer_id.clone(),
- request.billing.clone(),
+ request.payment_details.payment_method_data.billing.clone(),
request
.payment_details
.payment_method_data
@@ -344,7 +348,7 @@ pub async fn confirm_subscription(
&state,
subscription,
request.item_price_id,
- request.billing,
+ request.payment_details.payment_method_data.billing,
)
.await?;
@@ -359,6 +363,9 @@ pub async fn confirm_subscription(
.clone()
.and_then(|invoice| invoice.status)
.unwrap_or(connector_enums::InvoiceStatus::InvoiceCreated),
+ invoice_details
+ .clone()
+ .map(|invoice| invoice.id.get_string_repr().to_string()),
)
.await?;
@@ -418,7 +425,7 @@ pub async fn get_subscription(
.await
.attach_printable("subscriptions: failed to get subscription entry in get_subscription")?;
- Ok(ApplicationResponse::Json(
- subscription.to_subscription_response(),
- ))
+ let response = subscription.to_subscription_response(None, None)?;
+
+ Ok(ApplicationResponse::Json(response))
}
diff --git a/crates/router/src/core/subscription/invoice_handler.rs b/crates/router/src/core/subscription/invoice_handler.rs
index 8cc026fb373..b7d5cb328fd 100644
--- a/crates/router/src/core/subscription/invoice_handler.rs
+++ b/crates/router/src/core/subscription/invoice_handler.rs
@@ -44,6 +44,7 @@ impl InvoiceHandler {
status: connector_enums::InvoiceStatus,
provider_name: connector_enums::Connector,
metadata: Option<pii::SecretSerdeValue>,
+ connector_invoice_id: Option<String>,
) -> errors::RouterResult<diesel_models::invoice::Invoice> {
let invoice_new = diesel_models::invoice::InvoiceNew::new(
self.subscription.id.to_owned(),
@@ -58,6 +59,7 @@ impl InvoiceHandler {
status,
provider_name,
metadata,
+ connector_invoice_id,
);
let invoice = state
@@ -79,10 +81,12 @@ impl InvoiceHandler {
payment_method_id: Option<Secret<String>>,
payment_intent_id: Option<common_utils::id_type::PaymentId>,
status: connector_enums::InvoiceStatus,
+ connector_invoice_id: Option<String>,
) -> errors::RouterResult<diesel_models::invoice::Invoice> {
let update_invoice = diesel_models::invoice::InvoiceUpdate::new(
payment_method_id.as_ref().map(|id| id.peek()).cloned(),
Some(status),
+ connector_invoice_id,
payment_intent_id,
);
state
@@ -189,8 +193,8 @@ impl InvoiceHandler {
) -> errors::RouterResult<subscription_types::PaymentResponseData> {
let payment_details = &request.payment_details;
let cit_payment_request = subscription_types::ConfirmPaymentsRequestData {
- billing: request.billing.clone(),
- shipping: request.shipping.clone(),
+ billing: request.payment_details.payment_method_data.billing.clone(),
+ shipping: request.payment_details.shipping.clone(),
payment_method: payment_details.payment_method,
payment_method_type: payment_details.payment_method_type,
payment_method_data: payment_details.payment_method_data.clone(),
diff --git a/crates/router/src/core/subscription/subscription_handler.rs b/crates/router/src/core/subscription/subscription_handler.rs
index b11cf517b03..b608faca5d5 100644
--- a/crates/router/src/core/subscription/subscription_handler.rs
+++ b/crates/router/src/core/subscription/subscription_handler.rs
@@ -19,7 +19,7 @@ use crate::{
core::{errors::StorageErrorExt, subscription::invoice_handler::InvoiceHandler},
db::CustomResult,
routes::SessionState,
- types::domain,
+ types::{domain, transformers::ForeignTryFrom},
};
pub struct SubscriptionHandler<'a> {
@@ -227,31 +227,16 @@ impl SubscriptionWithHandler<'_> {
price_id: None,
coupon: None,
billing_processor_subscription_id: self.subscription.connector_subscription_id.clone(),
- invoice: Some(subscription_types::Invoice {
- id: invoice.id.clone(),
- subscription_id: invoice.subscription_id.clone(),
- merchant_id: invoice.merchant_id.clone(),
- profile_id: invoice.profile_id.clone(),
- merchant_connector_id: invoice.merchant_connector_id.clone(),
- payment_intent_id: invoice.payment_intent_id.clone(),
- payment_method_id: invoice.payment_method_id.clone(),
- customer_id: invoice.customer_id.clone(),
- amount: invoice.amount,
- currency: api_enums::Currency::from_str(invoice.currency.as_str())
- .change_context(errors::ApiErrorResponse::InvalidDataValue {
- field_name: "currency",
- })
- .attach_printable(format!(
- "unable to parse currency name {currency:?}",
- currency = invoice.currency
- ))?,
- status: invoice.status.clone(),
- }),
+ invoice: Some(subscription_types::Invoice::foreign_try_from(invoice)?),
})
}
- pub fn to_subscription_response(&self) -> SubscriptionResponse {
- SubscriptionResponse::new(
+ pub fn to_subscription_response(
+ &self,
+ payment: Option<subscription_types::PaymentResponseData>,
+ invoice: Option<&diesel_models::invoice::Invoice>,
+ ) -> errors::RouterResult<SubscriptionResponse> {
+ Ok(SubscriptionResponse::new(
self.subscription.id.clone(),
self.subscription.merchant_reference_id.clone(),
SubscriptionStatus::from_str(&self.subscription.status)
@@ -261,7 +246,15 @@ impl SubscriptionWithHandler<'_> {
self.subscription.merchant_id.to_owned(),
self.subscription.client_secret.clone().map(Secret::new),
self.subscription.customer_id.clone(),
- )
+ payment,
+ invoice
+ .map(
+ |invoice| -> errors::RouterResult<subscription_types::Invoice> {
+ subscription_types::Invoice::foreign_try_from(invoice)
+ },
+ )
+ .transpose()?,
+ ))
}
pub async fn update_subscription(
@@ -369,3 +362,30 @@ impl SubscriptionWithHandler<'_> {
}
}
}
+
+impl ForeignTryFrom<&diesel_models::invoice::Invoice> for subscription_types::Invoice {
+ type Error = error_stack::Report<errors::ApiErrorResponse>;
+
+ fn foreign_try_from(invoice: &diesel_models::invoice::Invoice) -> Result<Self, Self::Error> {
+ Ok(Self {
+ id: invoice.id.clone(),
+ subscription_id: invoice.subscription_id.clone(),
+ merchant_id: invoice.merchant_id.clone(),
+ profile_id: invoice.profile_id.clone(),
+ merchant_connector_id: invoice.merchant_connector_id.clone(),
+ payment_intent_id: invoice.payment_intent_id.clone(),
+ payment_method_id: invoice.payment_method_id.clone(),
+ customer_id: invoice.customer_id.clone(),
+ amount: invoice.amount,
+ currency: api_enums::Currency::from_str(invoice.currency.as_str())
+ .change_context(errors::ApiErrorResponse::InvalidDataValue {
+ field_name: "currency",
+ })
+ .attach_printable(format!(
+ "unable to parse currency name {currency:?}",
+ currency = invoice.currency
+ ))?,
+ status: invoice.status.clone(),
+ })
+ }
+}
diff --git a/crates/router/src/core/webhooks/incoming.rs b/crates/router/src/core/webhooks/incoming.rs
index 657655c25bf..ce183002834 100644
--- a/crates/router/src/core/webhooks/incoming.rs
+++ b/crates/router/src/core/webhooks/incoming.rs
@@ -2645,6 +2645,7 @@ async fn subscription_incoming_webhook_flow(
InvoiceStatus::PaymentPending,
connector,
None,
+ None,
)
.await?;
@@ -2664,6 +2665,7 @@ async fn subscription_incoming_webhook_flow(
payment_response.payment_method_id.clone(),
Some(payment_response.payment_id.clone()),
InvoiceStatus::from(payment_response.status),
+ Some(mit_payment_data.invoice_id.get_string_repr().to_string()),
)
.await?;
diff --git a/crates/router/src/routes/subscription.rs b/crates/router/src/routes/subscription.rs
index 46432810450..b1b3397c46c 100644
--- a/crates/router/src/routes/subscription.rs
+++ b/crates/router/src/routes/subscription.rs
@@ -101,16 +101,25 @@ pub async fn confirm_subscription(
) -> impl Responder {
let flow = Flow::ConfirmSubscription;
let subscription_id = subscription_id.into_inner();
+ let payload = json_payload.into_inner();
let profile_id = match extract_profile_id(&req) {
Ok(id) => id,
Err(response) => return response,
};
+ let api_auth = auth::ApiKeyAuth::default();
+
+ let (auth_type, _) =
+ match auth::check_client_secret_and_get_auth(req.headers(), &payload, api_auth) {
+ Ok(auth) => auth,
+ Err(err) => return oss_api::log_and_return_error_response(error_stack::report!(err)),
+ };
+
Box::pin(oss_api::server_wrap(
flow,
state,
&req,
- json_payload.into_inner(),
+ payload,
|state, auth: auth::AuthenticationData, payload, _| {
let merchant_context = domain::MerchantContext::NormalMerchant(Box::new(
domain::Context(auth.merchant_account, auth.key_store),
@@ -124,10 +133,7 @@ pub async fn confirm_subscription(
)
},
auth::auth_type(
- &auth::HeaderAuth(auth::ApiKeyAuth {
- is_connected_allowed: false,
- is_platform_allowed: false,
- }),
+ &*auth_type,
&auth::JWTAuth {
permission: Permission::ProfileSubscriptionWrite,
},
@@ -146,28 +152,36 @@ pub async fn get_subscription_plans(
) -> impl Responder {
let flow = Flow::GetPlansForSubscription;
let api_auth = auth::ApiKeyAuth::default();
+ let payload = query.into_inner();
let profile_id = match extract_profile_id(&req) {
Ok(profile_id) => profile_id,
Err(response) => return response,
};
- let auth_data = match auth::is_ephemeral_auth(req.headers(), api_auth) {
- Ok(auth) => auth,
- Err(err) => return crate::services::api::log_and_return_error_response(err),
- };
+ let (auth_type, _) =
+ match auth::check_client_secret_and_get_auth(req.headers(), &payload, api_auth) {
+ Ok(auth) => auth,
+ Err(err) => return oss_api::log_and_return_error_response(error_stack::report!(err)),
+ };
Box::pin(oss_api::server_wrap(
flow,
state,
&req,
- query.into_inner(),
+ payload,
|state, auth: auth::AuthenticationData, query, _| {
let merchant_context = domain::MerchantContext::NormalMerchant(Box::new(
domain::Context(auth.merchant_account, auth.key_store),
));
subscription::get_subscription_plans(state, merchant_context, profile_id.clone(), query)
},
- &*auth_data,
+ auth::auth_type(
+ &*auth_type,
+ &auth::JWTAuth {
+ permission: Permission::ProfileSubscriptionRead,
+ },
+ req.headers(),
+ ),
api_locking::LockAction::NotApplicable,
))
.await
@@ -186,6 +200,7 @@ pub async fn get_subscription(
Ok(id) => id,
Err(response) => return response,
};
+
Box::pin(oss_api::server_wrap(
flow,
state,
@@ -244,10 +259,16 @@ pub async fn create_and_confirm_subscription(
payload.clone(),
)
},
- &auth::HeaderAuth(auth::ApiKeyAuth {
- is_connected_allowed: false,
- is_platform_allowed: false,
- }),
+ auth::auth_type(
+ &auth::HeaderAuth(auth::ApiKeyAuth {
+ is_connected_allowed: false,
+ is_platform_allowed: false,
+ }),
+ &auth::JWTAuth {
+ permission: Permission::ProfileSubscriptionWrite,
+ },
+ req.headers(),
+ ),
api_locking::LockAction::NotApplicable,
))
.await
diff --git a/crates/router/src/services/authentication.rs b/crates/router/src/services/authentication.rs
index 13d224a1cd7..4bbb1813833 100644
--- a/crates/router/src/services/authentication.rs
+++ b/crates/router/src/services/authentication.rs
@@ -4326,6 +4326,20 @@ impl ClientSecretFetch for api_models::payment_methods::PaymentMethodUpdate {
}
}
+#[cfg(feature = "v1")]
+impl ClientSecretFetch for api_models::subscription::ConfirmSubscriptionRequest {
+ fn get_client_secret(&self) -> Option<&String> {
+ self.client_secret.as_ref().map(|s| s.as_string())
+ }
+}
+
+#[cfg(feature = "v1")]
+impl ClientSecretFetch for api_models::subscription::GetPlansQuery {
+ fn get_client_secret(&self) -> Option<&String> {
+ self.client_secret.as_ref().map(|s| s.as_string())
+ }
+}
+
#[cfg(feature = "v1")]
impl ClientSecretFetch for api_models::authentication::AuthenticationEligibilityRequest {
fn get_client_secret(&self) -> Option<&String> {
diff --git a/crates/router/src/workflows/invoice_sync.rs b/crates/router/src/workflows/invoice_sync.rs
index c6daab02116..ec71af2b708 100644
--- a/crates/router/src/workflows/invoice_sync.rs
+++ b/crates/router/src/workflows/invoice_sync.rs
@@ -204,6 +204,7 @@ impl<'a> InvoiceSyncHandler<'a> {
None,
None,
common_enums::connector_enums::InvoiceStatus::from(invoice_sync_status),
+ Some(connector_invoice_id),
)
.await
.attach_printable("Failed to update invoice in DB")?;
diff --git a/migrations/2025-10-07-130304_add_connector_invoice_id/down.sql b/migrations/2025-10-07-130304_add_connector_invoice_id/down.sql
new file mode 100644
index 00000000000..85f8bcf59e5
--- /dev/null
+++ b/migrations/2025-10-07-130304_add_connector_invoice_id/down.sql
@@ -0,0 +1,3 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE invoice DROP COLUMN IF EXISTS connector_invoice_id;
+DROP INDEX IF EXISTS invoice_subscription_id_connector_invoice_id_index;
\ No newline at end of file
diff --git a/migrations/2025-10-07-130304_add_connector_invoice_id/up.sql b/migrations/2025-10-07-130304_add_connector_invoice_id/up.sql
new file mode 100644
index 00000000000..d17ca57da77
--- /dev/null
+++ b/migrations/2025-10-07-130304_add_connector_invoice_id/up.sql
@@ -0,0 +1,3 @@
+-- Your SQL goes here
+ALTER TABLE invoice ADD COLUMN IF NOT EXISTS connector_invoice_id VARCHAR(64);
+CREATE INDEX invoice_subscription_id_connector_invoice_id_index ON invoice (subscription_id, connector_invoice_id);
\ No newline at end of file
|
2025-10-07T12:46:18Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This pull request introduces several enhancements and refactors to the subscription API, focusing on improving authentication, response structure, and data handling. The main changes include adding payment and invoice details to subscription responses, updating authentication logic to support client secrets in queries, and refactoring handler methods for better error handling and extensibility.
**Subscription Response Improvements**
* Added `payment` and `invoice` fields to the `SubscriptionResponse` struct to provide more detailed information about payments and invoices associated with a subscription.
* Updated the `PaymentResponseData` struct to use a `Secret<String>` for the `client_secret` field, improving security and consistency.
**Authentication and Query Handling**
* Introduced a new `GetSubscriptionQuery` struct to allow passing a client secret when fetching subscription details, and implemented `ClientSecretFetch` for relevant subscription request/query types. [[1]](diffhunk://#diff-3d85d9e288cc67856867986ee406a3102ce1d0cf9fe5c8f9efed3a578608f817R206-R215) [[2]](diffhunk://#diff-c66a703d6e518900240c7296a4d6f9c55c9787ea8f490a419dd0395dc0b36d70R4329-R4349)
* Refactored authentication logic in subscription route handlers (`get_subscription`, `get_subscription_plans`, and `confirm_subscription`) to extract and validate client secrets from query payloads, improving security and flexibility. [[1]](diffhunk://#diff-d737ada25c830476b3867c693bd362d4b1142773f1b0d971556518b5c04691a3R104-R122) [[2]](diffhunk://#diff-d737ada25c830476b3867c693bd362d4b1142773f1b0d971556518b5c04691a3R149-R172) [[3]](diffhunk://#diff-d737ada25c830476b3867c693bd362d4b1142773f1b0d971556518b5c04691a3R184-R199) [[4]](diffhunk://#diff-d737ada25c830476b3867c693bd362d4b1142773f1b0d971556518b5c04691a3L205-R216)
**Handler and Response Refactoring**
* Refactored the `to_subscription_response` method in `SubscriptionWithHandler` to accept optional payment and invoice parameters, and handle invoice conversion with error reporting for invalid currency values. [[1]](diffhunk://#diff-1d71cc03e82ba9b3c7478b6304bd763431e20cc723881a1623ab3127301b8976L253-R258) [[2]](diffhunk://#diff-1d71cc03e82ba9b3c7478b6304bd763431e20cc723881a1623ab3127301b8976R268-R295)
* Updated core subscription logic to use the new response structure and refactored method signatures for consistency, including changes to how responses are generated and returned. [[1]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL34-R31) [[2]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL71-R68) [[3]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL94-R91) [[4]](diffhunk://#diff-adea1b33060886c62616ea56c46edb8f356525cbacea004da12e8819334cf27cL420-R412)
These changes collectively improve the robustness and extensibility of the subscription API, making it easier to integrate payment and invoice details while strengthening authentication mechanisms.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Subscription create
```
curl --location 'http://localhost:8080/subscriptions/create' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: pro_CohRshEanxkKSMHgyu6a' \
--header 'api-key: dev_tV0O30052zhBCqdrhGMfQxMN0DerXwnMkNHX6ndCbs0BovewetTaXznBQOCLGAi2' \
--data '{
"customer_id": "cus_d64F9yomaDMqbTDlxw3g",
"amount": 14100,
"currency": "USD",
"payment_details": {
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"capture_method": "automatic",
"return_url": "https://google.com"
}
}'
```
Response -
```
{"id":"sub_8zxmAZAfS0eTL8zRJRk7","merchant_reference_id":null,"status":"created","plan_id":null,"profile_id":"pro_CohRshEanxkKSMHgyu6a","client_secret":"sub_8zxmAZAfS0eTL8zRJRk7_secret_IGg9yCNzrzoziV3odFLt","merchant_id":"merchant_1759849271","coupon_code":null,"customer_id":"cus_d64F9yomaDMqbTDlxw3g","payment":{"payment_id":"pay_pPn6Tz2m3WrOIzANMF2g","status":"requires_payment_method","amount":14100,"currency":"USD","connector":null,"payment_method_id":null,"payment_experience":null,"error_code":null,"error_message":null,"payment_method_type":null,"client_secret":"pay_pPn6Tz2m3WrOIzANMF2g_secret_Wxi6r52cBxz0ujhcWpAh"},"invoice":{"id":"invoice_nEqu7GMVqNMRzBorC9BS","subscription_id":"sub_8zxmAZAfS0eTL8zRJRk7","merchant_id":"merchant_1759849271","profile_id":"pro_CohRshEanxkKSMHgyu6a","merchant_connector_id":"mca_S0OzkqOOhMZs2jJQPSZo","payment_intent_id":"pay_pPn6Tz2m3WrOIzANMF2g","payment_method_id":null,"customer_id":"cus_d64F9yomaDMqbTDlxw3g","amount":14100,"currency":"USD","status":"invoice_created"}}
```
2. Get plans
```
curl --location 'http://localhost:8080/subscriptions/plans?limit=2&offset=0&client_secret=sub_8zxmAZAfS0eTL8zRJRk7_secret_IGg9yCNzrzoziV3odFLt' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_febeb0fab3be43c79024efaf99764d63' \
--header 'X-Profile-Id: pro_CohRshEanxkKSMHgyu6a'
```
Response -
```
[{"plan_id":"cbdemo_enterprise-suite","name":"Enterprise Suite","description":"High-end customer support suite with enterprise-grade solutions.","price_id":[{"price_id":"cbdemo_enterprise-suite-monthly","plan_id":"cbdemo_enterprise-suite","amount":14100,"currency":"INR","interval":"Month","interval_count":1,"trial_period":null,"trial_period_unit":null},{"price_id":"cbdemo_enterprise-suite-annual","plan_id":"cbdemo_enterprise-suite","amount":169000,"currency":"INR","interval":"Year","interval_count":1,"trial_period":null,"trial_period_unit":null}]},{"plan_id":"cbdemo_business-suite","name":"Business Suite","description":"Advanced customer support plan with premium features.","price_id":[{"price_id":"cbdemo_business-suite-monthly","plan_id":"cbdemo_business-suite","amount":9600,"currency":"INR","interval":"Month","interval_count":1,"trial_period":null,"trial_period_unit":null},{"price_id":"cbdemo_business-suite-annual","plan_id":"cbdemo_business-suite","amount":115000,"currency":"INR","interval":"Year","interval_count":1,"trial_period":null,"trial_period_unit":null}]}]
```
3. Confirm subscription -
```
curl --location 'http://localhost:8080/subscriptions/sub_8zxmAZAfS0eTL8zRJRk7/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_CohRshEanxkKSMHgyu6a' \
--header 'api-key: pk_dev_febeb0fab3be43c79024efaf99764d63' \
--data '{
"item_price_id": "cbdemo_enterprise-suite-monthly",
"description": "Hello this is description",
"client_secret": "sub_8zxmAZAfS0eTL8zRJRk7_secret_IGg9yCNzrzoziV3odFLt",
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"payment_details": {
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
}
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
}
}
}'
```
Response -
```
{"id":"sub_8zxmAZAfS0eTL8zRJRk7","merchant_reference_id":null,"status":"active","plan_id":null,"price_id":null,"coupon":null,"profile_id":"pro_CohRshEanxkKSMHgyu6a","payment":{"payment_id":"pay_pPn6Tz2m3WrOIzANMF2g","status":"succeeded","amount":14100,"currency":"USD","connector":"stripe","payment_method_id":"pm_ZAtcND5u4SoRq6DnTQET","payment_experience":null,"error_code":null,"error_message":null,"payment_method_type":"credit","client_secret":"pay_pPn6Tz2m3WrOIzANMF2g_secret_Wxi6r52cBxz0ujhcWpAh"},"customer_id":"cus_d64F9yomaDMqbTDlxw3g","invoice":{"id":"invoice_nEqu7GMVqNMRzBorC9BS","subscription_id":"sub_8zxmAZAfS0eTL8zRJRk7","merchant_id":"merchant_1759849271","profile_id":"pro_CohRshEanxkKSMHgyu6a","merchant_connector_id":"mca_S0OzkqOOhMZs2jJQPSZo","payment_intent_id":"pay_pPn6Tz2m3WrOIzANMF2g","payment_method_id":"pm_ZAtcND5u4SoRq6DnTQET","customer_id":"cus_d64F9yomaDMqbTDlxw3g","amount":14100,"currency":"USD","status":"payment_pending"},"billing_processor_subscription_id":"sub_8zxmAZAfS0eTL8zRJRk7"}
```
invoice -
<img width="942" height="409" alt="image" src="https://github.com/user-attachments/assets/c674745e-428d-4a69-9c74-4732e160fb31" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
f2c2bd64393f24aaac9081622fde52752ae35593
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9711
|
Bug: [FEATURE] loonio webhooks
### Feature Description
Implement webhook support for loonio
### Possible Implementation
Implement Webhook - Payment
### Have you spent some time checking if this feature request has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None
|
diff --git a/crates/hyperswitch_connectors/src/connectors/loonio.rs b/crates/hyperswitch_connectors/src/connectors/loonio.rs
index 96ee717b862..1de6f4236d4 100644
--- a/crates/hyperswitch_connectors/src/connectors/loonio.rs
+++ b/crates/hyperswitch_connectors/src/connectors/loonio.rs
@@ -2,12 +2,13 @@ pub mod transformers;
use common_enums::enums;
use common_utils::{
+ crypto::Encryptable,
errors::CustomResult,
- ext_traits::BytesExt,
+ ext_traits::{ByteSliceExt, BytesExt},
request::{Method, Request, RequestBuilder, RequestContent},
types::{AmountConvertor, FloatMajorUnit, FloatMajorUnitForConnector},
};
-use error_stack::{report, ResultExt};
+use error_stack::ResultExt;
use hyperswitch_domain_models::{
payment_method_data::PaymentMethodData,
router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},
@@ -42,7 +43,7 @@ use hyperswitch_interfaces::{
webhooks,
};
use lazy_static::lazy_static;
-use masking::{ExposeInterface, Mask};
+use masking::{ExposeInterface, Mask, Secret};
use transformers as loonio;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -334,9 +335,9 @@ impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Loo
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {
- let response: loonio::LoonioTransactionSyncResponse = res
+ let response: loonio::LoonioPaymentResponseData = res
.response
- .parse_struct("loonio LoonioTransactionSyncResponse")
+ .parse_struct("loonio LoonioPaymentResponseData")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
@@ -588,25 +589,56 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Loonio {
#[async_trait::async_trait]
impl webhooks::IncomingWebhook for Loonio {
- fn get_webhook_object_reference_id(
+ async fn verify_webhook_source(
&self,
_request: &webhooks::IncomingWebhookRequestDetails<'_>,
+ _merchant_id: &common_utils::id_type::MerchantId,
+ _connector_webhook_details: Option<common_utils::pii::SecretSerdeValue>,
+ _connector_account_details: Encryptable<Secret<serde_json::Value>>,
+ _connector_name: &str,
+ ) -> CustomResult<bool, errors::ConnectorError> {
+ Ok(false)
+ }
+
+ fn get_webhook_object_reference_id(
+ &self,
+ request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {
- Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+ let webhook_body: loonio::LoonioWebhookBody = request
+ .body
+ .parse_struct("LoonioWebhookBody")
+ .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+
+ Ok(api_models::webhooks::ObjectReferenceId::PaymentId(
+ api_models::payments::PaymentIdType::ConnectorTransactionId(
+ webhook_body.api_transaction_id,
+ ),
+ ))
}
fn get_webhook_event_type(
&self,
- _request: &webhooks::IncomingWebhookRequestDetails<'_>,
+ request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<api_models::webhooks::IncomingWebhookEvent, errors::ConnectorError> {
- Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+ let webhook_body: loonio::LoonioWebhookBody = request
+ .body
+ .parse_struct("LoonioWebhookBody")
+ .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+ Ok((&webhook_body.event_code).into())
}
fn get_webhook_resource_object(
&self,
- _request: &webhooks::IncomingWebhookRequestDetails<'_>,
+ request: &webhooks::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<Box<dyn masking::ErasedMaskSerialize>, errors::ConnectorError> {
- Err(report!(errors::ConnectorError::WebhooksNotImplemented))
+ let webhook_body: loonio::LoonioWebhookBody = request
+ .body
+ .parse_struct("LoonioWebhookBody")
+ .change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
+
+ let resource = loonio::LoonioPaymentResponseData::Webhook(webhook_body);
+
+ Ok(Box::new(resource))
}
}
@@ -614,8 +646,8 @@ lazy_static! {
static ref LOONIO_SUPPORTED_PAYMENT_METHODS: SupportedPaymentMethods = {
let supported_capture_methods = vec![enums::CaptureMethod::Automatic];
- let mut gigadat_supported_payment_methods = SupportedPaymentMethods::new();
- gigadat_supported_payment_methods.add(
+ let mut loonio_supported_payment_methods = SupportedPaymentMethods::new();
+ loonio_supported_payment_methods.add(
enums::PaymentMethod::BankRedirect,
enums::PaymentMethodType::Interac,
PaymentMethodDetails {
@@ -626,7 +658,7 @@ lazy_static! {
},
);
- gigadat_supported_payment_methods
+ loonio_supported_payment_methods
};
static ref LOONIO_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
display_name: "Loonio",
@@ -634,7 +666,9 @@ lazy_static! {
connector_type: enums::HyperswitchConnectorCategory::PaymentGateway,
integration_status: enums::ConnectorIntegrationStatus::Sandbox,
};
- static ref LOONIO_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();
+ static ref LOONIO_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = vec![
+ enums::EventClass::Payments,
+ ];
}
impl ConnectorSpecifications for Loonio {
diff --git a/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs b/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs
index 7efc1a895dc..f1c594145b6 100644
--- a/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs
@@ -1,5 +1,6 @@
use std::collections::HashMap;
+use api_models::webhooks;
use common_enums::{enums, Currency};
use common_utils::{id_type, pii::Email, request::Method, types::FloatMajorUnit};
use hyperswitch_domain_models::{
@@ -18,7 +19,6 @@ use crate::{
types::{RefundsResponseRouterData, ResponseRouterData},
utils::{self, PaymentsAuthorizeRequestData, RouterData as _},
};
-
pub struct LoonioRouterData<T> {
pub amount: FloatMajorUnit,
pub router_data: T,
@@ -62,6 +62,8 @@ pub struct LoonioPaymentRequest {
pub payment_method_type: InteracPaymentMethodType,
#[serde(skip_serializing_if = "Option::is_none")]
pub redirect_url: Option<LoonioRedirectUrl>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub webhook_url: Option<String>,
}
#[derive(Debug, Serialize)]
@@ -102,7 +104,6 @@ impl TryFrom<&LoonioRouterData<&PaymentsAuthorizeRouterData>> for LoonioPaymentR
success_url: item.router_data.request.get_router_return_url()?,
failed_url: item.router_data.request.get_router_return_url()?,
};
-
Ok(Self {
currency_code: item.router_data.request.currency,
customer_profile,
@@ -111,6 +112,7 @@ impl TryFrom<&LoonioRouterData<&PaymentsAuthorizeRouterData>> for LoonioPaymentR
transaction_id,
payment_method_type: InteracPaymentMethodType::InteracEtransfer,
redirect_url: Some(redirect_url),
+ webhook_url: Some(item.router_data.request.get_webhook_url()?),
})
}
PaymentMethodData::BankRedirect(_) => Err(errors::ConnectorError::NotImplemented(
@@ -140,7 +142,9 @@ impl<F, T> TryFrom<ResponseRouterData<F, LoonioPaymentsResponse, T, PaymentsResp
Ok(Self {
status: enums::AttemptStatus::AuthenticationPending,
response: Ok(PaymentsResponseData::TransactionResponse {
- resource_id: ResponseId::ConnectorTransactionId(item.response.payment_form.clone()),
+ resource_id: ResponseId::ConnectorTransactionId(
+ item.data.connector_request_reference_id.clone(),
+ ),
redirection_data: Box::new(Some(RedirectForm::Form {
endpoint: item.response.payment_form,
method: Method::Get,
@@ -211,29 +215,48 @@ impl<F> TryFrom<&LoonioRouterData<&RefundsRouterData<F>>> for LoonioRefundReques
}
}
-impl<F, T> TryFrom<ResponseRouterData<F, LoonioTransactionSyncResponse, T, PaymentsResponseData>>
+impl<F, T> TryFrom<ResponseRouterData<F, LoonioPaymentResponseData, T, PaymentsResponseData>>
for RouterData<F, T, PaymentsResponseData>
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
- item: ResponseRouterData<F, LoonioTransactionSyncResponse, T, PaymentsResponseData>,
+ item: ResponseRouterData<F, LoonioPaymentResponseData, T, PaymentsResponseData>,
) -> Result<Self, Self::Error> {
- Ok(Self {
- status: enums::AttemptStatus::from(item.response.state),
- response: Ok(PaymentsResponseData::TransactionResponse {
- resource_id: ResponseId::ConnectorTransactionId(
- item.response.transaction_id.clone(),
- ),
- redirection_data: Box::new(None),
- mandate_reference: Box::new(None),
- connector_metadata: None,
- network_txn_id: None,
- connector_response_reference_id: None,
- incremental_authorization_allowed: None,
- charges: None,
+ match item.response {
+ LoonioPaymentResponseData::Sync(sync_response) => Ok(Self {
+ status: enums::AttemptStatus::from(sync_response.state),
+ response: Ok(PaymentsResponseData::TransactionResponse {
+ resource_id: ResponseId::ConnectorTransactionId(sync_response.transaction_id),
+ redirection_data: Box::new(None),
+ mandate_reference: Box::new(None),
+ connector_metadata: None,
+ network_txn_id: None,
+ connector_response_reference_id: None,
+ incremental_authorization_allowed: None,
+ charges: None,
+ }),
+ ..item.data
}),
- ..item.data
- })
+ LoonioPaymentResponseData::Webhook(webhook_body) => {
+ let payment_status = enums::AttemptStatus::from(&webhook_body.event_code);
+ Ok(Self {
+ status: payment_status,
+ response: Ok(PaymentsResponseData::TransactionResponse {
+ resource_id: ResponseId::ConnectorTransactionId(
+ webhook_body.api_transaction_id,
+ ),
+ redirection_data: Box::new(None),
+ mandate_reference: Box::new(None),
+ connector_metadata: None,
+ network_txn_id: None,
+ connector_response_reference_id: None,
+ incremental_authorization_allowed: None,
+ charges: None,
+ }),
+ ..item.data
+ })
+ }
+ }
}
}
@@ -303,3 +326,94 @@ pub struct LoonioErrorResponse {
pub error_code: Option<String>,
pub message: String,
}
+
+// Webhook related structs
+
+#[derive(Debug, Serialize, Deserialize)]
+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
+pub enum LoonioWebhookEventCode {
+ TransactionPrepared,
+ TransactionPending,
+ TransactionAvailable,
+ TransactionSettled,
+ TransactionFailed,
+ TransactionRejected,
+ #[serde(rename = "TRANSACTION_WAITING_STATUS_FILE")]
+ TransactionWaitingStatusFile,
+ #[serde(rename = "TRANSACTION_STATUS_FILE_RECEIVED")]
+ TransactionStatusFileReceived,
+ #[serde(rename = "TRANSACTION_STATUS_FILE_FAILED")]
+ TransactionStatusFileFailed,
+ #[serde(rename = "TRANSACTION_RETURNED")]
+ TransactionReturned,
+ #[serde(rename = "TRANSACTION_WRONG_DESTINATION")]
+ TransactionWrongDestination,
+ #[serde(rename = "TRANSACTION_NSF")]
+ TransactionNsf,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
+pub enum LoonioWebhookTransactionType {
+ Incoming,
+ OutgoingVerified,
+ OutgoingNotVerified,
+ OutgoingCustomerDefined,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+pub struct LoonioWebhookBody {
+ pub amount: FloatMajorUnit,
+ pub api_transaction_id: String,
+ pub signature: Option<String>,
+ pub event_code: LoonioWebhookEventCode,
+ pub id: i32,
+ #[serde(rename = "type")]
+ pub transaction_type: LoonioWebhookTransactionType,
+}
+
+#[derive(Debug, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum LoonioPaymentResponseData {
+ Sync(LoonioTransactionSyncResponse),
+ Webhook(LoonioWebhookBody),
+}
+impl From<&LoonioWebhookEventCode> for webhooks::IncomingWebhookEvent {
+ fn from(event_code: &LoonioWebhookEventCode) -> Self {
+ match event_code {
+ LoonioWebhookEventCode::TransactionSettled
+ | LoonioWebhookEventCode::TransactionAvailable => Self::PaymentIntentSuccess,
+ LoonioWebhookEventCode::TransactionPending
+ | LoonioWebhookEventCode::TransactionPrepared => Self::PaymentIntentProcessing,
+ LoonioWebhookEventCode::TransactionFailed
+ // deprecated
+ | LoonioWebhookEventCode::TransactionRejected
+ | LoonioWebhookEventCode::TransactionStatusFileFailed
+ | LoonioWebhookEventCode::TransactionReturned
+ | LoonioWebhookEventCode::TransactionWrongDestination
+ | LoonioWebhookEventCode::TransactionNsf => Self::PaymentIntentFailure,
+ _ => Self::EventNotSupported,
+ }
+ }
+}
+
+impl From<&LoonioWebhookEventCode> for enums::AttemptStatus {
+ fn from(event_code: &LoonioWebhookEventCode) -> Self {
+ match event_code {
+ LoonioWebhookEventCode::TransactionSettled
+ | LoonioWebhookEventCode::TransactionAvailable => Self::Charged,
+
+ LoonioWebhookEventCode::TransactionPending
+ | LoonioWebhookEventCode::TransactionPrepared => Self::Pending,
+
+ LoonioWebhookEventCode::TransactionFailed
+ | LoonioWebhookEventCode::TransactionRejected
+ | LoonioWebhookEventCode::TransactionStatusFileFailed
+ | LoonioWebhookEventCode::TransactionReturned
+ | LoonioWebhookEventCode::TransactionWrongDestination
+ | LoonioWebhookEventCode::TransactionNsf => Self::Failure,
+
+ _ => Self::Pending,
+ }
+ }
+}
|
2025-10-07T09:18:54Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Loomio webhooks for payments
## payment request
```json
{
"amount": 1500,
"currency": "CAD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"authentication_type": "three_ds",
"payment_method": "bank_redirect",
"payment_method_type": "interac",
"payment_method_data": {
"bank_redirect": {
"interac": {}
}
},
"billing": {
"address": {
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"city": "Downtown Core",
"state": "Central Indiana America",
"zip": "039393",
"country": "SG",
"first_name": "Swangi",
"last_name": "Kumari"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
}
}
```
## response
```json
{
"payment_id": "pay_J3xaVGqCX1QbnGKyQoCQ",
"merchant_id": "merchant_1759821555",
"status": "requires_customer_action",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 1500,
"amount_received": null,
"connector": "loonio",
"client_secret": "pay_J3xaVGqCX1QbnGKyQoCQ_secret_IfvZo54PdakCzmi10muX",
"created": "2025-10-07T09:15:47.349Z",
"currency": "CAD",
"customer_id": "aaaa",
"customer": {
"id": "aaaa",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_redirect",
"payment_method_data": {
"bank_redirect": {
"type": "BankRedirectResponse",
"bank_name": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Downtown Core",
"country": "SG",
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"zip": "039393",
"state": "Central Indiana America",
"first_name": "Swangi",
"last_name": "Kumari",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "[email protected]"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_J3xaVGqCX1QbnGKyQoCQ/merchant_1759821555/pay_J3xaVGqCX1QbnGKyQoCQ_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "interac",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "aaaa",
"created_at": 1759828547,
"expires": 1759832147,
"secret": "epk_dfb1c2f173f34c4da48ee0a98d48051f"
},
"manual_retry_allowed": null,
"connector_transaction_id": "pay_J3xaVGqCX1QbnGKyQoCQ_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_MLEtbytGk3haqiqlaheV",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_UKE4wkdWmZVIs8oRKgbo",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-07T09:30:47.349Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-07T09:15:48.782Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
## make redirect
<img width="1708" height="1115" alt="Screenshot 2025-10-07 at 2 47 11 PM" src="https://github.com/user-attachments/assets/35ea68fa-8b86-48ef-9600-64916ebdaf2b" />
## the status will change when webhook reaches without force psync
<img width="1178" height="678" alt="Screenshot 2025-10-07 at 2 47 43 PM" src="https://github.com/user-attachments/assets/254d2a5f-eab1-4b15-988a-a353338d1536" />
## webhook source verificaiton = false
<img width="1085" height="311" alt="Screenshot 2025-10-07 at 6 15 09 PM" src="https://github.com/user-attachments/assets/0f21632f-0927-47ac-95b4-4593dcbb1633" />
<img width="648" height="246" alt="Screenshot 2025-10-07 at 6 15 21 PM" src="https://github.com/user-attachments/assets/1871af58-ce58-4c78-97d3-7c1502ab77ba" />
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
b3beda7d7172396452e34858cb6bd701962f75ab
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9782
|
Bug: [BUG] Rebilling should be "1" for ntid flow for nuvei
### Bug Description
: Make rebilling as "1" in connector request
Are you using hyperswitch hosted version? Yes/No
If yes, please provide the value of the `x-request-id` response header to help us debug your issue.
If not (or if building/running locally), please provide the following details:
1. Operating System or Linux distribution:
2. Rust version (output of `rustc --version`): ``
3. App version (output of `cargo r --features vergen -- --version`): ``
### Have you spent some time checking if this bug has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None
|
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 11cd0026ea0..522535e3696 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -563,7 +563,7 @@ ideal = { currency = "EUR" }
sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" }
eps = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD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,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" }
[payout_method_filters.nuvei]
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 4c402c8c73f..44c41ac8860 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -543,7 +543,7 @@ ideal = { currency = "EUR" }
sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" }
eps = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT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D,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" }
[payout_method_filters.nuvei]
diff --git a/config/development.toml b/config/development.toml
index 7bc13f554b8..5eb55d390f3 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -660,7 +660,7 @@ ideal = { currency = "EUR" }
sofort = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" }
eps = { country = "AU,CA,GB,IN,JP,NZ,PH,SG,TH,US",currency = "AED,ALL,AMD,ARS,AUD,AZN,BAM,BDT,BGN,BHD,BMD,BND,BRL,BYN,CAD,CHF,CLP,CNY,COP,CRC,CZK,DKK,DOP,DZD,EGP,EUR,GBP,GEL,GHS,GTQ,HKD,HUF,IDR,INR,IQD,ISK,JOD,JPY,KES,KGS,KRW,KWD,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PE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,KYD,KZT,LBP,LKR,MAD,MDL,MKD,MMK,MNT,MUR,MWK,MXN,MYR,MZN,NAD,NGN,NOK,NZD,OMR,PEN,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,SAR,SEK,SGD,SOS,THB,TND,TOP,TRY,TTD,TWD,UAH,UGX,USD,UYU,UZS,VND,XAF,XOF,YER,ZAR" }
[payout_method_filters.nuvei]
diff --git a/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs b/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
index 8fe123f5e37..3f261ea461b 100644
--- a/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
@@ -97,7 +97,7 @@ trait NuveiAuthorizePreprocessingCommon {
fn get_minor_amount_required(
&self,
) -> Result<MinorUnit, error_stack::Report<errors::ConnectorError>>;
- fn get_customer_id_required(&self) -> Option<CustomerId>;
+ fn get_customer_id_optional(&self) -> Option<CustomerId>;
fn get_email_required(&self) -> Result<Email, error_stack::Report<errors::ConnectorError>>;
fn get_currency_required(
&self,
@@ -130,7 +130,7 @@ impl NuveiAuthorizePreprocessingCommon for SetupMandateRequestData {
}
}
- fn get_customer_id_required(&self) -> Option<CustomerId> {
+ fn get_customer_id_optional(&self) -> Option<CustomerId> {
self.customer_id.clone()
}
@@ -221,7 +221,7 @@ impl NuveiAuthorizePreprocessingCommon for PaymentsAuthorizeData {
) -> Result<Option<AuthenticationData>, error_stack::Report<errors::ConnectorError>> {
Ok(self.authentication_data.clone())
}
- fn get_customer_id_required(&self) -> Option<CustomerId> {
+ fn get_customer_id_optional(&self) -> Option<CustomerId> {
self.customer_id.clone()
}
@@ -290,7 +290,7 @@ impl NuveiAuthorizePreprocessingCommon for PaymentsPreProcessingData {
None
}
- fn get_customer_id_required(&self) -> Option<CustomerId> {
+ fn get_customer_id_optional(&self) -> Option<CustomerId> {
None
}
fn get_email_required(&self) -> Result<Email, error_stack::Report<errors::ConnectorError>> {
@@ -447,6 +447,14 @@ pub struct NuveiItem {
pub image_url: Option<String>,
pub product_url: Option<String>,
}
+#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
+pub enum IsRebilling {
+ #[serde(rename = "1")]
+ True,
+ #[serde(rename = "0")]
+ False,
+}
+
#[serde_with::skip_serializing_none]
#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "camelCase")]
@@ -463,7 +471,7 @@ pub struct NuveiPaymentsRequest {
//unique transaction id
pub client_unique_id: String,
pub transaction_type: TransactionType,
- pub is_rebilling: Option<String>,
+ pub is_rebilling: Option<IsRebilling>,
pub payment_option: PaymentOption,
pub is_moto: Option<bool>,
pub device_details: DeviceDetails,
@@ -1124,7 +1132,7 @@ struct ApplePayPaymentMethodCamelCase {
fn get_google_pay_decrypt_data(
predecrypt_data: &GPayPredecryptData,
- is_rebilling: Option<String>,
+ is_rebilling: Option<IsRebilling>,
brand: Option<String>,
) -> Result<NuveiPaymentsRequest, error_stack::Report<errors::ConnectorError>> {
Ok(NuveiPaymentsRequest {
@@ -1163,7 +1171,7 @@ where
Req: NuveiAuthorizePreprocessingCommon,
{
let is_rebilling = if item.request.is_customer_initiated_mandate_payment() {
- Some("0".to_string())
+ Some(IsRebilling::False)
} else {
None
};
@@ -1237,7 +1245,7 @@ where
fn get_apple_pay_decrypt_data(
apple_pay_predecrypt_data: &ApplePayPredecryptData,
- is_rebilling: Option<String>,
+ is_rebilling: Option<IsRebilling>,
network: String,
) -> Result<NuveiPaymentsRequest, error_stack::Report<errors::ConnectorError>> {
Ok(NuveiPaymentsRequest {
@@ -1291,7 +1299,7 @@ where
Req: NuveiAuthorizePreprocessingCommon,
{
let is_rebilling = if item.request.is_customer_initiated_mandate_payment() {
- Some("0".to_string())
+ Some(IsRebilling::False)
} else {
None
};
@@ -1633,14 +1641,17 @@ where
billing_address: None,
shipping_address: None,
};
- let is_rebilling = if router_data.request.is_customer_initiated_mandate_payment() {
- Some("0".to_string())
- } else {
- None
- };
+ let is_rebilling = Some(IsRebilling::True);
+
Ok(NuveiPaymentsRequest {
external_scheme_details,
payment_option,
+ user_token_id: Some(
+ router_data
+ .request
+ .get_customer_id_optional()
+ .ok_or_else(missing_field_err("customer_id"))?,
+ ),
is_rebilling,
..Default::default()
})
@@ -1736,7 +1747,8 @@ fn get_amount_details(
impl<F, Req> TryFrom<(&RouterData<F, Req, PaymentsResponseData>, String)> for NuveiPaymentsRequest
where
- Req: NuveiAuthorizePreprocessingCommon,
+ Req: NuveiAuthorizePreprocessingCommon + std::fmt::Debug,
+ F: std::fmt::Debug,
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
@@ -1917,10 +1929,9 @@ where
} else {
request_data.device_details.clone()
};
-
Ok(Self {
is_rebilling: request_data.is_rebilling,
- user_token_id: item.customer_id.clone(),
+ user_token_id: request_data.user_token_id,
related_transaction_id: request_data.related_transaction_id,
payment_option: request_data.payment_option,
billing_address,
@@ -1934,7 +1945,7 @@ where
amount_details,
items: l2_l3_items,
is_partial_approval: item.request.get_is_partial_approval(),
-
+ external_scheme_details: request_data.external_scheme_details,
..request
})
}
@@ -1969,7 +1980,7 @@ where
match item.request.is_customer_initiated_mandate_payment() {
true => {
(
- Some("0".to_string()), // In case of first installment, rebilling should be 0
+ Some(IsRebilling::False), // In case of first installment, rebilling should be 0
Some(V2AdditionalParams {
rebill_expiry: Some(
time::OffsetDateTime::now_utc()
@@ -1983,7 +1994,7 @@ where
challenge_window_size: Some(CHALLENGE_WINDOW_SIZE.to_string()),
challenge_preference: Some(CHALLENGE_PREFERENCE.to_string()),
}),
- item.request.get_customer_id_required(),
+ item.request.get_customer_id_optional(),
)
}
// non mandate transactions
@@ -3513,7 +3524,7 @@ where
let connector_mandate_id = &item.request.get_connector_mandate_id();
let customer_id = item
.request
- .get_customer_id_required()
+ .get_customer_id_optional()
.ok_or(missing_field_err("customer_id")())?;
let related_transaction_id = item.request.get_related_transaction_id().clone();
@@ -3537,7 +3548,7 @@ where
device_details: DeviceDetails {
ip_address: Secret::new(ip_address),
},
- is_rebilling: Some("1".to_string()), // In case of second installment, rebilling should be 1
+ is_rebilling: Some(IsRebilling::True), // In case of second installment, rebilling should be 1
user_token_id: Some(customer_id),
payment_option: PaymentOption {
user_payment_option_id: connector_mandate_id.clone(),
diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs
index 0b9f7de40d4..e9ec258aaf8 100644
--- a/crates/router/src/core/payments.rs
+++ b/crates/router/src/core/payments.rs
@@ -1266,7 +1266,7 @@ where
let operations::GetTrackerResponse {
operation,
- customer_details: _,
+ customer_details,
mut payment_data,
business_profile,
mandate_type: _,
@@ -1330,6 +1330,18 @@ where
None
};
+ let (operation, customer) = operation
+ .to_domain()?
+ .get_or_create_customer_details(
+ state,
+ &mut payment_data,
+ customer_details,
+ merchant_context.get_merchant_key_store(),
+ merchant_context.get_merchant_account().storage_scheme,
+ )
+ .await
+ .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)
+ .attach_printable("Failed while fetching/creating customer")?;
let (router_data, mca) = proxy_for_call_connector_service(
state,
req_state.clone(),
@@ -1337,7 +1349,7 @@ where
connector.clone(),
&operation,
&mut payment_data,
- &None,
+ &customer,
call_connector_action.clone(),
&validate_result,
schedule_time,
|
2025-10-08T06:21:42Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
`is_rebilling` should be sent as `1` always for `NTID` flow in Nuvei.
- Core change: For proxy/ntid flow customer details were not being passed.
- Add US as supported countries for GOOGLEPAY, Even though it doesn't list US in supported countries in [DOC](https://docs.nuvei.com/documentation/global-guides/google-pay/)
## REQUEST
```json
{
"amount": 10023,
"currency": "EUR",
"confirm": true,
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"setup_future_usage": "off_session",
"customer_id": "nithxxinn",
"return_url": "https://www.google.com",
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"description": "hellow world",
"billing": {
"address": {
"zip": "560095",
"country": "US",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"email": "[email protected]",
"payment_method": "card",
"payment_method_type": "credit",
"off_session": true,
"recurring_details": {
"type": "network_transaction_id_and_card_details",
"data": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_network":"VISA",
"network_transaction_id": "01615070********"
}
}
}
```
RESPONSE :
```json
{
"payment_id": "pay_LkaUU5hsgNIRtS3dNJ7Y",
"merchant_id": "merchant_1760007762",
"status": "succeeded",
"amount": 10023,
"net_amount": 10023,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10023,
"connector": "nuvei",
"client_secret": "pay_LkaUU5hsgNIRtS3dNJ7Y_secret_SnY5seciR0qmDoTyLD3Z",
"created": "2025-10-10T07:39:13.663Z",
"currency": "EUR",
"customer_id": null,
"customer": {
"id": null,
"name": null,
"email": "[email protected]",
"phone": null,
"phone_country_code": null
},
"description": "hellow world",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": true,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Fasdf",
"country": "US",
"line1": "Fasdf",
"line2": "Fasdf",
"line3": null,
"zip": "560095",
"state": null,
"first_name": "Sakil",
"last_name": "Mostak",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "nithxxinn",
"created_at": 1760081953,
"expires": 1760085553,
"secret": "epk_84b79b41787640c780ec0ffbc06d61e2"
},
"manual_retry_allowed": null,
"connector_transaction_id": "7110000000018185783",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "9599777111",
"payment_link": null,
"profile_id": "pro_D59PF6bunaFycoeexf3v",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_dBUZgHuGCA5UOuipcycK",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-10T07:54:13.663Z",
"fingerprint": null,
"browser_info": {
"language": "en-US",
"time_zone": 330,
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"color_depth": 24,
"java_enabled": false,
"screen_width": 1920,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"screen_height": 1080,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "",
"payment_method_status": null,
"updated": "2025-10-10T07:39:16.176Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": true,
"mit_category": null
}
```
## Connector request
```js
Object {
timeStamp: String("20251010052957"),
sessionToken: String("*** alloc::string::String ***"),
merchantId: String("*** alloc::string::String ***"),
merchantSiteId: String("*** alloc::string::String ***"),
clientRequestId: String("*** alloc::string::String ***"),
amount: String("100.23"),
currency: String("EUR"),
userTokenId: String("nithxxinn"), // required when rebilling is "1"
clientUniqueId: String(""),
transactionType: String("Sale"),
isRebilling: String("1"), // rebilling 1 for ntid
paymentOption: Object {
card: Object {
cardNumber: String("424242**********"),
expirationMonth: String("*** alloc::string::String ***"),
expirationYear: String("*** alloc::string::String ***"),
},
},
deviceDetails: Object {
ipAddress: String("192.**.**.**"),
},
checksum: String("*** alloc::string::String ***"),
billingAddress: Object {
email: String("*****@gmail.com"),
firstName: String("*** alloc::string::String ***"),
lastName: String("*** alloc::string::String ***"),
country: String("US"),
city: String("*** alloc::string::String ***"),
address: String("*** alloc::string::String ***"),
zip: String("*** alloc::string::String ***"),
addressLine2: String("*** alloc::string::String ***"),
},
urlDetails: Object {
successUrl: String("https://google.com"),
failureUrl: String("https://google.com"),
pendingUrl: String("https://google.com"),
},
amountDetails: Object {
totalTax: Null,
totalShipping: Null,
totalHandling: Null,
totalDiscount: Null,
},
externalSchemeDetails: Object {
transactionId: String("*** alloc::string::String ***"), // NITD
brand: String("VISA"),
},
}
```
## Non Mandate request
```json
{
"amount": 30000,
"capture_method": "automatic",
"currency": "AED",
"confirm": true,
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"connector": [
"nuvei"
],
"customer_id": "nidthxxinn",
"return_url": "https://www.google.com",
"payment_method": "card",
"payment_method_type": "credit",
"billing": {
"address": {
"zip": "560095",
"country": "AT",
"first_name": "Sakil",
"last_name": "Mostak",
"line1": "Fasdf",
"line2": "Fasdf",
"city": "Fasdf"
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"ip_address": "192.168.1.1",
"java_enabled": false,
"java_script_enabled": true,
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"time_zone": 330,
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
},
"email": "[email protected]",
"payment_method_data": {
"card": {
"card_number": "4531739335817394",
"card_exp_month": "01",
"card_exp_year": "2026",
"card_holder_name": "John Smith",
"card_cvc": "100"
}
}
}
```
RESPONSE
```js
{
"timeStamp": "20251010163310",
"sessionToken": "*** alloc::string::String ***",
"merchantId": "*** alloc::string::String ***",
"merchantSiteId": "*** alloc::string::String ***",
"clientRequestId": "*** alloc::string::String ***",
"amount": "300.00",
"currency": "AED",
"clientUniqueId": "",
"transactionType": "Sale",
"paymentOption": {
"card": {
"cardNumber": "453173**********",
"cardHolderName": "*** alloc::string::String ***",
"expirationMonth": "*** alloc::string::String ***",
"expirationYear": "*** alloc::string::String ***",
"CVV": "*** alloc::string::String ***"
}
},
"deviceDetails": {
"ipAddress": "192.**.**.**"
},
"checksum": "*** alloc::string::String ***",
"billingAddress": {
"email": "*****@gmail.com",
"firstName": "*** alloc::string::String ***",
"lastName": "*** alloc::string::String ***",
"country": "AT",
"city": "*** alloc::string::String ***",
"address": "*** alloc::string::String ***",
"zip": "*** alloc::string::String ***",
"addressLine2": "*** alloc::string::String ***"
},
"urlDetails": {
"successUrl": "https://google.com",
"failureUrl": "https://google.com",
"pendingUrl": "https://google.com"
},
"amountDetails": {
"totalTax": null,
"totalShipping": null,
"totalHandling": null,
"totalDiscount": null
}
}
```
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
47f7e258bcddad62ef89bb896ae4117b5ac32038
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9733
|
Bug: [FEATURE] Finix: Add Google Pay Connector Tokenization Flow
### Feature Description
Finix: Add Google Pay Connector Tokenization Flow
### Possible Implementation
Finix: Add Google Pay Connector Tokenization Flow
### Have you spent some time checking if this feature request has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR!
|
diff --git a/config/config.example.toml b/config/config.example.toml
index c4eabbb369f..cfaefc600f9 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -962,6 +962,9 @@ apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" }
[pm_filters.paysafe]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,RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" }
+[pm_filters.finix]
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
+
[connector_customer]
payout_connector_list = "nomupay,stripe,wise"
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index b5980eedcff..9d5a912082c 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -447,6 +447,7 @@ pix = { country = "BR", currency = "BRL" }
[pm_filters.finix]
credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,B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TN,TR,TM,TC,TV,UG,UA,AE,GB,UM,UY,UZ,VU,VE,VN,VG,VI,WF,EH,YE,ZM,ZW,US", currency = "AED,AFN,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,CAD,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"}
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
[pm_filters.helcim]
credit = { country = "US, CA", currency = "USD, CAD" }
@@ -884,7 +885,7 @@ stripe = { long_lived_token = false, payment_method = "wallet", payment_method_t
billwerk = {long_lived_token = false, payment_method = "card"}
globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }
dwolla = { long_lived_token = true, payment_method = "bank_debit" }
-finix= { long_lived_token = false, payment_method = "card" }
+finix= { long_lived_token = false, payment_method = "card,wallet" }
[webhooks]
outgoing_enabled = true
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index efb770b10f9..356d8e828a4 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -530,6 +530,7 @@ pix = { country = "BR", currency = "BRL" }
[pm_filters.finix]
credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH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CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,JPY,KES,KGS,KHR,KMF,KPW,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"}
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
[pm_filters.helcim]
credit = { country = "US, CA", currency = "USD, CAD" }
@@ -893,7 +894,7 @@ stripe = { long_lived_token = false, payment_method = "wallet", payment_method_t
billwerk = {long_lived_token = false, payment_method = "card"}
globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }
dwolla = { long_lived_token = true, payment_method = "bank_debit" }
-finix= { long_lived_token = false, payment_method = "card" }
+finix= { long_lived_token = false, payment_method = "card,wallet" }
[webhooks]
outgoing_enabled = true
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 87de6f3e430..95a4532cddf 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -512,6 +512,7 @@ pix = { country = "BR", currency = "BRL" }
[pm_filters.finix]
credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,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LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,SGD,SHP,SLE,SLL,SOS,SRD,SSP,STD,STN,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"}
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
[pm_filters.helcim]
credit = { country = "US, CA", currency = "USD, CAD" }
@@ -899,7 +900,7 @@ stripe = { long_lived_token = false, payment_method = "wallet", payment_method_t
billwerk = {long_lived_token = false, payment_method = "card"}
globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }
dwolla = { long_lived_token = true, payment_method = "bank_debit" }
-finix= { long_lived_token = false, payment_method = "card" }
+finix= { long_lived_token = false, payment_method = "card,wallet" }
[webhooks]
outgoing_enabled = true
diff --git a/config/development.toml b/config/development.toml
index a0555ec8f3e..a6ad358f6fb 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -714,6 +714,7 @@ pix = { country = "BR", currency = "BRL" }
[pm_filters.finix]
credit = { country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NL,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,PM,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,SD,SR,SJ,SZ,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,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW,ZWL"}
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
[pm_filters.helcim]
credit = { country = "US, CA", currency = "USD, CAD" }
@@ -1026,7 +1027,7 @@ gocardless = { long_lived_token = true, payment_method = "bank_debit" }
billwerk = { long_lived_token = false, payment_method = "card" }
dwolla = { long_lived_token = true, payment_method = "bank_debit" }
globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }
-finix= { long_lived_token = false, payment_method = "card" }
+finix= { long_lived_token = false, payment_method = "card,wallet" }
[temp_locker_enable_config]
stripe = { payment_method = "bank_transfer" }
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 989944b60ca..390c8e585a0 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -409,6 +409,7 @@ gocardless = { long_lived_token = true, payment_method = "bank_debit" }
billwerk = { long_lived_token = false, payment_method = "card" }
globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }
dwolla = { long_lived_token = true, payment_method = "bank_debit" }
+finix= { long_lived_token = false, payment_method = "card,wallet" }
[temp_locker_enable_config]
stripe = { payment_method = "bank_transfer" }
@@ -989,6 +990,9 @@ apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" }
[pm_filters.paysafe]
apple_pay = {country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,PM,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,NL,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VA,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "ARS,AUD,AZN,BHD,BOB,BAM,BRL,BGN,CAD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,ETB,EUR,FJD,GEL,GTQ,HTG,HNL,HKD,HUF,INR,IDR,JMD,JPY,JOD,KZT,KES,KRW,KWD,LBP,LYD,MWK,MUR,MXN,MDL,MAD,ILS,NZD,NGN,NOK,OMR,PKR,PAB,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SAR,RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" }
+[pm_filters.finix]
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
+
[bank_config.online_banking_fpx]
adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
fiuu.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_of_china,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index 0bc14f42dca..9cce297e1cf 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -7307,6 +7307,12 @@ type = "Text"
api_key = "Username"
api_secret = "Password"
key1 = "Merchant Id"
+[finix.metadata.merchant_id]
+name = "merchant_id"
+label = "Merchant Identity Id"
+placeholder = "Enter Merchant Identity Id"
+required = true
+type = "Text"
[[finix.credit]]
payment_method_type = "Mastercard"
[[finix.credit]]
@@ -7325,6 +7331,8 @@ payment_method_type = "UnionPay"
payment_method_type = "Interac"
[[finix.credit]]
payment_method_type = "Maestro"
+[[finix.wallet]]
+ payment_method_type = "google_pay"
[loonio]
[loonio.connector_auth.BodyKey]
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index 99042fae462..24ebfa005fd 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -6044,6 +6044,12 @@ type = "Text"
api_key = "Username"
api_secret = "Password"
key1 = "Merchant Id"
+[finix.metadata.merchant_id]
+name = "merchant_id"
+label = "Merchant Identity Id"
+placeholder = "Enter Merchant Identity Id"
+required = true
+type = "Text"
[[finix.credit]]
payment_method_type = "Mastercard"
[[finix.credit]]
@@ -6062,7 +6068,8 @@ payment_method_type = "UnionPay"
payment_method_type = "Interac"
[[finix.credit]]
payment_method_type = "Maestro"
-
+[[finix.wallet]]
+ payment_method_type = "google_pay"
[loonio]
[loonio.connector_auth.BodyKey]
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index 7aba1e4db05..517ca035ea7 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -7283,6 +7283,12 @@ type = "Text"
api_key = "Username"
api_secret = "Password"
key1 = "Merchant Id"
+[finix.metadata.merchant_id]
+name = "merchant_id"
+label = "Merchant Identity Id"
+placeholder = "Enter Merchant Identity Id"
+required = true
+type = "Text"
[[finix.credit]]
payment_method_type = "Mastercard"
[[finix.credit]]
@@ -7301,7 +7307,8 @@ payment_method_type = "UnionPay"
payment_method_type = "Interac"
[[finix.credit]]
payment_method_type = "Maestro"
-
+[[finix.wallet]]
+ payment_method_type = "google_pay"
[loonio]
[loonio.connector_auth.BodyKey]
diff --git a/crates/hyperswitch_connectors/src/connectors/finix.rs b/crates/hyperswitch_connectors/src/connectors/finix.rs
index d47f03adf65..15e8f17bfb8 100644
--- a/crates/hyperswitch_connectors/src/connectors/finix.rs
+++ b/crates/hyperswitch_connectors/src/connectors/finix.rs
@@ -964,6 +964,16 @@ static FINIX_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> = Lazy
),
},
);
+ finix_supported_payment_methods.add(
+ enums::PaymentMethod::Wallet,
+ PaymentMethodType::GooglePay,
+ PaymentMethodDetails {
+ mandates: enums::FeatureStatus::NotSupported,
+ refunds: enums::FeatureStatus::Supported,
+ supported_capture_methods: default_capture_methods.clone(),
+ specific_features: None,
+ },
+ );
finix_supported_payment_methods
});
diff --git a/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs b/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
index f9e76be04a3..ea60f6d0815 100644
--- a/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
@@ -2,8 +2,9 @@ pub mod request;
pub mod response;
use common_enums::{enums, AttemptStatus, CaptureMethod, CountryAlpha2, CountryAlpha3};
use common_utils::types::MinorUnit;
+use error_stack::ResultExt;
use hyperswitch_domain_models::{
- payment_method_data::PaymentMethodData,
+ payment_method_data::{PaymentMethodData, WalletData},
router_data::{ConnectorAuthType, ErrorResponse, PaymentMethodToken, RouterData},
router_flow_types::{
self as flows,
@@ -28,7 +29,7 @@ use crate::{
types::{RefundsResponseRouterData, ResponseRouterData},
unimplemented_payment_method,
utils::{
- get_unimplemented_payment_method_error_message, AddressDetailsData, CardData,
+ self, get_unimplemented_payment_method_error_message, AddressDetailsData, CardData,
RouterData as _,
},
};
@@ -37,6 +38,18 @@ pub struct FinixRouterData<'a, Flow, Req, Res> {
pub amount: MinorUnit,
pub router_data: &'a RouterData<Flow, Req, Res>,
pub merchant_id: Secret<String>,
+ pub merchant_identity_id: Secret<String>,
+}
+
+impl TryFrom<&Option<common_utils::pii::SecretSerdeValue>> for FinixMeta {
+ type Error = error_stack::Report<ConnectorError>;
+ fn try_from(
+ meta_data: &Option<common_utils::pii::SecretSerdeValue>,
+ ) -> Result<Self, Self::Error> {
+ let metadata = utils::to_connector_meta_from_secret::<Self>(meta_data.clone())
+ .change_context(ConnectorError::InvalidConnectorConfig { config: "metadata" })?;
+ Ok(metadata)
+ }
}
impl<'a, Flow, Req, Res> TryFrom<(MinorUnit, &'a RouterData<Flow, Req, Res>)>
@@ -47,11 +60,13 @@ impl<'a, Flow, Req, Res> TryFrom<(MinorUnit, &'a RouterData<Flow, Req, Res>)>
fn try_from(value: (MinorUnit, &'a RouterData<Flow, Req, Res>)) -> Result<Self, Self::Error> {
let (amount, router_data) = value;
let auth = FinixAuthType::try_from(&router_data.connector_auth_type)?;
+ let connector_meta = FinixMeta::try_from(&router_data.connector_meta_data)?;
Ok(Self {
amount,
router_data,
merchant_id: auth.merchant_id,
+ merchant_identity_id: connector_meta.merchant_id,
})
}
}
@@ -160,6 +175,28 @@ impl TryFrom<&FinixRouterData<'_, Authorize, PaymentsAuthorizeData, PaymentsResp
three_d_secure: None,
})
}
+ PaymentMethodData::Wallet(WalletData::GooglePay(_)) => {
+ let source = item.router_data.get_payment_method_token()?;
+ Ok(Self {
+ amount: item.amount,
+ currency: item.router_data.request.currency,
+ source: match source {
+ PaymentMethodToken::Token(token) => token,
+ PaymentMethodToken::ApplePayDecrypt(_) => Err(
+ unimplemented_payment_method!("Apple Pay", "Simplified", "Finix"),
+ )?,
+ PaymentMethodToken::PazeDecrypt(_) => {
+ Err(unimplemented_payment_method!("Paze", "Finix"))?
+ }
+ PaymentMethodToken::GooglePayDecrypt(_) => {
+ Err(unimplemented_payment_method!("Google Pay", "Finix"))?
+ }
+ },
+ merchant: item.merchant_id.clone(),
+ tags: None,
+ three_d_secure: None,
+ })
+ }
_ => Err(
ConnectorError::NotImplemented("Payment method not supported".to_string()).into(),
),
@@ -216,6 +253,32 @@ impl
card_brand: None, // Finix determines this from the card number
card_type: None, // Finix determines this from the card number
additional_data: None,
+ merchant_identity: None,
+ third_party_token: None,
+ })
+ }
+ PaymentMethodData::Wallet(WalletData::GooglePay(google_pay_wallet_data)) => {
+ let third_party_token = google_pay_wallet_data
+ .tokenization_data
+ .get_encrypted_google_pay_token()
+ .change_context(ConnectorError::MissingRequiredField {
+ field_name: "google_pay_token",
+ })?;
+ Ok(Self {
+ instrument_type: FinixPaymentInstrumentType::GOOGLEPAY,
+ name: item.router_data.get_optional_billing_full_name(),
+ identity: item.router_data.get_connector_customer_id()?,
+ number: None,
+ security_code: None,
+ expiration_month: None,
+ expiration_year: None,
+ tags: None,
+ address: None,
+ card_brand: None,
+ card_type: None,
+ additional_data: None,
+ merchant_identity: Some(item.merchant_identity_id.clone()),
+ third_party_token: Some(Secret::new(third_party_token)),
})
}
_ => Err(ConnectorError::NotImplemented(
diff --git a/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs b/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
index 703c12aa84e..a2392566d92 100644
--- a/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
+++ b/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
@@ -6,6 +6,12 @@ use masking::Secret;
use serde::{Deserialize, Serialize};
use super::*;
+
+#[derive(Deserialize)]
+pub struct FinixMeta {
+ pub merchant_id: Secret<String>,
+}
+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FinixPaymentsRequest {
pub amount: MinorUnit,
@@ -54,9 +60,13 @@ pub struct FinixCreatePaymentInstrumentRequest {
#[serde(rename = "type")]
pub instrument_type: FinixPaymentInstrumentType,
pub name: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
pub number: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
pub security_code: Option<Secret<String>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
pub expiration_month: Option<Secret<i8>>,
+ #[serde(skip_serializing_if = "Option::is_none")]
pub expiration_year: Option<Secret<i32>>,
pub identity: String,
pub tags: Option<FinixTags>,
@@ -64,6 +74,8 @@ pub struct FinixCreatePaymentInstrumentRequest {
pub card_brand: Option<String>,
pub card_type: Option<FinixCardType>,
pub additional_data: Option<HashMap<String, String>>,
+ pub merchant_identity: Option<Secret<String>>,
+ pub third_party_token: Option<Secret<String>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@@ -143,6 +155,8 @@ pub enum FinixPaymentType {
pub enum FinixPaymentInstrumentType {
#[serde(rename = "PAYMENT_CARD")]
PaymentCard,
+ #[serde(rename = "GOOGLE_PAY")]
+ GOOGLEPAY,
#[serde(rename = "BANK_ACCOUNT")]
BankAccount,
diff --git a/crates/router/src/core/connector_validation.rs b/crates/router/src/core/connector_validation.rs
index a38e55e4205..af67a69c837 100644
--- a/crates/router/src/core/connector_validation.rs
+++ b/crates/router/src/core/connector_validation.rs
@@ -588,6 +588,7 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {
}
api_enums::Connector::Finix => {
finix::transformers::FinixAuthType::try_from(self.auth_type)?;
+ finix::transformers::FinixMeta::try_from(self.connector_meta_data)?;
Ok(())
}
}
diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml
index 43a6c494c22..34ff72eb48b 100644
--- a/loadtest/config/development.toml
+++ b/loadtest/config/development.toml
@@ -699,6 +699,9 @@ apple_pay = { country = "US,CA,IL,GB", currency = "ILS,USD,EUR" }
[pm_filters.paysafe]
apple_pay = {country = "AF,AX,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BT,BO,BQ,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CW,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GU,GT,GG,GN,GW,GY,HT,HM,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IM,IL,IT,JM,JP,JE,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MA,MZ,MM,NA,NR,NP,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PS,PA,PG,PY,PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,BL,SH,KN,LC,MF,VC,WS,SM,ST,SA,SN,RS,SC,SL,SG,SX,SK,SI,SB,SO,ZA,GS,SS,ES,LK,PM,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ,TH,NL,TL,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VA,VE,VN,VG,VI,WF,EH,YE,ZM,ZW", currency = "ARS,AUD,AZN,BHD,BOB,BAM,BRL,BGN,CAD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,ETB,EUR,FJD,GEL,GTQ,HTG,HNL,HKD,HUF,INR,IDR,JMD,JPY,JOD,KZT,KES,KRW,KWD,LBP,LYD,MWK,MUR,MXN,MDL,MAD,ILS,NZD,NGN,NOK,OMR,PKR,PAB,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SAR,RSD,SGD,ZAR,LKR,SEK,CHF,SYP,TWD,THB,TTD,TND,TRY,UAH,AED,UYU,USD,VND" }
+[pm_filters.finix]
+google_pay = { country = "AD, AE, AG, AI, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BZ, CA, CC, CG, CH, CI, CK, CL, CM, CN, CO, CR, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KR, KW, KY, KZ, LA, LC, LI, LK, LR, LS, LT, LU, LV, MA, MC, MD, ME, MF, MG, MH, MK, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PT, PW, PY, QA, RE, RO, RS, RW, SA, SB, SC, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SR, ST, SV, SX, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TT, TV, TZ, UG, UM, UY, UZ, VA, VC, VG, VI, VN, VU, WF, WS, YT, ZA, ZM, US", currency = "USD, CAD" }
+
#tokenization configuration which describe token lifetime and payment method for specific connector
[tokenization]
stripe = { long_lived_token = false, payment_method = "wallet", payment_method_type = { type = "disable_only", list = "google_pay" } }
|
2025-10-07T20:50:17Z
|
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Closes this [issue](https://github.com/juspay/hyperswitch/issues/9733)
## Description
<!-- Describe your changes in detail -->
Added google pay connector tokenization flow for finix connector.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Screenshot of PMT Flow:
<img width="1725" height="303" alt="Screenshot 2025-10-10 at 12 35 50 PM" src="https://github.com/user-attachments/assets/073251b3-0a49-45da-ac62-e6e7d741e41c" />
Postman Test
Payments-Create:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ••••••' \
--data-raw '{
"amount": 6500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6500,
"customer_id": "Customer4",
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"billing": {
"address": {
"first_name": "John",
"last_name": "Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "Credit one: Visa •••• 4242",
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": TOKEN
},
"type": "CARD",
"info": {
"card_network": "VISA",
"card_details": "4242"
}
}
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2025-07-25T11:46:12Z"
}
}'
```
Response:
```
{
"payment_id": "pay_8UIPJRDCTTBl0bY0UKu3",
"merchant_id": "merchant_1759869874",
"status": "succeeded",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6500,
"connector": "finix",
"client_secret": "pay_8UIPJRDCTTBl0bY0UKu3_secret_e6kUS5t7w2W73ieJstMk",
"created": "2025-10-07T20:45:05.362Z",
"currency": "USD",
"customer_id": "Customer4",
"customer": {
"id": "Customer4",
"name": "John Doe",
"email": "[email protected]",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"google_pay": {
"last4": "4242",
"card_network": "VISA",
"type": "CARD"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "Customer4",
"created_at": 1759869905,
"expires": 1759873505,
"secret": "epk_8a72edc8a39c469597e02db4f36a04ab"
},
"manual_retry_allowed": null,
"connector_transaction_id": "TRh8uFLCwyh3iZ8roaT1ksyX",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2025-07-25T11:46:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_Ykn6DQM8KzGMHYEnWRW5",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Q2qpsZHuZ3gq7cTIQvic",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-07T21:00:05.362Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-07T20:45:08.949Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
5c6635be29def50cd64a40a16d906bc21175a381
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9739
|
Bug: Add support to create subscription with plans having trial period
| "diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs\nindex 5d8c7a3f0(...TRUNCATED) |
2025-10-07T15:18:41Z
| "## Type of Change\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [ ] Bugfix\r\n- [ ] New f(...TRUNCATED) |
f71090a94c55c421ffffd1d7608c33bac24a84e4
|
|
juspay/hyperswitch
|
juspay__hyperswitch-9703
|
Bug: feat(subscription): domain_model for subscription and invoice
| "diff --git a/crates/hyperswitch_domain_models/src/invoice.rs b/crates/hyperswitch_domain_models/src(...TRUNCATED) |
2025-10-01T09:39:23Z
| "## Type of Change\r\n<!-- Put an `x` in the boxes that apply -->\r\n\r\n- [ ] Bugfix\r\n- [ ] New f(...TRUNCATED) |
abcc70be074130827c14f90ff4cc7de964994efa
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 61