Skip to content

feat(connector): [Trustly] Implementation - #2068

Open
THE-CORE-BUG wants to merge 3 commits into
mainfrom
trustly-integration
Open

feat(connector): [Trustly] Implementation#2068
THE-CORE-BUG wants to merge 3 commits into
mainfrom
trustly-integration

Conversation

@THE-CORE-BUG

@THE-CORE-BUG THE-CORE-BUG commented Aug 6, 2026

Copy link
Copy Markdown

Type of Change

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

Description

Integrating Payout Connector - Trustly

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?

MCA:

curl --location 'localhost:8080/account/merchant_1786000961/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_5bClfNoqnr9lXeR045ivkJKQTKoZ2uDpd3E4uG06DHSPGC0hA9YPIvNXkBuXa5vR' \
--data '{
    "connector_type": "payout_processor",
    "connector_name": "trustly",
    "connector_label": "trustly",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "gm_gaming_pnp",
        "key1": "77da6b37-afc3-4f17-bf70-96073c4cbd5f",
        "api_secret": ""
    },
    "test_mode": true,
    "payment_methods_enabled": [
        {
            "payment_method": "bank_transfer",
            "payment_method_types": [
                {
                    "payment_method_type": "trustly",
                    "payment_experience": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": ",
        "additional_secret": null
    }
}
'

Request:

{{
    "connector_type": "payout_processor",
    "connector_name": "trustly",
    "connector_label": "trustly",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "gm_gaming_pnp",
        "key1": "77da6b37-afc3-4f17-bf70-96073c4cbd5f",
        "api_secret": ""
    },
    "test_mode": true,
    "payment_methods_enabled": [
        {
            "payment_method": "bank_transfer",
            "payment_method_types": [
                {
                    "payment_method_type": "trustly",
                    "payment_experience": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": "",
        "additional_secret": null
    }
}


Response:

{
    "connector_type": "payout_processor",
    "connector_name": "trustly",
    "connector_label": "trustly",
    "merchant_connector_id": "mca_lG9azngsSd3UhkEgFPvD",
    "profile_id": "pro_iq08qndJTapigwUgyBHo",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "gm*********np",
        "key1": "77********************************5f",
        "api_secret": "LS************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************0="
    },
    "payment_methods_enabled": [
        {
            "payment_method": "bank_transfer",
            "payment_method_types": [
                {
                    "payment_method_type": "trustly",
                    "payment_experience": null,
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF5N2gveVg4REVBMm01ODhTcld5ZQpBQzhyVE1iRXJ3SHQyaG9UaVA5ZnRlL2lPbzBGWElaU21Oc051NDIyTCtpSnl2WlF1MTllYmVMN1hnQjBVWHF0CnpBNkt0WEJNWElLd3VNQ1poYmRlUjhzYjdPS2JYMm5sV00rZTJIbXJyOUNUZmtaa0ZCZVNDK2lOOWZBVTZQb1IKWDBpNVBXbTB1Wm5hb1dYY1puazVDeFFDZ25mWWdzeDd4c2Q4QXUrbXJxRThTSGVUOHppL0ludzBYcDZiYTI1RwpZc1poSGZJUEQycmNaUU9wV2JtSFJTNEprNGFHelNPQkhiQVpoS2xQOTdQeG9WZlVjUEkzaUNBMSszak1zMWwyClBZc0hVYlA2ME5NVndrR1BqRk9UdjRtMWExd0tzdWUwbWhzcERkdnN3WlVlS0UrUE9HT3Vld3FUUUorZ0loWHcKbVFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t",
        "additional_secret": null
    },
    "metadata": null,
    "test_mode": true,
    "disabled": false,
    "frm_configs": null,
    "business_country": null,
    "business_label": null,
    "business_sub_label": null,
    "applepay_verified_domains": null,
    "pm_auth_config": null,
    "status": "active",
    "additional_merchant_data": null,
    "connector_wallets_details": null,
    "webhook_setup_capabilities": null
}

Payouts- Create:

curl --location 'localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_5bClfNoqnr9lXeR045ivkJKQTKoZ2uDpd3E4uG06DHSPGC0hA9YPIvNXkBuXa5vR' \
--data-raw '{
    "amount": 1000,
    "currency": "EUR",
    "customer_id": "12358",
    "name": "Steve Smith",
    "email": "payout1@example.com",
    "description": "Trustly test",
    "payout_type": "bank",
    "connector": ["trustly"],
    "payout_method_data": {
      "bank": { "iban": null, "country_code": "SE", "account_number": "69706212", "bank_number": "6112" }
    },
    "billing": {
      "address": { "line1": "Main street 1", "line2": "Main street 2", "city": "Stockholm", "state": "SE", "zip": "SE-11253", "country": "SE", "first_name": 
  "Steve", "last_name": "Smith" },
      "phone": { "number": "709876543", "country_code": "+46" },
      "email": "abc@gmail.com"
    },
    "customer": { "id": "12358", "name": "Steve Smith", "email": "payout1@example.com" },
    "entity_type": "Individual",
    "confirm": true,
    "auto_fulfill": false
  }'
  

Payouts-Fulfill:

curl --location 'localhost:8080/payouts/payout_pKInoXr6tJ7ALzubkpIg/fulfill' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_5bClfNoqnr9lXeR045ivkJKQTKoZ2uDpd3E4uG06DHSPGC0hA9YPIvNXkBuXa5vR' \
--data '{ "payout_id": "payout_pKInoXr6tJ7ALzubkpIg" }'

Payouts-Sync:

curl --location 'localhost:8080/payouts/<PAYOUT_ID>?force_sync=true' \
  --header 'api-key: dev_iJ1nShzoTeHnJETWMgrWbgUmRE9PCc15x4RRO90w3hFhvsD2FcMNypRehtPZoCi0'
  

Webhooks:


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible

@THE-CORE-BUG
THE-CORE-BUG requested review from a team as code owners August 6, 2026 07:34
Auto-applied by CI:
- cargo +nightly fmt --all
- make -C sdk generate (if applicable)
- make docs (if applicable)

This commit was automatically generated by GitHub Actions.
@XyneSpaces

Copy link
Copy Markdown

[blocking] Please do not derive Trustly ClearingHouse with Country::from_alpha2(...).to_string().to_uppercase(); map the alpha-2 code to the connector’s expected English country name format instead.

For a payout with bank_country_code = GB, strum::Display emits the enum identifier (UnitedKingdomOfGreatBritainAndNorthernIreland), so this sends UNITEDKINGDOMOFGREATBRITAINANDNORTHERNIRELAND rather than a spaced country name and Trustly can reject RegisterAccount/Deposit requests.

})
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use macros not impls

@THE-CORE-BUG THE-CORE-BUG changed the title trustly-integration-changes feat(connector): [Trustly] Implementation Aug 7, 2026
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.

3 participants