Skip to content

Commit baa08d6

Browse files
feature symfony#58427 [Notifier] [GatewayAPI] Add support for label parameter (Nico Hiort af Ornäs)
This PR was squashed before being merged into the 7.2 branch. Discussion ---------- [Notifier] [GatewayAPI] Add support for label parameter | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | License | MIT Add `label` parameter for GatewayAPI. From the documentation: ``` label (string) - A label added to each sent message, which can be used to uniquely identify a customer or company that you have sent the message on behalf of. Can e.g. be used when invoicing your customers. If specified it must be the same for all messages in the request. ``` Commits ------- 67c136e [Notifier] [GatewayAPI] Add support for label parameter
2 parents a6b38b4 + 67c136e commit baa08d6

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/Symfony/Component/Notifier/Bridge/GatewayApi/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.2
5+
---
6+
7+
* Add label option to `GatewayApiOptions` class
8+
49
6.3
510
---
611

src/Symfony/Component/Notifier/Bridge/GatewayApi/GatewayApiOptions.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ public function callbackUrl(string $callbackUrl): static
5858
return $this;
5959
}
6060

61+
/**
62+
* @return $this
63+
*/
64+
public function label(string $label): static
65+
{
66+
$this->options['label'] = $label;
67+
68+
return $this;
69+
}
70+
6171
public function toArray(): array
6272
{
6373
return $this->options;

src/Symfony/Component/Notifier/Bridge/GatewayApi/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ $options = (new GatewayApiOptions())
3232
->class('standard')
3333
->callbackUrl('https://my-callback-url')
3434
->userRef('user_ref')
35+
->label('label')
3536
// ...
3637
;
3738

src/Symfony/Component/Notifier/Bridge/GatewayApi/Tests/GatewayApiOptionsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ public function testGatewayApiOptions()
2121
$gatewayApiOptions = (new GatewayApiOptions())
2222
->class('test_class')
2323
->callbackUrl('test_callback_url')
24-
->userRef('test_user_ref');
24+
->userRef('test_user_ref')
25+
->label('test_label');
2526

2627
self::assertSame([
2728
'class' => 'test_class',
2829
'callback_url' => 'test_callback_url',
2930
'userref' => 'test_user_ref',
31+
'label' => 'test_label',
3032
], $gatewayApiOptions->toArray());
3133
}
3234
}

0 commit comments

Comments
 (0)