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(deployment-config): remove invalid currencies from worldpay filters #6400

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

kashif-m
Copy link
Contributor

@kashif-m kashif-m commented Oct 22, 2024

Type of Change

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

Description

Includes below changes -

  • Fixes Worldpay's payment method filters
  • Makes payment_method_type non-mandatatory for Cards

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?

Locally through payment links.

Things to test

  1. Payments through SDK
1. Payments through SDK

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9' \
    --data-raw '{"authentication_type":"three_ds","customer_id":"cus_5A3VgopTFe8q83EEHgTq","profile_id":"pro_OodaMoJ1Y9nlnegU4soR","amount":100,"currency":"USD","payment_link":true,"capture_method":"automatic","setup_future_usage":"on_session","connector":["worldpay"],"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"}},"email":"[email protected]","session_expiry":10000,"return_url":"https://example.com","payment_link_config":{"theme":"#14356f","logo":"https://hyperswitch.io/favicon.ico","seller_name":"HyperSwitch Inc."}}'

Response

{"payment_id":"pay_kjjXmgjTxSxUI598uRJ6","merchant_id":"merchant_1728979001","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_kjjXmgjTxSxUI598uRJ6_secret_LeagJMq1vWdgjvPC1dHG","created":"2024-10-23T12:54:25.970Z","currency":"USD","customer_id":"cus_5A3VgopTFe8q83EEHgTq","customer":{"id":"cus_5A3VgopTFe8q83EEHgTq","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":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://example.com/","authentication_type":"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":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_5A3VgopTFe8q83EEHgTq","created_at":1729688065,"expires":1729691665,"secret":"epk_dacf70917d6c42149373e4864df4f59b"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1728979001/pay_kjjXmgjTxSxUI598uRJ6?locale=en","secure_link":null,"payment_link_id":"plink_pk7a6Jn1WEtnN0CF47ue"},"profile_id":"pro_OodaMoJ1Y9nlnegU4soR","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-10-23T15:41:05.969Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2024-10-23T12:54:25.979Z","charges":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}

Open payment link and complete the txn

Screen.Recording.2024-10-23.at.6.26.43.PM.mov

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

@kashif-m kashif-m self-assigned this Oct 22, 2024
@kashif-m kashif-m requested a review from a team as a code owner October 22, 2024 13:25
Copy link

semanticdiff-com bot commented Oct 22, 2024

Review changes with SemanticDiff.

Analyzed 1 of 2 files.

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

Filename Status
✔️ crates/router/src/connector/worldpay/transformers.rs 39.69% smaller
config/deployments/sandbox.toml Unsupported file format

jarnura
jarnura previously approved these changes Oct 22, 2024
likhinbopanna
likhinbopanna previously approved these changes Oct 22, 2024
jarnura
jarnura previously approved these changes Oct 23, 2024
@kashif-m kashif-m requested review from a team as code owners October 23, 2024 12:42
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Oct 23, 2024
@kashif-m kashif-m force-pushed the fix-deployment-config branch from c6dcac3 to 0074512 Compare October 23, 2024 12:45
@kashif-m kashif-m removed request for a team October 23, 2024 12:46
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Oct 23, 2024
@kashif-m kashif-m force-pushed the fix-deployment-config branch from 0074512 to db58343 Compare October 23, 2024 12:49
@kashif-m kashif-m linked an issue Oct 23, 2024 that may be closed by this pull request
2 tasks
@likhinbopanna likhinbopanna added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit aee11c5 Oct 23, 2024
26 of 29 checks passed
@likhinbopanna likhinbopanna deleted the fix-deployment-config branch October 23, 2024 14:23
qstommyshu pushed a commit to qstommyshu/hyperswitch that referenced this pull request Oct 23, 2024
kashif-m added a commit that referenced this pull request Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] Worldpay payments integration
4 participants