Skip to content

refactor(dynamic_fields): dynamic fields for Adyen and Stripe, renaming klarnaCheckout, WASM for KlarnaCheckout#7015

Merged
likhinbopanna merged 3 commits intomainfrom
dynamic-fields-refactor
Feb 6, 2025
Merged

refactor(dynamic_fields): dynamic fields for Adyen and Stripe, renaming klarnaCheckout, WASM for KlarnaCheckout#7015
likhinbopanna merged 3 commits intomainfrom
dynamic-fields-refactor

Conversation

@swetasharma03
Copy link
Contributor

@swetasharma03 swetasharma03 commented Jan 9, 2025

Type of Change

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

Description

  1. Dynamic fields path for Adyen and Stripe is changed which is a frontend requirement
  2. WASM for klarnaCheckout added in Klarna which is a dashboard requirement.
  3. Removed KlarnaCheckout enum and using the already present KlarnaRedirect enum value as it was creating some frontend conflicts with Adyen's KlarnaRedirect flow.

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. Dynamic fields path for Adyen and Stripe is changed which is a frontend requirement to show the input boxes, so no testing required.

  2. WASM for klarnaCheckout added in Klarna which is a dashboard requirement to list out the Payment Methods for Klarna, so no testing required.

  3. Have removed KlarnaCheckout enum and using the already present KlarnaRedirect enum value for the flow. This doesn't effect the payment flow and klarnaCheckout is working as previously.

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_nsmdfKGJM74PYSViFQ04zsoTMLFkF2VkcvuRdmerez2zBfHSjCrZIxpEln9vYBgl' \
--data-raw '{
    "amount": 50000,
    "order_tax_amount":0,
    "confirm": false,
    "currency": "EUR",
    "capture_method": "automatic",
    "customer_id": "klarna",
    "payment_experience":"redirect_to_url",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "no_three_ds",
    "payment_method": "pay_later",
    "payment_method_type": "klarna",
    "payment_method_data": { 
        "pay_later": {
            "klarna_checkout":{}
        }
    },
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "return_url": "https://google.com"
}'

Response

{
    "payment_id": "pay_b9SVvCHWeHFV7jiTCr1v",
    "merchant_id": "merchant_1734083062",
    "status": "requires_confirmation",
    "amount": 50000,
    "net_amount": 50000,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_b9SVvCHWeHFV7jiTCr1v_secret_uTuJ4C4UZtzKWCkJqKyj",
    "created": "2024-12-16T12:15:12.009Z",
    "currency": "EUR",
    "customer_id": "klarna",
    "customer": {
        "id": "klarna",
        "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": "pay_later",
    "payment_method_data": {
        "pay_later": {
            "klarna_sdk": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "klarna",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "klarna",
        "created_at": 1734351311,
        "expires": 1734354911,
        "secret": "epk_5aaf5ecba75d4de68712573428fe89f2"
    },
    "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_PdHB9mW2uWUx2di0W9u3",
    "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-12-16T12:30:12.009Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-16T12:15:12.033Z",
    "split_payments": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": 0,
    "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

@swetasharma03 swetasharma03 requested a review from a team as a code owner January 9, 2025 10:40
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jan 9, 2025

@swetasharma03 swetasharma03 linked an issue Jan 9, 2025 that may be closed by this pull request
@swetasharma03 swetasharma03 force-pushed the dynamic-fields-refactor branch from 58c0f9a to 70909c0 Compare January 15, 2025 03:50
@swetasharma03 swetasharma03 requested a review from a team as a code owner January 15, 2025 03:50
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jan 15, 2025
@swetasharma03 swetasharma03 self-assigned this Jan 15, 2025
@swetasharma03 swetasharma03 changed the title refactor(dynamic fields): Refactor dynamic fields for Adyen and Stripe refactor(dynamic fields): dynamic fields for Adyen and Stripe Jan 15, 2025
@swetasharma03 swetasharma03 force-pushed the dynamic-fields-refactor branch from fa41131 to 04e6bb3 Compare January 16, 2025 12:00
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Jan 16, 2025
@swetasharma03 swetasharma03 changed the title refactor(dynamic fields): dynamic fields for Adyen and Stripe refactor(dynamic_fields): dynamic fields for Adyen and Stripe Jan 16, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jan 16, 2025
@swetasharma03 swetasharma03 changed the title refactor(dynamic_fields): dynamic fields for Adyen and Stripe refactor(dynamic_fields): dynamic fields for Adyen and Stripe and renaming klarnaCheckout to klarnaRedirect Jan 23, 2025
@swetasharma03 swetasharma03 changed the title refactor(dynamic_fields): dynamic fields for Adyen and Stripe and renaming klarnaCheckout to klarnaRedirect refactor(dynamic_fields): dynamic fields for Adyen and Stripe, renaming klarnaCheckout, WASM for KlarnaCheckout Jan 28, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit a6367d9 Feb 6, 2025
34 of 37 checks passed
@likhinbopanna likhinbopanna deleted the dynamic-fields-refactor branch February 6, 2025 14:33
pixincreate added a commit that referenced this pull request Feb 7, 2025
…unt-configurable

* 'main' of github.com:juspay/hyperswitch: (37 commits)
  refactor(router): add display_name field to connector feature api  (#7121)
  ci(cypress): Add Tests for Customer Deletion and Psync flows (#7158)
  feat(connector): [DataTrans] ADD 3DS Flow (#6026)
  chore(version): 2025.02.07.0
  chore(connectors): [fiuu] update pm_filters for apple pay and google pay (#7182)
  feat(router): add `organization_id` in authentication table and add it in authentication events (#7168)
  fix(dashboard_metadata): mask `poc_email` and `data_value` for DashboardMetadata (#7130)
  feat(core): Add support for v2 payments get intent using merchant reference id (#7123)
  refactor(customer): return redacted customer instead of error (#7122)
  fix(connector): handle unexpected error response from bluesnap connector (#7120)
  feat(routing): Contract based routing integration  (#6761)
  refactor(dynamic_fields): dynamic fields for Adyen and Stripe, renaming klarnaCheckout, WASM for KlarnaCheckout (#7015)
  feat(connector): [COINGATE] Add Template PR  (#7052)
  chore(roles): remove redundant variant from PermissionGroup (#6985)
  refactor(router): store `network_transaction_id` for `off_session` payments irrespective of the `is_connector_agnostic_mit_enabled` config (#7083)
  chore(connector): [Fiuu] log keys in the PSync response (#7189)
  ci(cypress): fix nmi and paypal (#7173)
  chore(version): 2025.02.06.0
  chore(postman): update Postman collection files
  feat(connector): [Deutschebank] Add Access Token Error struct (#7127)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] modify dynamic fields path

5 participants