{"id":35740833,"url":"https://github.com/ratepay/shopware6-module","last_synced_at":"2026-04-15T10:01:34.303Z","repository":{"id":43283825,"uuid":"258978725","full_name":"ratepay/shopware6-module","owner":"ratepay","description":"Ratepay Payment Module for Shopware 6. Supports 6.3.0.2 up to 6.7.x.x","archived":false,"fork":false,"pushed_at":"2026-04-10T12:25:23.000Z","size":3204,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"8.0","last_synced_at":"2026-04-10T14:23:00.933Z","etag":null,"topics":["direct-debit","instalments","invoice","payment","prepayment"],"latest_commit_sha":null,"homepage":"https://docs.ratepay.com/docs/developer/shop_modules/shopware/shopware_6/ratepay_payment_plugin_for_shopware_6/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ratepay.png","metadata":{"files":{"readme":"README-requestServices.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-26T08:28:04.000Z","updated_at":"2025-11-04T17:11:10.000Z","dependencies_parsed_at":"2023-02-18T06:16:03.606Z","dependency_job_id":"e539da13-2f06-43f4-b36c-38088f4525f4","html_url":"https://github.com/ratepay/shopware6-module","commit_stats":{"total_commits":423,"total_committers":7,"mean_commits":60.42857142857143,"dds":0.6784869976359338,"last_synced_commit":"9f666689542b44eef673019c3daf921628da9a85"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/ratepay/shopware6-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratepay%2Fshopware6-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratepay%2Fshopware6-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratepay%2Fshopware6-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratepay%2Fshopware6-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ratepay","download_url":"https://codeload.github.com/ratepay/shopware6-module/tar.gz/refs/heads/8.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ratepay%2Fshopware6-module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31835820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["direct-debit","instalments","invoice","payment","prepayment"],"created_at":"2026-01-06T15:02:00.125Z","updated_at":"2026-04-15T10:01:34.277Z","avatar_url":"https://github.com/ratepay.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Request services\n\n### General\n\nAll requests services are child classes\nof `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\AbstractRequest`.\n\nYou need an instance of the abstract class `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\AbstractRequestData` (in the\nexample below we will use the class `PaymentInitData`) as parameter for the `execute`-method of the RequestService\nclass.\n\n#### Notes:\n\n- The data for the request will be automatically built by the different data-factories.\n  Please have a look into each RequestService to find out, which factories are used. Please also have a look into the\n  different factories.\n- You not need to log any request to the api-log table. Any request will be logged automatically.\n- Important: All RequestServices dispatches different events. The Ratepay-Extension already have a few subscribers on\n  these events. But also third party subscribers could be listen on these events. So please make sure, if you use the\n  RequestServices, that all third party extensions works properly.\n\n**Please note:** Please do not send manually changes of an order to the gateway. All changes, which are made not via the\nextension, will be not visible for the extension.\n\n### ProfileRequestService\n\nUse this request to get the profile configuration from the Ratepay gateway.\n\n|                |                                                                                     |\n|----------------|-------------------------------------------------------------------------------------|\n| Service Class  | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\ProfileRequestService` |\n| Data Class     | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\ProfileRequestData`                |\n| Response Class | `\\RatePAY\\Model\\Response\\ProfileRequest`                                            |\n\n#### Example\n\n```php\n/** @var \\Shopware\\Core\\Framework\\Context $context **/\n/** @var \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\ProfileRequestService $requestService **/\n/** @var \\Ratepay\\RpayPayments\\Components\\ProfileConfig\\Model\\ProfileConfigEntity $profileConfig **/\n\n$requestData = new \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\ProfileRequestData($context, $profileConfig);\n$requestBuilder = $requestService-\u003edoRequest($requestData);\n\n/** @var \\RatePAY\\Model\\Response\\ProfileRequest $response */\n$response = $requestBuilder-\u003egetResponse();\n\nif($response-\u003eisSuccessful()) {\n    // do something if the request is successful\n    /** @var array $result */\n    $result = $response-\u003egetResult(); // this will contain all information of the profile\n}\n\n```\n\n### PaymentRequestService\n\nUse this request to create a payment for an order.\n\nThe subscribers of this request will automatically create the order extension for the entity, so that all follow-up\noperations can be done.\n\nSo you don't have to create any data manually.\n\nYou also don't have to load the profile config. It will be loaded automatically.\n\n|                |                                                                                     |\n|----------------|-------------------------------------------------------------------------------------|\n| Service Class  | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentRequestService` |\n| Data Class     | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\PaymentRequestData`                |\n| Response Class | `\\RatePAY\\Model\\Response\\PaymentRequest`                                            |\n\n#### Example\n\n```php\nuse Shopware\\Core\\Framework\\Validation\\DataBag\\RequestDataBag;\n\n/** @var \\Shopware\\Core\\System\\SalesChannel\\SalesChannelContext $salesChannelContext **/\n/** @var \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentRequestService $requestService **/\n\n// you need a already persisted order entity\n/** @var \\Shopware\\Core\\Checkout\\Order\\OrderEntity $orderEntity **/\n// you need a already persisted transaction entity, which is associated to the order.\n/** @var \\Shopware\\Core\\Checkout\\Order\\Aggregate\\OrderTransaction\\OrderTransactionEntity $transactionEntity **/\n\n// the parameters differ between b2c and b2b\n$requestDataBag = new RequestDataBag([\n    // required for b2c\n    'birthday' =\u003e new RequestDataBag([\n        'year' =\u003e '2000',\n        'month' =\u003e '1',\n        'day' =\u003e '30',\n    ]),\n    // required for b2b\n    'vatId' =\u003e 'DE123456789',\n\n    // require if payment method is DIRECT-DEBIT\n    'bankData' =\u003e new RequestDataBag([\n        'accountHolder' =\u003e 'Max Mustermann',\n        'iban' =\u003e 'DE12 3456 7891 2345 6789 12',\n    ]),\n]);\n\n$ratepayTransactionId = '12-3456789123456789';\n\n$requestData = new \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\PaymentRequestData(\n    $salesChannelContext,\n    $orderEntity,\n    $transactionEntity,\n    $requestDataBag,\n    $ratepayTransactionId\n);\n\n$requestBuilder = $requestService-\u003edoRequest($requestData);\n\n/** @var \\RatePAY\\Model\\Response\\PaymentRequest $response */\n$response = $requestBuilder-\u003egetResponse();\n\nif($response-\u003eisSuccessful()) {\n    // do something if the request is successful\n    $descriptor = $response-\u003egetDescriptor();\n}\n```\n\n### Order item operations (deliver, cancel, return)\n\nUse these request to mark one or more items (line-items, shipping costs, discounts) of the order as \"delivered\",\n\"canceled\" or \"returned\"\n\nAll request does have the same syntax, and functionalities. So we define it only once in this document.\n\nThe examples are for the delivery of items.\n\n#### Deliver\n\n|                |                                                                                     |\n|----------------|-------------------------------------------------------------------------------------|\n| Service Class  | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentDeliverService` |\n| Data Class     | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData`                |\n| Response Class | `\\RatePAY\\Model\\Response\\ConfirmationDeliver`                                       |\n\n#### Cancel\n\n|                |                                                                                    |\n|----------------|------------------------------------------------------------------------------------|\n| Service Class  | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentCancelService` |\n| Data Class     | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData`               |\n| Response Class | `\\RatePAY\\Model\\Response\\PaymentChange`                                            |\n\n#### Return\n\n|                |                                                                                    |\n|----------------|------------------------------------------------------------------------------------|\n| Service Class  | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentReturnService` |\n| Data Class     | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData`               |\n| Response Class | `\\RatePAY\\Model\\Response\\PaymentChange`                                            |\n\n#### Example #1\n\nUse this example to deliver all (possible) items of the order.\n\n```php\n/** @var \\Shopware\\Core\\Framework\\Context $context **/\n/** @var \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentDeliverService $requestService **/\n\n// the order to process\n/** @var \\Shopware\\Core\\Checkout\\Order\\OrderEntity $orderEntity **/\n\n$requestData = new \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData(\n    $context,\n    $orderEntity,\n    \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData::OPERATION_DELIVER\n);\n\n$requestBuilder = $requestService-\u003edoRequest($requestData);\n\n/** @var \\RatePAY\\Model\\Response\\ConfirmationDeliver $response */\n$response = $requestBuilder-\u003egetResponse();\n\nif($response-\u003eisSuccessful()) {\n    // do something if the request is successful\n}\n```\n\n#### Example 2\n\nin this example you see how to partly deliver/cancel/return the order.\n\nYou always need to have the UUIDs of each line item.\n\n```php\n/** @var \\Shopware\\Core\\Framework\\Context $context **/\n/** @var \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentDeliverService $requestService **/\n\n// the order to process\n/** @var \\Shopware\\Core\\Checkout\\Order\\OrderEntity $orderEntity **/\n\n$requestData = new \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData(\n    $context,\n    $orderEntity,\n    \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData::OPERATION_DELIVER,\n    [\n        'uuid-of-line-item #1' =\u003e 1, // the value is the qty of the count of items, which should be delivered/canceled/return,\n        'uuid-of-line-item #2' =\u003e 5,\n        'uuid-of-line-item #3' =\u003e 2,\n        \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData::ITEM_ID_SHIPPING =\u003e 1, // use this to use the shipping-position in this operation.\n    ]\n);\n\n$requestBuilder = $requestService-\u003edoRequest($requestData);\n\n/** @var \\RatePAY\\Model\\Response\\ConfirmationDeliver $response */\n$response = $requestBuilder-\u003egetResponse();\n\nif($response-\u003eisSuccessful()) {\n    // do something if the request is successful\n}\n```\n\n#### Example 3\n\nin this example you will see how to update stocks on return/cancel.\n\nThis make sense if you want to automatically re-add the items to your stock after a return/cancel.\n\n```php\n/** @var \\Shopware\\Core\\Framework\\Context $context **/\n/** @var \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentCancelService $requestService **/\n\n// the order to process\n/** @var \\Shopware\\Core\\Checkout\\Order\\OrderEntity $orderEntity **/\n\n$requestData = new \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData(\n    $context,\n    $orderEntity,\n    \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\OrderOperationData::OPERATION_CANCEL,\n    null, // optional: add the line items/shipping/discount positions\n    true // set this flag to `true`, if you want to update the stock. set it to `false`, if not. (default is `true`)\n);\n\n$requestBuilder = $requestService-\u003edoRequest($requestData);\n\n/** @var \\RatePAY\\Model\\Response\\PaymentChange $response */\n$response = $requestBuilder-\u003egetResponse();\n\nif($response-\u003eisSuccessful()) {\n    // do something if the request is successful\n}\n```\n\n## PaymentCreditService\n\nUse this service to add a debit or a credit to the order.\n\n**Please note:** you don't have to add the debit/credit to the order before. it will be added automatically.\n**Please note:** you don't have to deliver the credit/debit item. It is already marked as delivered on the Ratepay\ngateway.\n\n|                |                                                                                    |\n|----------------|------------------------------------------------------------------------------------|\n| Service Class  | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentCreditService` |\n| Data Class     | `\\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\AddCreditData`                    |\n| Response Class | `\\RatePAY\\Model\\Response\\PaymentChange`                                            |\n\n## Example\n\n```php\n/** @var \\Shopware\\Core\\Framework\\Context $context **/\n/** @var \\Ratepay\\RpayPayments\\Components\\OrderManagement\\Service\\LineItemFactory $lineItemFactory **/\n/** @var \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Service\\Request\\PaymentCreditService $requestService **/\n\n// the order to process\n/** @var \\Shopware\\Core\\Checkout\\Order\\OrderEntity $orderEntity **/\n\n$lineItem = $lineItemFactory-\u003ecreateLineItem(\n    $orderEntity,\n    'Name of the Credit/Debit on the invoice',  // Please note: use the correct translation. This will not get automatically translated\n    10.50, // amount of the item. Can be also negative for a credit.\n    $taxRuleIdOrTaxRate, // rule-id for tax calculation or the exact tax-rate (e.g. `19` for 19% tax)\n    $context\n)\n$requestData = new \\Ratepay\\RpayPayments\\Components\\RatepayApi\\Dto\\AddCreditData(\n    $context,\n    $orderEntity,\n    [$lineItem] // you can also dismiss this parameter and use `$requestData-\u003eaddItem($lineItem)` to add more than on line-item\n);\n\n$requestBuilder = $requestService-\u003edoRequest($requestData);\n\n/** @var \\RatePAY\\Model\\Response\\PaymentChange $response */\n$response = $requestBuilder-\u003egetResponse();\n\nif($response-\u003eisSuccessful()) {\n    // do something if the request is successful\n}\n```\n\n**Please note the following information for this request:**\n\n1. The amount has to be net or gross. Depending on the value of `$orderEntity-\u003egetTaxStatus()`.\n2. Please do not create a line-item by your own. Please use the factory to make sure the line-item is calculated\n   correctly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratepay%2Fshopware6-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratepay%2Fshopware6-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratepay%2Fshopware6-module/lists"}