Skip to content

feat(connector): [adyenplatform] extend states for incoming webhook events#9900

Merged
likhinbopanna merged 1 commit intomainfrom
9899-feature-extend-adyens-payout-webhooks
Oct 17, 2025
Merged

feat(connector): [adyenplatform] extend states for incoming webhook events#9900
likhinbopanna merged 1 commit intomainfrom
9899-feature-extend-adyens-payout-webhooks

Conversation

@kashif-m
Copy link
Contributor

@kashif-m kashif-m commented Oct 17, 2025

Type of Change

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

Description

This PR extends the integration for incoming webhook event status for Adyenplatform. accepted was included in the status.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

This allows for mapping the latest status for a payout transaction in Hyperswitch.

How did you test it?

1. Create a payout

Request

curl --location --request POST 'http://localhost:8080/payouts/create' \
    --header 'Content-Type: application/json' \
    --header 'api-key: dev_BfOGpoX0Fo0zKPf4w48GLSs0KsBemDtnzfzqBsGfufcQF8RF4YCGNnhdYeFYsWId' \
    --data-raw '{"amount":1,"currency":"EUR","customer":{"id":"cus_0MqECmkNK2XUUAq1wi6V","name":"New Name"},"connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"03","expiry_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","city":"San Fransico","state":"CA","country":"NL","first_name":"John","last_name":"Doe"},"email":"random@example.com"},"recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'

Response

{"payout_id":"payout_drKleMDjSm8VU1difyxf","merchant_id":"merchant_1760702989","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"NL","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"random@example.com"},"auto_fulfill":true,"customer_id":"cus_0MqECmkNK2XUUAq1wi6V","customer":{"id":"cus_0MqECmkNK2XUUAq1wi6V","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_drKleMDjSm8VU1difyxf_secret_FXr5DOw2nR3PHJfdNmAX","return_url":null,"business_country":null,"business_label":null,"description":"Its my first payout request","entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"merchant_connector_id":"mca_6Phu2KObHX9En9R54yve","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_4EqwpAo1XwV7GYjOrryC","created":"2025-10-17T12:14:23.832Z","connector_transaction_id":"38EBI968OK4N01HL","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_14EVOfJ6eNcbVvuiiduc"}
2. Wait for incoming webhooks

Incoming webhook request (from Adyen)

{"type":"balancePlatform.transfer.updated","environment":"test","data":{"balancePlatform":"ZurichInsurance","id":"38EBI968OK4N01HL","creationDate":"Fri Oct 17 14:14:31 CEST 2025","createdAt":"Fri Oct 17 14:14:24 CEST 2025","status":"booked","reason":"approved","direction":"outgoing","balanceAccount":{"id":"BA32CNH223227G5KQKQDJ48HB","description":"***"},"accountHolder":{"id":"AH32CPC223227J5KQKQDJ32PK","description":"***"},"category":"card","type":"cardTransfer","amount":{"value":1,"currency":"EUR"},"reference":"***","referenceForBeneficiary":"***","updatedAt":"Fri Oct 17 14:14:31 CEST 2025","sequenceNumber":4,"balances":[{"reserved":0,"balance":-1,"currency":"EUR","received":0}],"events":[{"id":"EVJN429B4223223W5NBJXZL4CT2JRB","status":"received","bookingDate":"Fri Oct 17 14:14:28 CEST 2025","type":"accounting","mutations":[{"currency":"EUR","received":-1}]},{"id":"EVJN42CQW223223W5NBJXZL32T6M5N","status":"authorised","bookingDate":"Fri Oct 17 14:14:28 CEST 2025","type":"accounting","mutations":[{"reserved":-1,"currency":"EUR","received":1}]},{"id":"EVJN429B4223223W5NBJXZL4CV329Q","status":"booked","transactionId":"EVJN429B4223223W5NBJXZL4CV329QEUR","bookingDate":"Fri Oct 17 14:14:28 CEST 2025","valueDate":"Fri Oct 17 14:14:24 CEST 2025","type":"accounting","mutations":[{"reserved":1,"balance":-1,"currency":"EUR","received":0}]},{"id":"EVTR423H6223PBTW5NBJXZP2RD5L4P","updateDate":"Fri Oct 17 14:14:31 CEST 2025","type":"tracking","trackingData":{"type":"confirmation","status":"accepted"}}],"tracking":{"type":"confirmation","status":"accepted"},"counterparty":{"card":{"cardIdentification":{"number":"***","expiryMonth":"***","expiryYear":"***"},"cardHolder":{"type":"individual","firstName":"***","lastName":"***","address":{"line1":"***","line2":"***","city":"***","country":"***"},"reference":"***","email":"***"}}}},"timestamp":"2025-10-17T12:14:34.498Z"}
3. Retrieve payout

Request

curl --location --request GET 'http://localhost:8080/payouts/payout_drKleMDjSm8VU1difyxf' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_BfOGpoX0Fo0zKPf4w48GLSs0KsBemDtnzfzqBsGfufcQF8RF4YCGNnhdYeFYsWId'

Response

{"payout_id":"payout_drKleMDjSm8VU1difyxf","merchant_id":"merchant_1760702989","merchant_order_reference_id":null,"amount":1,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":"JP Morgan","card_network":"Visa","card_type":"CREDIT","card_issuing_country":"INDIA","bank_code":"JP_JPM","last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":"John Doe"}},"billing":{"address":{"city":"San Fransico","country":"NL","line1":"1467","line2":"Harrison Street","line3":null,"zip":null,"state":"CA","first_name":"John","last_name":"Doe","origin_zip":null},"phone":null,"email":"random@example.com"},"auto_fulfill":true,"customer_id":"cus_0MqECmkNK2XUUAq1wi6V","customer":{"id":"cus_0MqECmkNK2XUUAq1wi6V","name":"Albert Klaassen","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_payout_drKleMDjSm8VU1difyxf_secret_FXr5DOw2nR3PHJfdNmAX","return_url":null,"business_country":null,"business_label":null,"description":"Its my first payout request","entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"merchant_connector_id":"mca_6Phu2KObHX9En9R54yve","status":"success","error_message":null,"error_code":null,"profile_id":"pro_4EqwpAo1XwV7GYjOrryC","created":"2025-10-17T12:14:23.832Z","connector_transaction_id":"38EBI968OK4N01HL","priority":null,"payout_link":null,"email":null,"name":"Albert Klaassen","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_14EVOfJ6eNcbVvuiiduc"}

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 17, 2025
@kashif-m kashif-m requested a review from a team as a code owner October 17, 2025 05:01
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 17, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs  31% smaller
  crates/hyperswitch_connectors/src/connectors/adyenplatform.rs  0% smaller

@kashif-m kashif-m linked an issue Oct 17, 2025 that may be closed by this pull request
@likhinbopanna likhinbopanna added this pull request to the merge queue Oct 17, 2025
Merged via the queue into main with commit db7228a Oct 17, 2025
29 of 32 checks passed
@likhinbopanna likhinbopanna deleted the 9899-feature-extend-adyens-payout-webhooks branch October 17, 2025 14:21
drdholu pushed a commit to drdholu/hyperswitch that referenced this pull request Oct 30, 2025
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.

[FEATURE] extend Adyen's payout webhooks

4 participants