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

fix(connector): add local bank redirect type in compatibility layer, default the country to AT for Local Bank Redirect and add creds_identifier in access token #5038

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Jun 19, 2024

Type of Change

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

Description

This PR

  1. Add local bank redirect type in compatibility layer
  2. Default the country to AT for Local Bank Redirect
  3. Add creds_identifier in access token

How did you test it?

Note: Test through stripe compatibility layer

  1. Create a payment with local bank redirect, with currency EUR and country NL
curl --location 'http:https://localhost:8080/vs/v1/payment_intents' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: RULER' \
--header 'api-key: ""' \
--data-urlencode 'amount=900' \
--data-urlencode 'currency=EUR' \
--data-urlencode 'confirm=true' \
--data-urlencode 'payment_method_data%5Btype%5D=bank_redirect' \
--data-urlencode 'connector%5B%5D=iatapay' \
--data-urlencode 'capture_method=automatic' \
--data-urlencode 'customer=asdjn' \
--data-urlencode 'metadata%5BorderId%5D=1677581659' \
--data-urlencode 'payment_method_options%5Bcard%5D%5Brequest_three_d_secure%5D=any' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bname%5D=\aaaa' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Bemail%[email protected]' \
--data-urlencode 'description=Card Payment' \
--data-urlencode 'off_session=true' \
--data-urlencode 'return_url=https://juspay.in' \
--data-urlencode 'id=17163730759' \
--data-urlencode 'payment_method_data%5Bbilling_details%5D%5Baddress%5D%5Bcountry%5D=VN' \
--data-urlencode 'metadata%5Border_category%5D=pay' \
--data-urlencode 'payment_method_types=local_bank_redirect'

Response

    "id": "17163730759",
    "object": "payment_intent",
    "amount": 900,
    "amount_received": null,
    "amount_capturable": 900,
    "currency": "eur",
    "status": "requires_action",
    "client_secret": "",
    "created": 1718790951,
    "customer": "asdjn",
    "refunds": null,
    "mandate": null,
    "metadata": {
        "orderId": "1677581659",
        "order_category": "pay"
    },
    "charges": {
        "object": "list",
        "data": [],
        "has_more": false,
        "total_count": 0,
        "url": "http:https://placeholder"
    },
    "connector": "iatapay",
    "description": "Card Payment",
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "authentication_type": "three_ds",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": {
            "return_url": "https://juspay.in/",
            "url": "http:https://localhost:8080/payments/redirect/17163730759/merchant_1718790689/17163730759_1"
        }
    },
    "cancellation_reason": null,
    "payment_method": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {}
    },
    "shipping": null,
    "billing": {
        "address": {
            "city": null,
            "country": "VN",
            "line1": null,
            "line2": null,
            "line3": null,
            "zip": null,
            "state": null,
            "first_name": null,
            "last_name": null
        },
        "phone": {
            "number": null,
            "country_code": "VN"
        },
        "email": "[email protected]"
    },
    "capture_on": null,
    "payment_token": null,
    "email": null,
    "phone": null,
    "statement_descriptor_suffix": null,
    "statement_descriptor_name": null,
    "capture_method": "automatic",
    "name": null,
    "last_payment_error": null,
    "connector_transaction_id": "PYA2JZA9NBJUK"
}
  1. Complete a txn with one specific cred and try another txn with different cred within 2-3 minutes

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

@AkshayaFoiger AkshayaFoiger requested review from a team as code owners June 19, 2024 09:07
@AkshayaFoiger AkshayaFoiger self-assigned this Jun 19, 2024
@AkshayaFoiger AkshayaFoiger added A-connector-compatibility Area: Connector compatibility A-connector-integration Area: Connector integration labels Jun 19, 2024
@AkshayaFoiger AkshayaFoiger added the C-bug Category: Bug label Jun 19, 2024
@AkshayaFoiger AkshayaFoiger requested review from SamraatBansal and removed request for SamraatBansal June 19, 2024 10:18
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jun 19, 2024
Merged via the queue into main with commit 655b81d Jun 19, 2024
26 of 27 checks passed
@Gnanasundari24 Gnanasundari24 deleted the iatapay-compatibility branch June 19, 2024 11:07
pixincreate added a commit that referenced this pull request Jun 20, 2024
…ress-skip

* 'main' of github.com:juspay/hyperswitch: (27 commits)
  feat(cypress): add 2 more payout connectors and bank transfer support for payout (#4993)
  chore(version): 2024.06.20.0
  Refactor(core): reverts the payment method list filtering using constraint graph (#5044)
  feat(router): add payment method type duplication check for `google_pay` (#5023)
  refactor(storage): remove `id` from payment intent, attempt and remove datamodel ext from payment intent (#4923)
  fix(events): Correct parsing of API events with user event_type for Clickhouse (#5022)
  fix(connector):  add local bank redirect type in compatibility layer, default the country to AT for Local Bank Redirect and add creds_identifier in access token  (#5038)
  refactor(connector): add amount conversion framework for noon (#4843)
  fix(logging): fix stack overflow on recording restricted keys (#4423)
  feat(core): Add logger for sessions call failure (#5036)
  chore(version): 2024.06.19.0
  fix(opensearch): handle index not present errors in search api (#4965)
  feat(multitenancy): add tenant_id as a field for data pipeline and support individual database for clickhouse  (#4867)
  refactor: add basic counter metrics for IMC (#5006)
  fix(payment_methods): populate card fields while saving card again during metadata change condition (#5019)
  feat(router): Override the `setup_future_usage` to `on_session` based on the merchant config (#5016)
  chore(docker-compose): pass correct configuration values for running SDK demo app  (#5012)
  refactor: Move trait ConnectorIntegration to crate hyperswitch_interfaces (#4946)
  chore(version): 2024.06.17.0
  chore(process_tracker): use `const` instead of `String` for `business_status` (#4849)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility A-connector-integration Area: Connector integration C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants