1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This software may be modified and distributed under the terms |
7
|
|
|
* of the MIT license. See the LICENSE file for details. |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace Shapin\Stripe\Configuration; |
11
|
|
|
|
12
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
13
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
14
|
|
|
|
15
|
|
|
class RefundCreate implements ConfigurationInterface |
16
|
|
|
{ |
17
|
|
|
public function getConfigTreeBuilder() |
18
|
|
|
{ |
19
|
|
|
$treeBuilder = new TreeBuilder('shapin_stripe'); |
20
|
|
|
$rootNode = $treeBuilder->getRootNode(); |
21
|
|
|
|
22
|
|
|
$rootNode |
23
|
|
|
->children() |
24
|
|
|
->scalarNode('charge') |
25
|
|
|
->isRequired() |
26
|
|
|
->info('The identifier of the charge to refund.') |
27
|
|
|
->end() |
28
|
|
|
->integerNode('amount') |
29
|
|
|
->info('A positive integer in cents representing how much of this charge to refund. Can refund only up to the remaining, unrefunded amount of the charge.') |
30
|
|
|
->end() |
31
|
|
|
->arrayNode('metadata') |
32
|
|
|
->scalarPrototype()->end() |
33
|
|
|
->info('A set of key-value pairs that you can attach to a Refund object. This can be useful for storing additional information about the refund in a structured format. You can unset individual keys if you POST an empty value for that key. You can clear all keys if you POST an empty value for metadata') |
34
|
|
|
->end() |
35
|
|
|
->enumNode('reason') |
36
|
|
|
->info('String indicating the reason for the refund. If set, possible values are duplicate, fraudulent, and requested_by_customer. If you believe the charge to be fraudulent, specifying fraudulent as the reason will add the associated card and email to your blocklists, and will also help us improve our fraud detection algorithms.') |
37
|
|
|
->values(['duplicate', 'fraudulent', 'requested_by_customer']) |
38
|
|
|
->end() |
39
|
|
|
->booleanNode('refund_application_fee') |
40
|
|
|
->info('Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge.') |
41
|
|
|
->defaultValue(false) |
42
|
|
|
->end() |
43
|
|
|
->booleanNode('reverse_transfer') |
44
|
|
|
->info('Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge.') |
45
|
|
|
->defaultValue(false) |
46
|
|
|
->end() |
47
|
|
|
->end() |
48
|
|
|
; |
49
|
|
|
|
50
|
|
|
return $treeBuilder; |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|