Bug: [BUG] recurring mandate through bancontact card bank redirect via stripe fails



connector throws below error:

```
"The provided bancontact PaymentMethod cannot be used again. It was used in a previous PaymentIntent or SetupIntent to set up a sepa_debit PaymentMethod, which can be used for multiple payments. To find the ID of the sepa_debit PaymentMethod, list the sepa_debit PaymentMethods associated with the Customer used to set up this PaymentMethod."
```

this is because we're just passing bancontact card payment method id instead of sepa direct debit payment method id. 

check:

- https://docs.stripe.com/payments/bancontact
- https://docs.stripe.com/payments/bancontact/save-during-payment?platform=web#web-charge-sepa-pm
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs
index 9d372a5415c..ad2e1d7e855 100644
--- a/crates/router/src/connector/stripe/transformers.rs
+++ b/crates/router/src/connector/stripe/transformers.rs
@@ -2071,7 +2071,7 @@ impl TryFrom<&types::SetupMandateRouterData> for SetupIntentRequest {
 impl TryFrom<&types::TokenizationRouterData> for TokenRequest {
     type Error = error_stack::Report<errors::ConnectorError>;
     fn try_from(item: &types::TokenizationRouterData) -> Result<Self, Self::Error> {
-        // Card flow for tokenization is handled seperately because of API contact difference
+        // Card flow for tokenization is handled separately because of API contact difference
         let request_payment_data = match &item.request.payment_method_data {
             domain::PaymentMethodData::Card(card_details) => {
                 StripePaymentMethodData::CardToken(StripeCardToken {
@@ -2683,6 +2683,45 @@ pub fn get_connector_metadata(
     Ok(next_action_response)
 }
 
+pub fn get_payment_method_id(
+    latest_charge: Option<StripeChargeEnum>,
+    payment_method_id_from_intent_root: Secret<String>,
+) -> String {
+    match latest_charge {
+        Some(StripeChargeEnum::ChargeObject(charge)) => match charge.payment_method_details {
+            Some(StripePaymentMethodDetailsResponse::Bancontact { bancontact }) => bancontact
+                .attached_payment_method
+                .map(|attached_payment_method| attached_payment_method.expose())
+                .unwrap_or(payment_method_id_from_intent_root.expose()),
+            Some(StripePaymentMethodDetailsResponse::Ideal { ideal }) => ideal
+                .attached_payment_method
+                .map(|attached_payment_method| attached_payment_method.expose())
+                .unwrap_or(payment_method_id_from_intent_root.expose()),
+            Some(StripePaymentMethodDetailsResponse::Blik)
+            | Some(StripePaymentMethodDetailsResponse::Eps)
+            | Some(StripePaymentMethodDetailsResponse::Fpx)
+            | Some(StripePaymentMethodDetailsResponse::Giropay)
+            | Some(StripePaymentMethodDetailsResponse::Przelewy24)
+            | Some(StripePaymentMethodDetailsResponse::Card { .. })
+            | Some(StripePaymentMethodDetailsResponse::Klarna)
+            | Some(StripePaymentMethodDetailsResponse::Affirm)
+            | Some(StripePaymentMethodDetailsResponse::AfterpayClearpay)
+            | Some(StripePaymentMethodDetailsResponse::AmazonPay)
+            | Some(StripePaymentMethodDetailsResponse::ApplePay)
+            | Some(StripePaymentMethodDetailsResponse::Ach)
+            | Some(StripePaymentMethodDetailsResponse::Sepa)
+            | Some(StripePaymentMethodDetailsResponse::Becs)
+            | Some(StripePaymentMethodDetailsResponse::Bacs)
+            | Some(StripePaymentMethodDetailsResponse::Wechatpay)
+            | Some(StripePaymentMethodDetailsResponse::Alipay)
+            | Some(StripePaymentMethodDetailsResponse::CustomerBalance)
+            | Some(StripePaymentMethodDetailsResponse::Cashapp { .. })
+            | None => payment_method_id_from_intent_root.expose(),
+        },
+        Some(StripeChargeEnum::ChargeId(_)) | None => payment_method_id_from_intent_root.expose(),
+    }
+}
+
 impl<F, T>
     TryFrom<types::ResponseRouterData<F, PaymentIntentSyncResponse, T, types::PaymentsResponseData>>
     for types::RouterData<F, T, types::PaymentsResponseData>
@@ -2713,46 +2752,11 @@ where
                 // Implemented Save and re-use payment information for recurring charges
                 // For more info: https://docs.stripe.com/recurring-payments#accept-recurring-payments
                 // For backward compatibility payment_method_id & connector_mandate_id is being populated with the same value
-                let connector_mandate_id = Some(payment_method_id.clone().expose());
-                let payment_method_id = match item.response.latest_charge.clone() {
-                    Some(StripeChargeEnum::ChargeObject(charge)) => {
-                        match charge.payment_method_details {
-                            Some(StripePaymentMethodDetailsResponse::Bancontact { bancontact }) => {
-                                bancontact
-                                    .attached_payment_method
-                                    .map(|attached_payment_method| attached_payment_method.expose())
-                                    .unwrap_or(payment_method_id.expose())
-                            }
-                            Some(StripePaymentMethodDetailsResponse::Ideal { ideal }) => ideal
-                                .attached_payment_method
-                                .map(|attached_payment_method| attached_payment_method.expose())
-                                .unwrap_or(payment_method_id.expose()),
-                            Some(StripePaymentMethodDetailsResponse::Blik)
-                            | Some(StripePaymentMethodDetailsResponse::Eps)
-                            | Some(StripePaymentMethodDetailsResponse::Fpx)
-                            | Some(StripePaymentMethodDetailsResponse::Giropay)
-                            | Some(StripePaymentMethodDetailsResponse::Przelewy24)
-                            | Some(StripePaymentMethodDetailsResponse::Card { .. })
-                            | Some(StripePaymentMethodDetailsResponse::Klarna)
-                            | Some(StripePaymentMethodDetailsResponse::Affirm)
-                            | Some(StripePaymentMethodDetailsResponse::AfterpayClearpay)
-                            | Some(StripePaymentMethodDetailsResponse::AmazonPay)
-                            | Some(StripePaymentMethodDetailsResponse::ApplePay)
-                            | Some(StripePaymentMethodDetailsResponse::Ach)
-                            | Some(StripePaymentMethodDetailsResponse::Sepa)
-                            | Some(StripePaymentMethodDetailsResponse::Becs)
-                            | Some(StripePaymentMethodDetailsResponse::Bacs)
-                            | Some(StripePaymentMethodDetailsResponse::Wechatpay)
-                            | Some(StripePaymentMethodDetailsResponse::Alipay)
-                            | Some(StripePaymentMethodDetailsResponse::CustomerBalance)
-                            | Some(StripePaymentMethodDetailsResponse::Cashapp { .. })
-                            | None => payment_method_id.expose(),
-                        }
-                    }
-                    Some(StripeChargeEnum::ChargeId(_)) | None => payment_method_id.expose(),
-                };
+                let payment_method_id =
+                    get_payment_method_id(item.response.latest_charge.clone(), payment_method_id);
+
                 types::MandateReference {
-                    connector_mandate_id,
+                    connector_mandate_id: Some(payment_method_id.clone()),
                     payment_method_id: Some(payment_method_id),
                     mandate_metadata: None,
                     connector_mandate_request_reference_id: None,

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->

this pr aims to fix the stripe bank redirect recurring mandate.

for context, `bancontact` recurring mandates happen via `sepa direct debit` and hence, stripe sends 2 connector mandate ids as shown below:

```json
{
"payment_method": "pm_somevalue_1",
  "payment_method_details": {
    "bancontact": {
      "generated_sepa_debit": "pm_somevalue_2",
      "generated_sepa_debit_mandate": "mandate_somevalue",
    },
}
```

in order to do a recurring mandate, we are expected to pass the second connector mandate id. at the moment of me writing this, what is happening is that we pass the first connector mandate id that results in the recurring transaction to fail with error message provided in `motivation and context` section.

the fix is to pass second connector mandte id for the payment methods that requires it.

area of impact:

- stripe recurring payments. ideally, this shouldn't affect any other payment method since this pr have no logic change. also, we fallback to using first connector mandate id if we do not get second connector mandate 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
<!--
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).
-->

bancontact card bank redirect recurring mandates were failing with below message:

```
"The provided bancontact PaymentMethod cannot be used again. It was used in a previous PaymentIntent or SetupIntent to set up a sepa_debit PaymentMethod, which can be used for multiple payments. To find the ID of the sepa_debit PaymentMethod, list the sepa_debit PaymentMethods associated with the Customer used to set up this PaymentMethod."
```

this is not intended and should be fixed since the connector is live on production.

closes #7989

## 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)?
-->

### bancontact_card

<details>

<summary>create payment intent</summary>

request:

```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71' \
--data-raw '{
  "amount": 6500,
  "order_details": [
    {
      "product_name": "Apple iphone 15",
      "quantity": 1,
      "amount": 6500
    }
  ],
  "currency": "EUR",
  "confirm": false,
  "capture_method": "automatic",
  "authentication_type": "three_ds",
  "setup_future_usage": "off_session",
  "request_external_three_ds_authentication": false,
  "email": "user@gmail.com",
  "description": "Hello this is description",

  "shipping": {
    "address": {
      "state": "California",
      "city": "Banglore",
      "country": "US",
      "line1": "sdsdfsdf",
      "line2": "hsgdbhd",
      "line3": "alsksoe",
      "zip": "571201",
      "first_name": "John",
      "last_name": "Doe"
    },
    "phone": {
      "number": "123456789",
      "country_code": "+1"
    }
  },
  "connector_metadata": {
    "noon": {
      "order_category": "applepay"
    }
  },
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  },
  "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"
    },
    "email": "user@gmail.com",
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "customer_id": "new"
}'
```

response:

```json
{
    "payment_id": "pay_46PJnwYjtyblbSWEEMH5",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "requires_payment_method",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_46PJnwYjtyblbSWEEMH5_secret_hy4q23J6YdCNB1WXw5tD",
    "created": "2025-05-08T11:00:41.266Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "user@gmail.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "new",
        "created_at": 1746702041,
        "expires": 1746705641,
        "secret": "epk_8f136979577f4053accd518f3b11fd29"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:15:41.266Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-05-08T11:00:41.298Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>confirm payment intent</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_46PJnwYjtyblbSWEEMH5/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71' \
--data '{
    "payment_id": "pay_46PJnwYjtyblbSWEEMH5",
    "payment_method_data": {
        "bank_redirect": {
            "bancontact_card": {
                "card_number": null,
                "card_exp_month": null,
                "card_exp_year": null,
                "card_holder_name": null,
                "billing_details": null
            }
        }
    },
    "payment_method": "bank_redirect",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2025-05-07T09:30:52.779Z",
            "online": {
                "ip_address": "103.23.45.1",
                "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00Z",
                "end_date": "2023-05-21T00:00:00Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
    "browser_info": {
        "color_depth": 24,
        "java_enabled": true,
        "java_script_enabled": true,
        "language": "en-US",
        "screen_height": 1117,
        "screen_width": 1728,
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "os_type": "macOS",
        "os_version": "10.15",
        "device_model": "Macintosh",
        "accept_language": "en"
    },
    "payment_method_type": "bancontact_card",
    "payment_type": "new_mandate"
}'
```

response:

```json
{
    "payment_id": "pay_46PJnwYjtyblbSWEEMH5",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "requires_customer_action",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 6500,
    "amount_received": 0,
    "connector": "stripe",
    "client_secret": "pay_46PJnwYjtyblbSWEEMH5_secret_hy4q23J6YdCNB1WXw5tD",
    "created": "2025-05-08T11:00:41.266Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_GRW76jmrxiK7Cs8FDIJr",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2025-05-07T09:30:52.779Z",
            "online": {
                "ip_address": "103.23.45.1",
                "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00.000Z",
                "end_date": "2023-05-21T00:00:00.000Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {
            "type": "BankRedirectResponse",
            "bank_name": null,
            "BancontactCard": {
                "last4": null,
                "card_exp_month": null,
                "card_exp_year": null,
                "card_holder_name": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "user@gmail.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "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_46PJnwYjtyblbSWEEMH5/spriteMerchantBornAt1746687723/pay_46PJnwYjtyblbSWEEMH5_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "bancontact_card",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "pi_3RMSCKD5R7gDAGff0e5Xcr6s",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": "pi_3RMSCKD5R7gDAGff0e5Xcr6s",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:15:41.266Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "os_version": "10.15",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_method_id": "pm_gtwOpqeWWinhXFQIDNol",
    "payment_method_status": null,
    "updated": "2025-05-08T11:01:05.114Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>redirection</summary>

|image|
|-|
|<img width="1707" alt="image" src="https://github.com/user-attachments/assets/b810dd24-52d2-4eae-9da1-218a7f6d263e" />|
|<img width="873" alt="image" src="https://github.com/user-attachments/assets/85a8c5ef-317d-4e7c-baca-b437457f57e7" />|

</details>

<details>

<summary>retrieve payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_46PJnwYjtyblbSWEEMH5?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71'
```

response:

```json
{
    "payment_id": "pay_46PJnwYjtyblbSWEEMH5",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "succeeded",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6500,
    "connector": "stripe",
    "client_secret": "pay_46PJnwYjtyblbSWEEMH5_secret_hy4q23J6YdCNB1WXw5tD",
    "created": "2025-05-08T11:00:41.266Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_GRW76jmrxiK7Cs8FDIJr",
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {
            "type": "BankRedirectResponse",
            "bank_name": null,
            "BancontactCard": {
                "last4": null,
                "card_exp_month": null,
                "card_exp_year": null,
                "card_holder_name": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "user@gmail.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "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": "bancontact_card",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMSCKD5R7gDAGff0e5Xcr6s",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": "pi_3RMSCKD5R7gDAGff0e5Xcr6s",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:15:41.266Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "os_version": "10.15",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_method_id": "pm_gtwOpqeWWinhXFQIDNol",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:01:46.108Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>recurring payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71' \
--data '{
    "amount": 999,
    "currency": "EUR",
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "confirm": true,
    "customer_id": "new",
    "off_session": true,
    "description": "Hello this is description",
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_gtwOpqeWWinhXFQIDNol"
    }
}'
```

response:

```json
{
    "payment_id": "pay_9mzLCnix44o1qsG7iqQk",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "processing",
    "amount": 999,
    "net_amount": 999,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 0,
    "connector": "stripe",
    "client_secret": "pay_9mzLCnix44o1qsG7iqQk_secret_VIhPpAB29hISqbDVRk5d",
    "created": "2025-05-08T11:04:06.681Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": "bancontact_card",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "new",
        "created_at": 1746702246,
        "expires": 1746705846,
        "secret": "epk_d600fbfd15cb48ea8c172d73aafe95d5"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMSFHD5R7gDAGff1bbPj0tS",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMSFHD5R7gDAGff1bbPj0tS",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:19:06.681Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_gtwOpqeWWinhXFQIDNol",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:04:08.011Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1RMSCyD5R7gDAGffKy7iS7J8",
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```

</details>

<details>
<summary>retrieve payment</summary>

it takes a few seconds for the payment to get `succeeded`. since scheduler has not been set up locally, i had to manually do a force sync. process tracker should take care of this.

request:

```curl
curl --location 'http://localhost:8080/payments/pay_9mzLCnix44o1qsG7iqQk?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71'
```

response:

```json
{
    "payment_id": "pay_9mzLCnix44o1qsG7iqQk",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "succeeded",
    "amount": 999,
    "net_amount": 999,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 999,
    "connector": "stripe",
    "client_secret": "pay_9mzLCnix44o1qsG7iqQk_secret_VIhPpAB29hISqbDVRk5d",
    "created": "2025-05-08T11:04:06.681Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_redirect",
    "payment_method_data": {
        "billing": {
            "address": {
                "city": "San Fransico",
                "country": "US",
                "line1": "1467",
                "line2": "Harrison Street",
                "line3": "Harrison Street",
                "zip": "94122",
                "state": "California",
                "first_name": "joseph",
                "last_name": "Doe"
            },
            "phone": {
                "number": "8056594427",
                "country_code": "+91"
            },
            "email": "user@gmail.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": "bancontact_card",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMSFHD5R7gDAGff1bbPj0tS",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMSFHD5R7gDAGff1bbPj0tS",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:19:06.681Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_gtwOpqeWWinhXFQIDNol",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:04:24.246Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1RMSCyD5R7gDAGffKy7iS7J8",
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```

</details>

### cards

just to be safe, tested cards as well (no other payment methods should be affected with this change other than bancontact and ideal):

<details>

<summary>create payment intent</summary>

request:

```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71' \
--data-raw '{
  "amount": 6500,
  "order_details": [
    {
      "product_name": "Apple iphone 15",
      "quantity": 1,
      "amount": 6500
    }
  ],
  "currency": "EUR",
  "confirm": false,
  "capture_method": "automatic",
  "authentication_type": "no_three_ds",
  "setup_future_usage": "off_session",
  "request_external_three_ds_authentication": false,
  "email": "user@gmail.com",
  "description": "Hello this is description",

  "shipping": {
    "address": {
      "state": "California",
      "city": "Banglore",
      "country": "US",
      "line1": "sdsdfsdf",
      "line2": "hsgdbhd",
      "line3": "alsksoe",
      "zip": "571201",
      "first_name": "John",
      "last_name": "Doe"
    },
    "phone": {
      "number": "123456789",
      "country_code": "+1"
    }
  },
  "connector_metadata": {
    "noon": {
      "order_category": "applepay"
    }
  },
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  },
  "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"
    },
    "email": "user@gmail.com",
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "customer_id": "new"
}'
```

response:

```json
{
    "payment_id": "pay_HBBoIetDibOlU7NZd1Qv",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "requires_payment_method",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_HBBoIetDibOlU7NZd1Qv_secret_0wbaBIpByiAF96MgiX9l",
    "created": "2025-05-08T11:31:34.614Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "user@gmail.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "new",
        "created_at": 1746703894,
        "expires": 1746707494,
        "secret": "epk_c491860832564ff5bd1561fe0715c809"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:46:34.614Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-05-08T11:31:34.628Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>confirm payment intent</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_HBBoIetDibOlU7NZd1Qv/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71' \
--data '{
    "payment_id": "pay_HBBoIetDibOlU7NZd1Qv",
    "payment_method": "card",
    "payment_method_type": "debit",
    "payment_method_data": {
        "card": {
            "card_number": "4111111111111111",
            "card_exp_month": "01",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "card_cvc": "100"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "online",
        "accepted_at": "2025-05-07T09:30:52.779Z",
        "online": {
            "ip_address": "103.23.45.1",
            "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0"
        }
    },
    "browser_info": {
        "color_depth": 24,
        "java_enabled": true,
        "java_script_enabled": true,
        "language": "en-US",
        "screen_height": 1117,
        "screen_width": 1728,
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "os_type": "macOS",
        "os_version": "10.15",
        "device_model": "Macintosh",
        "accept_language": "en"
    },
    "payment_type": "new_mandate"
}'
```

response:

```json
{
    "payment_id": "pay_HBBoIetDibOlU7NZd1Qv",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "succeeded",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6500,
    "connector": "stripe",
    "client_secret": "pay_HBBoIetDibOlU7NZd1Qv_secret_0wbaBIpByiAF96MgiX9l",
    "created": "2025-05-08T11:31:34.614Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "JP Morgan",
            "card_issuing_country": "INDIA",
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "cvc_check": "pass",
                "address_line1_check": "pass",
                "address_postal_code_check": "pass"
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "user@gmail.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMShLD5R7gDAGff0J19UjFK",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": "pi_3RMShLD5R7gDAGff0J19UjFK",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:46:34.614Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "os_version": "10.15",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_method_id": "pm_zRfLjuiAL44Uxnk817X1",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:33:08.445Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1RMShLD5R7gDAGffHkC1jRTH",
    "card_discovery": "manual",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```

</details>

<details>

<summary>retrieve payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_HBBoIetDibOlU7NZd1Qv?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71'
```

response:

```json
{
    "payment_id": "pay_HBBoIetDibOlU7NZd1Qv",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "succeeded",
    "amount": 6500,
    "net_amount": 6500,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6500,
    "connector": "stripe",
    "client_secret": "pay_HBBoIetDibOlU7NZd1Qv_secret_0wbaBIpByiAF96MgiX9l",
    "created": "2025-05-08T11:31:34.614Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "JP Morgan",
            "card_issuing_country": "INDIA",
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": {
                "cvc_check": "pass",
                "address_line1_check": "pass",
                "address_postal_code_check": "pass"
            },
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "Banglore",
            "country": "US",
            "line1": "sdsdfsdf",
            "line2": "hsgdbhd",
            "line3": "alsksoe",
            "zip": "571201",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": {
            "number": "123456789",
            "country_code": "+1"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "user@gmail.com"
    },
    "order_details": [
        {
            "brand": null,
            "amount": 6500,
            "category": null,
            "quantity": 1,
            "tax_rate": null,
            "product_id": null,
            "product_name": "Apple iphone 15",
            "product_type": null,
            "sub_category": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null
        }
    ],
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMShLD5R7gDAGff0J19UjFK",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": {
        "apple_pay": null,
        "airwallex": null,
        "noon": {
            "order_category": "applepay"
        },
        "braintree": null,
        "adyen": null
    },
    "feature_metadata": null,
    "reference_id": "pi_3RMShLD5R7gDAGff0J19UjFK",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:46:34.614Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "os_version": "10.15",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_method_id": "pm_zRfLjuiAL44Uxnk817X1",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:33:08.445Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>recurring payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71' \
--data '{
    "amount": 999,
    "currency": "EUR",
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "confirm": true,
    "customer_id": "new",
    "off_session": true,
    "description": "Hello this is description",
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_zRfLjuiAL44Uxnk817X1"
    }
}'
```

response:

```json
{
    "payment_id": "pay_G1ksB3bXcirAt7CtsYP9",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "succeeded",
    "amount": 999,
    "net_amount": 999,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 999,
    "connector": "stripe",
    "client_secret": "pay_G1ksB3bXcirAt7CtsYP9_secret_JJMUdSp6SpS7jpMq49XJ",
    "created": "2025-05-08T11:33:31.891Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "JP Morgan",
            "card_issuing_country": "INDIA",
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": "new",
        "created_at": 1746704011,
        "expires": 1746707611,
        "secret": "epk_500bb0e95274419294502e0009d42a7a"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMShkD5R7gDAGff0wXmhdaI",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMShkD5R7gDAGff0wXmhdaI",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:48:31.891Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_zRfLjuiAL44Uxnk817X1",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:33:33.085Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1RMShLD5R7gDAGffHkC1jRTH",
    "card_discovery": "manual",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```

</details>

<details>

<summary>retrieve payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_G1ksB3bXcirAt7CtsYP9?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_12v5OB2ziszoDZL6Nl9nxIG65eJoFm4PtRKPayOZWpsCy74L5XTztLZX5N71VJ71'
```

response:

```json
{
    "payment_id": "pay_G1ksB3bXcirAt7CtsYP9",
    "merchant_id": "spriteMerchantBornAt1746687723",
    "status": "succeeded",
    "amount": 999,
    "net_amount": 999,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 999,
    "connector": "stripe",
    "client_secret": "pay_G1ksB3bXcirAt7CtsYP9_secret_JJMUdSp6SpS7jpMq49XJ",
    "created": "2025-05-08T11:33:31.891Z",
    "currency": "EUR",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": null,
        "email": "user@gmail.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": "CREDIT",
            "card_network": "Visa",
            "card_issuer": "JP Morgan",
            "card_issuing_country": "INDIA",
            "card_isin": "411111",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "2030",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": {
                "city": "San Fransico",
                "country": "US",
                "line1": "1467",
                "line2": "Harrison Street",
                "line3": "Harrison Street",
                "zip": "94122",
                "state": "California",
                "first_name": "joseph",
                "last_name": "Doe"
            },
            "phone": {
                "number": "8056594427",
                "country_code": "+91"
            },
            "email": "user@gmail.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "user@gmail.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMShkD5R7gDAGff0wXmhdaI",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMShkD5R7gDAGff0wXmhdaI",
    "payment_link": null,
    "profile_id": "pro_HJPiTC1q4eKhHsitqxTn",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_nRFLCSCqPa4judlbaHUi",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T11:48:31.891Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_zRfLjuiAL44Uxnk817X1",
    "payment_method_status": "active",
    "updated": "2025-05-08T11:33:33.085Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

### sepa bank debit

<details>

<summary>create payment intent</summary>

request:

```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XUootVtd5tq25XA9K0SB0i4RO3pTTnpbWHebsUNfRig5WL5tSfBOneCjirenpAbP' \
--data-raw '{
    "amount": 1800,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "customer_id": "new",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "three_ds",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "return_url": "https://duck.com",
    "setup_future_usage": "off_session",
    "business_country": "US",
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "HarrisonStreet",
            "line3": "HarrisonStreet",
            "city": "SanFransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "Swangi",
            "last_name": "Kumari"
        }
    },
    "metadata": {
        "order_details": {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 1800,
            "account_name": "transaction_processing"
        }
    }
}'
```

response:

```json
{
    "payment_id": "pay_D33h9y1S7XIksb1w2QgY",
    "merchant_id": "spriteMerchantBornAt1746713671",
    "status": "requires_payment_method",
    "amount": 1800,
    "net_amount": 1800,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_D33h9y1S7XIksb1w2QgY_secret_d8ZcBuLS0GFvx41fzBC7",
    "created": "2025-05-08T14:55:42.337Z",
    "currency": "USD",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": "John Doe",
        "email": "guest@example.com",
        "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": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "SanFransico",
            "country": "US",
            "line1": "1467",
            "line2": "HarrisonStreet",
            "line3": "HarrisonStreet",
            "zip": "94122",
            "state": "California",
            "first_name": "Swangi",
            "last_name": "Kumari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "authentication_type": "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": null,
    "connector_label": null,
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "new",
        "created_at": 1746716142,
        "expires": 1746719742,
        "secret": "epk_6373b3d1a39548e1abdde6e0ae993a13"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "order_details": {
            "amount": 1800,
            "quantity": 1,
            "account_name": "transaction_processing",
            "product_name": "Apple iphone 15"
        }
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_Vy4QgpvAOgLLqtMSro11",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T15:10:42.337Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-05-08T14:55:42.346Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>confirm payment intent</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_1lAtqj68APg0Lzz1RBZ7/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XUootVtd5tq25XA9K0SB0i4RO3pTTnpbWHebsUNfRig5WL5tSfBOneCjirenpAbP' \
--data-raw '{
    "payment_id": "pay_1lAtqj68APg0Lzz1RBZ7",
    "payment_method": "bank_debit",
    "payment_method_type": "ach",
    "payment_method_data": {
        "bank_debit": {
            "ach_bank_debit": {
                "billing_details": {
                    "name": "John Doe",
                    "email": "johndoe@example.com"
                },
                "account_number": "000123456789",
                "routing_number": "110000000"
            }
        }
    },
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD"
            }
        }
    },
    "browser_info": {
        "color_depth": 24,
        "java_enabled": true,
        "java_script_enabled": true,
        "language": "en-US",
        "screen_height": 1117,
        "screen_width": 1728,
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "os_type": "macOS",
        "os_version": "10.15",
        "device_model": "Macintosh",
        "accept_language": "en"
    },
    "payment_type": "new_mandate"
}'
```

response:

```json
{
    "payment_id": "pay_D33h9y1S7XIksb1w2QgY",
    "merchant_id": "spriteMerchantBornAt1746713671",
    "status": "requires_customer_action",
    "amount": 1800,
    "net_amount": 1800,
    "shipping_cost": null,
    "amount_capturable": 1800,
    "amount_received": 0,
    "connector": "stripe",
    "client_secret": "pay_D33h9y1S7XIksb1w2QgY_secret_d8ZcBuLS0GFvx41fzBC7",
    "created": "2025-05-08T14:55:42.337Z",
    "currency": "USD",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_a9rhLB6kISXVyJiI90UO",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12.000Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD",
                "start_date": null,
                "end_date": null,
                "metadata": null
            }
        }
    },
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_debit",
    "payment_method_data": {
        "bank_debit": {
            "ach": {
                "account_number": "0001****6789",
                "routing_number": "110***000",
                "card_holder_name": null,
                "bank_account_holder_name": null,
                "bank_name": null,
                "bank_type": null,
                "bank_holder_type": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "SanFransico",
            "country": "US",
            "line1": "1467",
            "line2": "HarrisonStreet",
            "line3": "HarrisonStreet",
            "zip": "94122",
            "state": "California",
            "first_name": "Swangi",
            "last_name": "Kumari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "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_D33h9y1S7XIksb1w2QgY/spriteMerchantBornAt1746713671/pay_D33h9y1S7XIksb1w2QgY_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "ach",
    "connector_label": "stripe_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "pi_3RMVrQD5R7gDAGff0m8bN954",
    "frm_message": null,
    "metadata": {
        "order_details": {
            "amount": 1800,
            "quantity": 1,
            "account_name": "transaction_processing",
            "product_name": "Apple iphone 15"
        }
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMVrQD5R7gDAGff0m8bN954",
    "payment_link": null,
    "profile_id": "pro_Vy4QgpvAOgLLqtMSro11",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YjqGIfO85PF6xZnG3Ouq",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T15:10:42.337Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "os_version": "10.15",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_method_id": "pm_FS5SzbT7bfiigu9uBFYb",
    "payment_method_status": null,
    "updated": "2025-05-08T14:55:44.926Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>retrieve payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_1lAtqj68APg0Lzz1RBZ7?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_XUootVtd5tq25XA9K0SB0i4RO3pTTnpbWHebsUNfRig5WL5tSfBOneCjirenpAbP'
```

response:

```json
{
    "payment_id": "pay_D33h9y1S7XIksb1w2QgY",
    "merchant_id": "spriteMerchantBornAt1746713671",
    "status": "succeeded",
    "amount": 1800,
    "net_amount": 1800,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 1800,
    "connector": "stripe",
    "client_secret": "pay_D33h9y1S7XIksb1w2QgY_secret_d8ZcBuLS0GFvx41fzBC7",
    "created": "2025-05-08T14:55:42.337Z",
    "currency": "USD",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_a9rhLB6kISXVyJiI90UO",
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_debit",
    "payment_method_data": {
        "bank_debit": {
            "ach": {
                "account_number": "0001****6789",
                "routing_number": "110***000",
                "card_holder_name": null,
                "bank_account_holder_name": null,
                "bank_name": null,
                "bank_type": null,
                "bank_holder_type": null
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "SanFransico",
            "country": "US",
            "line1": "1467",
            "line2": "HarrisonStreet",
            "line3": "HarrisonStreet",
            "zip": "94122",
            "state": "California",
            "first_name": "Swangi",
            "last_name": "Kumari"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://duck.com/",
    "authentication_type": "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": "ach",
    "connector_label": "stripe_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMVrQD5R7gDAGff0m8bN954",
    "frm_message": null,
    "metadata": {
        "order_details": {
            "amount": 1800,
            "quantity": 1,
            "account_name": "transaction_processing",
            "product_name": "Apple iphone 15"
        }
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMVrQD5R7gDAGff0m8bN954",
    "payment_link": null,
    "profile_id": "pro_Vy4QgpvAOgLLqtMSro11",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YjqGIfO85PF6xZnG3Ouq",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T15:10:42.337Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": "macOS",
        "language": "en-US",
        "time_zone": -330,
        "ip_address": "103.159.11.202",
        "os_version": "10.15",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0",
        "color_depth": 24,
        "device_model": "Macintosh",
        "java_enabled": true,
        "screen_width": 1728,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 1117,
        "accept_language": "en",
        "java_script_enabled": true
    },
    "payment_method_id": "pm_FS5SzbT7bfiigu9uBFYb",
    "payment_method_status": "active",
    "updated": "2025-05-08T14:56:21.244Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": 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
}
```

</details>

<details>

<summary>recurring payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_XUootVtd5tq25XA9K0SB0i4RO3pTTnpbWHebsUNfRig5WL5tSfBOneCjirenpAbP' \
--data '{
    "amount": 999,
    "currency": "USD",
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "confirm": true,
    "customer_id": "new",
    "off_session": true,
    "description": "Hello this is description"
    ,
    "recurring_details": {
        "type": "mandate_id",
        "data": "man_a9rhLB6kISXVyJiI90UO"
    }
}'
```

response:

```json
{
    "payment_id": "pay_1lAtqj68APg0Lzz1RBZ7",
    "merchant_id": "spriteMerchantBornAt1746713671",
    "status": "processing",
    "amount": 999,
    "net_amount": 999,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 0,
    "connector": "stripe",
    "client_secret": "pay_1lAtqj68APg0Lzz1RBZ7_secret_qXpuGLVGCrCAQgfRWj6y",
    "created": "2025-05-08T14:59:41.984Z",
    "currency": "USD",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_debit",
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": null,
    "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": "ach",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "new",
        "created_at": 1746716381,
        "expires": 1746719981,
        "secret": "epk_6ae53619f23e479aaa49fe78ff0ad42b"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMVvGD5R7gDAGff0gI0w0fr",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMVvGD5R7gDAGff0gI0w0fr",
    "payment_link": null,
    "profile_id": "pro_Vy4QgpvAOgLLqtMSro11",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YjqGIfO85PF6xZnG3Ouq",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T15:14:41.984Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_FS5SzbT7bfiigu9uBFYb",
    "payment_method_status": "active",
    "updated": "2025-05-08T14:59:42.837Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1RMVrQD5R7gDAGffic9TPCEG",
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```

</details>

<details>

<summary>retrieve payment</summary>

request:

```curl
curl --location 'http://localhost:8080/payments/pay_1lAtqj68APg0Lzz1RBZ7?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_XUootVtd5tq25XA9K0SB0i4RO3pTTnpbWHebsUNfRig5WL5tSfBOneCjirenpAbP'
```

response:

```json
{
    "payment_id": "pay_1lAtqj68APg0Lzz1RBZ7",
    "merchant_id": "spriteMerchantBornAt1746713671",
    "status": "succeeded",
    "amount": 999,
    "net_amount": 999,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 999,
    "connector": "stripe",
    "client_secret": "pay_1lAtqj68APg0Lzz1RBZ7_secret_qXpuGLVGCrCAQgfRWj6y",
    "created": "2025-05-08T14:59:41.984Z",
    "currency": "USD",
    "customer_id": "new",
    "customer": {
        "id": "new",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Hello this is description",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "bank_debit",
    "payment_method_data": {
        "billing": {
            "address": {
                "city": "SanFransico",
                "country": "US",
                "line1": "1467",
                "line2": "HarrisonStreet",
                "line3": "HarrisonStreet",
                "zip": "94122",
                "state": "California",
                "first_name": "John Doe",
                "last_name": null
            },
            "phone": null,
            "email": "johndoe@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": null,
    "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": "ach",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pi_3RMVvGD5R7gDAGff0gI0w0fr",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pi_3RMVvGD5R7gDAGff0gI0w0fr",
    "payment_link": null,
    "profile_id": "pro_Vy4QgpvAOgLLqtMSro11",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_YjqGIfO85PF6xZnG3Ouq",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-05-08T15:14:41.984Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_FS5SzbT7bfiigu9uBFYb",
    "payment_method_status": "active",
    "updated": "2025-05-08T15:00:06.980Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "pm_1RMVrQD5R7gDAGffic9TPCEG",
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null
}
```

</details>

## 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
