Skip to content

Conversation

awasthi21
Copy link
Contributor

@awasthi21 awasthi21 commented Jan 31, 2025

Type of Change

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

Description

  1. Pass 3 Digit Numeric Code in CountryCode instead of the country alphaCode for Paybox 3DS Request

Additional Changes

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

Motivation and Context

How did you test it?

Request(Passing Afganistan country (CountryCode - 004)

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_iKUBW9o3CANJY9ComnkX7CuEjmzzz2jCDbAmyBJXR9P7hwo7CBi4dRnjn2GGFWJE' \
--data-raw '{
    "amount": 500,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "authentication_type": "three_ds",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "BamboraCustomer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "payment_method": "card",
    "payment_method_type": "credit",
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "AF",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "payment_method_data": {
        "card": {
            "card_number": "1111222233334444",
            "card_exp_month": "01",
            "card_exp_year": "26",
            "card_holder_name": "John Doe",
            "card_cvc": "123"
        }
    }
}'
Screenshot 2025-01-31 at 4 03 24 PM

Response

{
    "payment_id": "pay_aKjgWIifYZFLRwIjtbhh",
    "merchant_id": "postman_merchant_GHAction_e51ea646-b39c-414b-99da-da68d80d7045",
    "status": "requires_customer_action",
    "amount": 500,
    "net_amount": 500,
    "shipping_cost": null,
    "amount_capturable": 500,
    "amount_received": null,
    "connector": "paybox",
    "client_secret": "pay_aKjgWIifYZFLRwIjtbhh_secret_aUO6I6vJfEn2DHK3KCym",
    "created": "2025-01-31T10:28:58.317Z",
    "currency": "EUR",
    "customer_id": "BamboraCustomer",
    "customer": {
        "id": "BamboraCustomer",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4444",
            "card_type": "DEBIT",
            "card_network": "Visa",
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "111122",
            "card_extended_bin": null,
            "card_exp_month": "01",
            "card_exp_year": "26",
            "card_holder_name": "John Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_nzPbWyMuMs8hyroRaEqF",
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "AF",
            "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": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "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_aKjgWIifYZFLRwIjtbhh/postman_merchant_GHAction_e51ea646-b39c-414b-99da-da68d80d7045/pay_aKjgWIifYZFLRwIjtbhh_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "debit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "BamboraCustomer",
        "created_at": 1738319338,
        "expires": 1738322938,
        "secret": "epk_dd0ccdd8afc3425eb566606e4ce3e5bc"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_iHMjSjCk8knjnqbSB7fd",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_xR4q2hdv7RK55PirKNeo",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-01-31T10:43:58.317Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-01-31T10:28:59.879Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

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

@awasthi21 awasthi21 added the A-connector-integration Area: Connector integration label Jan 31, 2025
@awasthi21 awasthi21 self-assigned this Jan 31, 2025
@awasthi21 awasthi21 requested a review from a team as a code owner January 31, 2025 09:35
Copy link

semanticdiff-com bot commented Jan 31, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs  68% smaller

@@ -148,7 +148,7 @@ pub struct ThreeDSPaymentsRequest {
address1: Secret<String>,
zip_code: Secret<String>,
city: String,
country_code: api_models::enums::CountryAlpha2,
country_code: i32,
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this string

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 3, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 3, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 4, 2025
@SanchithHegde SanchithHegde added this pull request to the merge queue Feb 4, 2025
Merged via the queue into main with commit a614c20 Feb 4, 2025
17 of 20 checks passed
@SanchithHegde SanchithHegde deleted the paybox-3ds-changes branch February 4, 2025 19:25
Narayanbhat166 pushed a commit that referenced this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants