{"id":21621237,"url":"https://github.com/tuutti/commerce_paytrail","last_synced_at":"2025-10-06T07:31:15.480Z","repository":{"id":11463877,"uuid":"69756410","full_name":"tuutti/commerce_paytrail","owner":"tuutti","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-14T10:10:05.000Z","size":446,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"4.x","last_synced_at":"2024-12-14T10:17:09.647Z","etag":null,"topics":["drupal","drupal-commerce","drupal-module","payment"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuutti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-01T18:38:00.000Z","updated_at":"2024-07-04T10:06:56.000Z","dependencies_parsed_at":"2024-11-20T07:29:53.689Z","dependency_job_id":"71d2867e-ac73-4b4b-bcd2-e65731116d32","html_url":"https://github.com/tuutti/commerce_paytrail","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuutti%2Fcommerce_paytrail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuutti%2Fcommerce_paytrail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuutti%2Fcommerce_paytrail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuutti%2Fcommerce_paytrail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuutti","download_url":"https://codeload.github.com/tuutti/commerce_paytrail/tar.gz/refs/heads/4.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235510115,"owners_count":19001653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","drupal-commerce","drupal-module","payment"],"created_at":"2024-11-24T23:14:18.501Z","updated_at":"2025-10-06T07:31:14.973Z","avatar_url":"https://github.com/tuutti.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commerce paytrail\n\n![CI](https://github.com/tuutti/commerce_paytrail/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/tuutti/commerce_paytrail/branch/4.x/graph/badge.svg?token=32zwdww9JR)](https://codecov.io/gh/tuutti/commerce_paytrail)\n\nThis module integrates [Paytrail](https://www.paytrail.com/en) payment method with Drupal Commerce.\n\n * For a full description of the module, visit the project page:\n   https://www.drupal.org/project/commerce_paytrail\n\n * To submit bug reports and feature suggestions, or to track changes:\n   https://www.drupal.org/project/issues/commerce_paytrail\n\n## Installation\n\nInstall the Commerce paytrail module as you would normally install a contributed\nDrupal module. Visit https://www.drupal.org/node/1897420 for further\ninformation.\n\n## Configuration\n\n1. Configure the Commerce Paytrail gateway from the Administration \u003e Commerce \u003e\n   Configuration \u003e Payment Gateways (`/admin/commerce/config/payment-gateways`),\n   by editing an existing or adding a new payment gateway.\n2. Select `Paytrail` or `Paytrail (Credit card)` for the payment gateway plugin.\n   * `Mode`: enables the Paytrail payment gateway in test or live mode.\n   * `Account`: provide your Paytrail account.\n   * `Secret`: provide your Paytrail secret.\n   * `Order discount strategy`: Choose the order discount strategy.\n3. Click Save to save your configuration.\n\n## Documentation\n\n### Alter Paytrail API requests/responses\n\nCreate an event subscriber that responds to `\\Drupal\\commerce_paytrail\\Event\\ModelEvent::class` events:\n\n```php\n\nclass YourEventSubscriber implements \\Symfony\\Component\\EventDispatcher\\EventSubscriberInterface {\n\n  /**\n   * Event callback.\n   *\n   * @param \\Drupal\\commerce_paytrail\\Event\\ModelEvent $event\n   *   The event.\n   */\n  public function processEvent(ModelEvent $event): void {\n    // See below for all available events.\n    if ($event-\u003eevent === \\Drupal\\commerce_paytrail\\RequestBuilder\\PaymentRequestBuilderInterface::PAYMENT_CREATE_EVENT) {\n      // Do something based on event name.\n    }\n  }\n\n  /**\n   * {@inheritdoc}\n   */\n  public static function getSubscribedEvents() : array {\n    return [\n      ModelEvent::class =\u003e ['processEvent'],\n    ];\n  }\n}\n```\n\nSee https://www.drupal.org/docs/develop/creating-modules/subscribe-to-and-dispatch-events for more information about events.\n\n### Available events\n- Payment requests: [src/RequestBuilder/PaymentRequestBuilderInterface.php](src/RequestBuilder/PaymentRequestBuilderInterface.php)\n- Refund requests: [src/RequestBuilder/RefundRequestBuilderInterface.php](src/RequestBuilder/RefundRequestBuilderInterface.php)\n- Token payment requests: [src/RequestBuilder/TokenRequestBuilderInterface.php](src/RequestBuilder/TokenRequestBuilderInterface.php)\n\n### Prevent saved payment method from being deleted\n\n```php\n/**\n * Implements hook_entity_predelete().\n */\nfunction hook_entity_predelete(\\Drupal\\Core\\Entity\\EntityInterface $entity) : void {\n  if (condition) {\n    throw new \\Drupal\\commerce_payment\\Exception\\PaymentGatewayException('Card cannot be deleted').\n  }\n}\n```\n\n## Maintainers\n\n* tuutti (tuutti) - https://www.drupal.org/u/tuutti\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuutti%2Fcommerce_paytrail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuutti%2Fcommerce_paytrail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuutti%2Fcommerce_paytrail/lists"}