Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connector): implement auth and post auth flows for gpayments #4746

Merged
merged 28 commits into from
Jun 11, 2024

Conversation

KiranKBR
Copy link
Contributor

@KiranKBR KiranKBR commented May 23, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

I have implemented Auth and Post Auth flows for GPayments and GPayments is a Authenticator connector

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

https://github.com/juspay/hyperswitch-cloud/issues/4996

How did you test it?

I have tested it with postman apis
the apis:

3ds connector copy request :

curl --location 'http://127.0.0.1:8080/account/postman_merchant_GHAction_811c1f66-4460-4046-bbf3-6fcb0aaf752e/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
    "connector_type": "authentication_processor",
    "business_country": "US",
    "business_label": "default",
    "connector_name": "gpayments",
    "connector_account_details": {
        "auth_type": "CertificateAuth",
        "certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVRVENDQXltZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREJVTVFzd0NRWURWUVFHRXdKQlZURWcKTUI0R0ExVUVDaE1YWVhCaFl5NWhZM1JwZG1WelpYSjJaWEl1WTJ4dmRXUXhJekFoQmdOVkJBTVRHbUZ3WVdNdQpZV04wYVhabGMyVnlkbVZ5TG1Oc2IzVmtJRU5CTUI0WERUSTBNRFF4TmpBMk1EUTBNbG9YRFRJMk1EUXhOakEyCk1EUTBNbG93ZFRFTE1Ba0dBMVVFQmhNQ1FWVXhEREFLQmdOVkJBZ01BMDVUVnpFV01CUUdBMVVFQ2d3TlozQmgKZVcxbGJuUnpMbU52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ITmg1CmljaVRMenNvTlh0M2NXY0laRFY2ejRkVm5JV1pSOFpBdVZOK2lPN2tZMXpKYzZBekZsQzBSSENLTXVuOXBSbTUKV3lNSUdZYlc0Q2MrUkFLUUpXb3RiU1FlCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0="
    },
    "test_mode": true,
    "disabled": false,
    "metadata": {
        "mcc": "5411",
        "merchant_country_code": "840",
        "merchant_name": "Dummy Merchant",
        "endpoint_prefix": "hyperswitch",
        "merchant_id": "123456789012345",
        "three_ds_requestor_name": "juspay-prev",
        "three_ds_requestor_id": "juspay-prev"
    }
}'

response:

{
    "connector_type": "authentication_processor",
    "connector_name": "gpayments",
    "connector_label": "gpayments_US_default",
    "merchant_connector_id": "mca_bukfVrxKQM8bJRtssq8F",
    "profile_id": "pro_g8uCPX2CjliGbOyhz5Vi",
    "connector_account_details": {
        "auth_type": "CertificateAuth",
        "certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVRVENDQXltZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBREJVTVFzd0NRWURWUVFHRXdKQlZURWcKTUI0R0ExVUVDaE1YWVhCaFl5NWhZM1JwZG1WelpYSjJaWEl1WTJ4dmRXUXhJekFoQmdOVkJBTVRHbUZ3WVdNdQpZV04wYVhabGMyVnlkbVZ5TG1Oc2IzVmtJRU5CTUI0WERUSTBNRFF4TmpBMk1EUTBNbG9YRFRJMk1EUXhOakEyCk1EUTBNbG93ZFRFTE1Ba0dBMVVFQmhNQ1FWVXhEREFLQmdOVkJBZ01BMDVUVnpFV01CUUdBMVVFQ2d3TlozQmgKZVcxbGJuUnpMbU52YlRFUk1BOEdBMVVFQ3d3SU0wUlRaV04xY21VeExUQXJCZ05WQkFNTUpEVXdOV1UxWVRRMwpMVE5tWkRFdE5HRTRZaTA1Wm1RekxXSXhNalkyTWpsalpUSm1OVENDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFECmdnRVB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    },
    "payment_methods_enabled": null,
    "connector_webhook_details": null,
    "metadata": {
        "mcc": "5411",
        "merchant_id": "123456789012345",
        "merchant_name": "Dummy Merchant",
        "endpoint_prefix": "hyperswitch",
        "merchant_country_code": "840",
        "three_ds_requestor_id": "juspay-prev",
        "three_ds_requestor_name": "juspay-prev"
    },
    "test_mode": true,
    "disabled": false,
    "frm_configs": null,
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "applepay_verified_domains": null,
    "pm_auth_config": null,
    "status": "active"
}

Payment request:

curl --location 'http://127.0.0.1:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ApP2fyyH9lm9BD6lkWxA71R8csQddbhxsg40dl1NTLCK2MgKP5Z3FpAKxAgDSnA5' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "StripeCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://duck.com",
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        }
    },
    "request_external_three_ds_authentication": true,
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'

response:

{
    "payment_id": "pay_ayUYRcCGjjxEI43RLbbb",
    "merchant_id": "postman_merchant_GHAction_811c1f66-4460-4046-bbf3-6fcb0aaf752e",
    "status": "requires_payment_method",
    "amount": 6540,
    "net_amount": 6540,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_ayUYRcCGjjxEI43RLbbb_secret_4850JvpGNl7gv6Gl2O4x",
    "created": "2024-06-05T07:24:16.465Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "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": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        },
        "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": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "StripeCustomer",
        "created_at": 1717572256,
        "expires": 1717575856,
        "secret": "epk_9afeb0704b044cc0b6b3bc4a7ab06ba9"
    },
    "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": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_g8uCPX2CjliGbOyhz5Vi",
    "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": "2024-06-05T07:39:16.465Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-05T07:24:16.484Z",
    "charges": null,
    "frm_metadata": null
}

Payment confirm:

curl --location 'http://127.0.0.1:8080/payments/pay_ayUYRcCGjjxEI43RLbbb/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_38eb3399b2b74c2784c8f89c4b83b08a' \
--data '{
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "115.99.183.2"
    },
    "client_secret": "pay_ayUYRcCGjjxEI43RLbbb_secret_4850JvpGNl7gv6Gl2O4x",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            
            
            
            
            "card_number": "4100000000500000",
            "card_exp_month": "08",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    }
}'

response:

{
    "payment_id": "pay_ayUYRcCGjjxEI43RLbbb",
    "merchant_id": "postman_merchant_GHAction_811c1f66-4460-4046-bbf3-6fcb0aaf752e",
    "status": "requires_customer_action",
    "amount": 6540,
    "net_amount": 6540,
    "amount_capturable": 6540,
    "amount_received": null,
    "connector": "checkout",
    "client_secret": "pay_ayUYRcCGjjxEI43RLbbb_secret_4850JvpGNl7gv6Gl2O4x",
    "created": "2024-06-05T07:24:16.465Z",
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "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": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": "token_WoMUz8Xzp0WDx2xUBadu",
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "PiX",
            "last_name": null
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        },
        "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": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "three_ds_invoke",
        "three_ds_data": {
            "three_ds_authentication_url": "http://localhost:8080/payments/pay_ayUYRcCGjjxEI43RLbbb/3ds/authentication",
            "three_ds_authorize_url": "http://localhost:8080/payments/pay_ayUYRcCGjjxEI43RLbbb/postman_merchant_GHAction_811c1f66-4460-4046-bbf3-6fcb0aaf752e/authorize/checkout",
            "three_ds_method_details": {
                "three_ds_method_key": "threeDSMethodData",
                "three_ds_method_data_submission": false,
                "three_ds_method_data": null,
                "three_ds_method_url": null
            },
            "poll_config": {
                "poll_id": "external_authentication_pay_ayUYRcCGjjxEI43RLbbb",
                "delay_in_secs": 2,
                "frequency": 5
            },
            "message_version": "2.2.0",
            "directory_server_id": 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": null,
    "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": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_g8uCPX2CjliGbOyhz5Vi",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_XQH4bA00lXOZyb8B0ZHf",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": {
        "authentication_flow": null,
        "electronic_commerce_indicator": null,
        "status": "started",
        "ds_transaction_id": "ec3351eb-d4bd-434c-a54d-bc1e9db2f846",
        "version": "2.2.0",
        "error_code": null,
        "error_message": null
    },
    "external_3ds_authentication_attempted": true,
    "expires_on": "2024-06-05T07:39:16.465Z",
    "fingerprint": null,
    "browser_info": {
        "language": "nl-NL",
        "time_zone": 0,
        "ip_address": "115.99.183.2",
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "color_depth": 24,
        "java_enabled": true,
        "screen_width": 1536,
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "screen_height": 723,
        "java_script_enabled": true
    },
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-05T07:24:20.224Z",
    "charges": null,
    "frm_metadata": null
}

Authenticate request:

curl --location 'http://127.0.0.1:8080/payments/pay_ayUYRcCGjjxEI43RLbbb/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_38eb3399b2b74c2784c8f89c4b83b08a' \
--data '{
    "client_secret": "pay_ayUYRcCGjjxEI43RLbbb_secret_4850JvpGNl7gv6Gl2O4x",
    "device_channel": "BRW",
    "threeds_method_comp_ind": "N"
}'

response:

{
    "trans_status": "R",
    "acs_url": null,
    "challenge_request": null,
    "acs_reference_number": null,
    "acs_trans_id": null,
    "three_dsserver_trans_id": "ec3351eb-d4bd-434c-a54d-bc1e9db2f846",
    "acs_signed_content": null
}

Authorize request:

curl --location 'http://127.0.0.1:8080/payments/pay_ayUYRcCGjjxEI43RLbbb/postman_merchant_GHAction_811c1f66-4460-4046-bbf3-6fcb0aaf752e/authorize/checkout' \
--header 'Content-Type: application/json' \
--data '{
    
}'

response:

<head><title>Redirect Form</title>
                                <script>
                                    let return_url = "https://duck.com/?status=failed&payment_intent_client_secret=pay_ayUYRcCGjjxEI43RLbbb_secret_4850JvpGNl7gv6Gl2O4x&amount=6540&manual_retry_allowed=true&signature=2870339f5f41df19ab2de14cd845b54203859ad4d81da218c1d6a8962b9e781a484b26fee0252bc800d6039c6359a6859da2f43b430e8794a88dfa284ef9b84b&signature_algorithm=HMAC-SHA512";
                                    try {
                                        // if inside iframe, send post message to parent for redirection
                                        if (window.self !== window.parent) {
                                            window.top.postMessage({openurl_if_required: return_url}, '*')
                                        // if parent, redirect self to return_url
                                        } else {
                                            window.location.href = return_url
                                        }
                                    }
                                    catch(err) {
                                        // if error occurs, send post message to parent and wait for 10 secs to redirect. if doesn't redirect, redirect self to return_url
                                        window.top.postMessage({openurl_if_required: return_url}, '*')
                                        setTimeout(function() {
                                            window.location.href = return_url
                                        }, 10000);
                                        console.log(err.message)
                                    }
                                </script>
                                </head> <script>function parseRoute(url) {
    const route = new URL(url).pathname;
    const regex = /^\/payments\/redirect\/([^/]+)\/([^/]+)\/([^/]+)$|^\/payments\/([^/]+)\/([^/]+)\/redirect\/response\/([^/]+)(?:\/([^/]+)\/?)?$|^\/payments\/([^/]+)\/([^/]+)\/redirect\/complete\/([^/]+)$/;
    const matches = route.match(regex);
    const attemptIdExists = !(
      route.includes("response") || route.includes("complete")
    );
    if (matches) {
      const [, paymentId, merchantId, attemptId, connector,credsIdentifier] =
        matches;
      return {
        paymentId,
        merchantId,
        attemptId: attemptIdExists ? attemptId : "",
        connector
      };
    } else {
      return {
        paymentId: "",
        merchantId: "",
        attemptId: "",
        connector: "",
      };
    }
  }

  function getEnvRoute(url) {
    const route = new URL(url).hostname;
    return route === "api.hyperswitch.io" ? "https://api.hyperswitch.io/logs/redirection" : "https://sandbox.hyperswitch.io/logs/redirection";
}

  
async function postLog(log, urlToPost) {

    try {
        const response = await fetch(urlToPost, {
        method: "POST",
        mode: "no-cors",
        body: JSON.stringify(log),
        headers: {
            Accept: "application/json",
            "Content-Type": "application/json",
        },
        });
    } catch (err) {
        console.error(`Error in logging: ${err}`);
}
}
  
  
window.addEventListener("error", (event) => {
    let url = window.location.href;
    let { paymentId, merchantId, attemptId, connector } = parseRoute(url);
    let urlToPost = getEnvRoute(url);
    let log = {
        message: event.message,
        url,
        paymentId,
        merchantId,
        attemptId,
        connector,
    };
    postLog(log, urlToPost);
});
  
window.addEventListener("message", (event) => {
    let url = window.location.href;
    let { paymentId, merchantId, attemptId, connector } = parseRoute(url);
    let urlToPost = getEnvRoute(url);
    let log = {
        message: event.data,
        url,
        paymentId,
        merchantId,
        attemptId,
        connector,
    };
    postLog(log, urlToPost);
});
    
    </script>

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

hrithikesh026 and others added 20 commits May 8, 2024 15:28
@KiranKBR KiranKBR requested review from a team as code owners May 23, 2024 11:05
@KiranKBR KiranKBR changed the title Impl auth and post auth flows gpayments feat(connector): implement auth and post auth flows for gpayments May 23, 2024
@KiranKBR KiranKBR self-assigned this May 23, 2024
@KiranKBR KiranKBR force-pushed the impl-auth-and-post_auth-flows-gpayments branch from 3136ecf to 56ed568 Compare May 30, 2024 10:28
Comment on lines 182 to 185
pub enum GpaymentsAuthenticationResponse {
Success(Box<GpaymentsAuthenticationSuccessResponse>),
Error(Box<GpaymentsErrorResponse>),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This untagged enum is not required since Gpayments will always return GpaymentsAuthenticationSuccessResponse with 200 status code.

}

#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
pub struct GpaymentsErrorResponse {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required since pub struct TDS2ApiError { is already available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TDS@ApiError and this struct have different field names

Copy link
Contributor

@hrithikesh026 hrithikesh026 Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i saw from gpayments api documentation that error response structure will always be TDS2ApiError

https://docs.activeserver.cloud/en/api/auth/#/Auth%20API%20V2/BRW_AUTH_V2_1

@@ -68,7 +76,6 @@ impl TryFrom<&GpaymentsRouterData<&types::authentication::PreAuthNVersionCallRou
}
}

//TODO: Fill the struct with respective fields
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
pub struct GpaymentsErrorResponse {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is added by u and i gonna remove that enum and i gonna use this errorstruct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this struct was created during template code generation. But we are not using this anywhere. So I think it is better to get rid of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already using struct TDS2ApiError for deserializing error response.

TryFrom<
types::ResponseRouterData<
api::Authentication,
GpaymentsAuthenticationResponse,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GpaymentsAuthenticationResponse,
GpaymentsAuthenticationSuccessResponse,

fn try_from(
item: types::ResponseRouterData<
api::Authentication,
GpaymentsAuthenticationResponse,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GpaymentsAuthenticationResponse,
GpaymentsAuthenticationSuccessResponse,

@KiranKBR KiranKBR requested a review from hrithikesh026 June 5, 2024 16:25
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jun 11, 2024
Merged via the queue into main with commit d93f65f Jun 11, 2024
10 checks passed
@Gnanasundari24 Gnanasundari24 deleted the impl-auth-and-post_auth-flows-gpayments branch June 11, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants