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

chore(config): add support for some more country and currencies for Mifinity Wallet #5797

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

swangi-kumari
Copy link
Contributor

@swangi-kumari swangi-kumari commented Sep 4, 2024

Type of Change

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

Description

hotfix for 5639

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?

  1. Create a payment using currency EGP and country EG
{
    "amount": 100000,
    "currency": "EGP",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 100000,
    "customer_id": "StripeCustomer", 
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "wallet",
    "payment_method_type": "mifinity",
    "payment_method_data": {
        "wallet": {
            "mifinity": {
                "date_of_birth": "2000-10-16",
                "language_preference": "en"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "EG",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "[email protected]"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "profile_id": "pro_l2gYir64ACWigmET5y7i"
}

Response

{
    "payment_id": "pay_A7e9sqGKcK7k0ua81WYR",
    "merchant_id": "merchant_1725010783",
    "status": "requires_customer_action",
    "amount": 100000,
    "net_amount": 100000,
    "amount_capturable": 100000,
    "amount_received": null,
    "connector": "mifinity",
    "client_secret": "pay_A7e9sqGKcK7k0ua81WYR_secret_xW1viCXMq3gzoSEagtAE",
    "created": "2024-08-30T09:45:19.867Z",
    "currency": "EGP",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "EG",
            "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": "[email protected]"
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_A7e9sqGKcK7k0ua81WYR/merchant_1725010783/pay_A7e9sqGKcK7k0ua81WYR_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "mifinity",
    "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": 1725011119,
        "expires": 1725014719,
        "secret": "epk_ba125265f07e4557aac04c1e953a4142"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "pay_A7e9sqGKcK7k0ua81WYR_1",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_A7e9sqGKcK7k0ua81WYR_1",
    "payment_link": null,
    "profile_id": "pro_l2gYir64ACWigmET5y7i",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_D2OVhTVFStcSbDCR4HMk",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-08-30T10:00:19.867Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-08-30T09:45:20.918Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}

We can also test some more combination of country and currency. like currency - AUD and country - AU

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

@swangi-kumari swangi-kumari requested a review from a team as a code owner September 4, 2024 15:37
Copy link

semanticdiff-com bot commented Sep 4, 2024

Review changes with SemanticDiff.

Analyzed 1 of 7 files.

Overall, the semantic diff is 2% smaller than the GitHub diff.

Filename Status
✔️ crates/router/src/configs/defaults.rs 1.09% smaller
config/config.example.toml Unsupported file format
config/development.toml Unsupported file format
config/docker_compose.toml Unsupported file format
config/deployments/integration_test.toml Unsupported file format
config/deployments/production.toml Unsupported file format
config/deployments/sandbox.toml Unsupported file format

@swangi-kumari swangi-kumari self-assigned this Sep 4, 2024
@swangi-kumari swangi-kumari added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement M-configuration-changes Metadata: This PR involves configuration changes labels Sep 4, 2024
@SanchithHegde SanchithHegde merged commit 97e516d into hotfix-2024.08.30.0 Sep 4, 2024
19 of 20 checks passed
@SanchithHegde SanchithHegde deleted the mifinity-config-changes branch September 4, 2024 19:17
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 C-feature Category: Feature request or enhancement M-configuration-changes Metadata: This PR involves configuration changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants