feat(subscriptions): Add client secret auth support in subscriptions APIs#9713
Merged
likhinbopanna merged 40 commits intomainfrom Oct 8, 2025
Merged
feat(subscriptions): Add client secret auth support in subscriptions APIs#9713likhinbopanna merged 40 commits intomainfrom
likhinbopanna merged 40 commits intomainfrom
Conversation
…h into subscriptions-client-auth
Changed Files
|
2 tasks
jagan-jaya
requested changes
Oct 7, 2025
jagan-jaya
requested changes
Oct 8, 2025
| @@ -0,0 +1,2 @@ | |||
| -- Your SQL goes here | |||
| ALTER TABLE invoice ADD COLUMN IF NOT EXISTS connector_invoice_id VARCHAR(255); No newline at end of file | |||
Contributor
There was a problem hiding this comment.
Suggested change
| ALTER TABLE invoice ADD COLUMN IF NOT EXISTS connector_invoice_id VARCHAR(255); | |
| ALTER TABLE invoice ADD COLUMN IF NOT EXISTS connector_invoice_id VARCHAR(64); |
jagan-jaya
previously approved these changes
Oct 8, 2025
jarnura
requested changes
Oct 8, 2025
| } | ||
|
|
||
| #[derive(serde::Deserialize, serde::Serialize, Debug)] | ||
| pub struct GetSubscriptionQuery { |
Member
There was a problem hiding this comment.
Get-subscription shouldn't be a client call, basically if a merchant wants to update their state with a response of hyperswitch then they shouldn't depend on the client to send data, instead they should depend on server to server communication which is safer and scalable with features
Contributor
Author
There was a problem hiding this comment.
Currently it works with both S2S as well as client. Should we remove the client auth support of this? @jarnura
Contributor
Author
There was a problem hiding this comment.
have removed client secret support
jagan-jaya
approved these changes
Oct 8, 2025
jarnura
approved these changes
Oct 8, 2025
ThisIsMani
approved these changes
Oct 8, 2025
apoorvdixit88
approved these changes
Oct 8, 2025
Contributor
apoorvdixit88
left a comment
There was a problem hiding this comment.
Looks fine for dashboard changes.
aadityaguptaa
pushed a commit
that referenced
this pull request
Nov 10, 2025
…APIs (#9713) Co-authored-by: Prajjwal kumar <write2prajjwal@gmail.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Prajjwal Kumar <prajjwal.kumar@juspay.in> Co-authored-by: Jagan <jaganelavarasan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This pull request introduces several enhancements and refactors to the subscription API, focusing on improving authentication, response structure, and data handling. The main changes include adding payment and invoice details to subscription responses, updating authentication logic to support client secrets in queries, and refactoring handler methods for better error handling and extensibility.
Subscription Response Improvements
paymentandinvoicefields to theSubscriptionResponsestruct to provide more detailed information about payments and invoices associated with a subscription.PaymentResponseDatastruct to use aSecret<String>for theclient_secretfield, improving security and consistency.Authentication and Query Handling
GetSubscriptionQuerystruct to allow passing a client secret when fetching subscription details, and implementedClientSecretFetchfor relevant subscription request/query types. [1] [2]get_subscription,get_subscription_plans, andconfirm_subscription) to extract and validate client secrets from query payloads, improving security and flexibility. [1] [2] [3] [4]Handler and Response Refactoring
to_subscription_responsemethod inSubscriptionWithHandlerto accept optional payment and invoice parameters, and handle invoice conversion with error reporting for invalid currency values. [1] [2]These changes collectively improve the robustness and extensibility of the subscription API, making it easier to integrate payment and invoice details while strengthening authentication mechanisms.
Additional Changes
Motivation and Context
How did you test it?
Response -
Response -
Response -
invoice -

Checklist
cargo +nightly fmt --allcargo clippy