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): [Bambora APAC] Add payment flows #5193

Merged
merged 25 commits into from
Jul 10, 2024

Conversation

Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Jul 3, 2024

Type of Change

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

Description

Added flows for bambora apac
Payment method added: Card (Non-3DS only)
Payment Flows added: Authorize, Psync, Refund, Rsync , Capture(Single Capture only)

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?

Tested through Postman:

  • Create MCA (Bamboraapac):
{
    "connector_type": "payment_processor",
    "connector_name": "bamboraapac",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "api_key",
        "key1": "key1",
        "api_secret": "api_secret"
    },
    "test_mode": false,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "debit",
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "city": "NY",
        "unit": "245",
        "acquirer_bin": "438309",
        "acquirer_merchant_id": "00002000000"
    },
    "connector_webhook_details": {
        "merchant_secret": "ED0A01A4C130C256597F59F08F7D253B"
    },
    "business_country": "US",
    "business_label": "default"
}
  • Create a payment:
{
    "amount": 10000,
    "currency": "USD",
    "confirm": true ,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "StripeCustomer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "setup_future_usage": "on_session",
    "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": "127.0.0.1"
    },
    "shipping": {
        "address": {
            // "line1": "1467",
            // "line2": "Harrison Street",
            // "line3": "Harrison Street",
            // "city": "San Fransico",
            // "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "John",
            "last_name": "Doe"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4005550000000001",
            "card_exp_month": "02",
            "card_exp_year": "26",
            "card_holder_name": "Joseph Doe",
            "card_cvc": "999"
        }
    },
    "billing": {
        "address": {
            // "line1": "8th block",
            // "line2": "8th block",
            // "line3": "8th block",
            // "city": "Bengaluru",
            // "state": "Karnataka",
            "zip": "560095",
            "country": "IN",
            "first_name": "Sakil",
            "last_name": "Mostak"
        }
    }
}
  • The response should have status succeeded

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

@Sakilmostak Sakilmostak added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Jul 3, 2024
@Sakilmostak Sakilmostak self-assigned this Jul 3, 2024
@Sakilmostak Sakilmostak requested review from a team as code owners July 3, 2024 16:26
@Sakilmostak Sakilmostak marked this pull request as draft July 3, 2024 16:26
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 3, 2024
@Sakilmostak Sakilmostak marked this pull request as ready for review July 8, 2024 07:34
crates/router/src/connector/bamboraapac.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac.rs Show resolved Hide resolved
crates/router/src/connector/bamboraapac/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac/transformers.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac.rs Outdated Show resolved Hide resolved
crates/router/src/connector/bamboraapac.rs Outdated Show resolved Hide resolved
status: enums::AttemptStatus::Charged,
response: Ok(types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(
connector_transaction_id.to_owned(),
Copy link
Contributor

Choose a reason for hiding this comment

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

You are over-riding the authorize transaction id to capture_transaction_id, and losing the context of first_id completely. Is this intended?

Copy link
Contributor

Choose a reason for hiding this comment

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

We will not be able to recover the payment_status if timeout happens in capture call

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit f7abcee Jul 10, 2024
19 of 21 checks passed
@Gnanasundari24 Gnanasundari24 deleted the bambora_soap_flow branch July 10, 2024 11:14
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-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants