Skip to content

Commit 39a9eaf

Browse files
[Bexley][WW] Implement direct debit fields for Agile calls
1 parent 3588198 commit 39a9eaf

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

perllib/Open311/Endpoint/Integration/Agile.pm

+5-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,8 @@ sub _garden_subscription {
129129
# Used for FMS report ID
130130
ActionReference => $args->{attributes}{fixmystreet_id},
131131

132-
# TODO
133-
DirectDebitDate => '',
134-
DirectDebitReference => '',
132+
DirectDebitDate => $args->{attributes}{direct_debit_start_date} // '',
133+
DirectDebitReference => $args->{attributes}{direct_debit_reference} // '',
135134
} );
136135

137136
# Expected response:
@@ -169,6 +168,9 @@ sub _garden_subscription_renew {
169168
PaymentReference => $args->{attributes}{PaymentCode},
170169
PaymentMethodCode =>
171170
PAYMENT_METHOD_MAPPING->{ $args->{attributes}{payment_method} },
171+
172+
DirectDebitDate => $args->{attributes}{direct_debit_start_date} // '',
173+
DirectDebitReference => $args->{attributes}{direct_debit_reference} // '',
172174
} );
173175

174176
# Expected response:

perllib/Open311/Endpoint/Service/UKCouncil/Agile.pm

+17
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ sub _build_attributes {
8484
required => 0,
8585
automated => 'hidden_field',
8686
),
87+
88+
# For direct debit payments
89+
Open311::Endpoint::Service::Attribute->new(
90+
code => 'direct_debit_reference',
91+
description => 'Direct debit reference',
92+
datatype => 'string',
93+
required => 0,
94+
automated => 'hidden_field',
95+
),
96+
Open311::Endpoint::Service::Attribute->new(
97+
code => 'direct_debit_start_date',
98+
description => 'Direct debit initial payment date',
99+
datatype => 'string',
100+
required => 0,
101+
automated => 'hidden_field',
102+
),
103+
87104
);
88105

89106
return \@attributes;

t/open311/endpoint/agile.t

+10
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ subtest 'GET service' => sub {
170170
description => 'Customer external ref',
171171
order => 10,
172172
},
173+
{ %defaults,
174+
code => 'direct_debit_reference',
175+
description => 'Direct debit reference',
176+
order => 11,
177+
},
178+
{ %defaults,
179+
code => 'direct_debit_start_date',
180+
description => 'Direct debit initial payment date',
181+
order => 12,
182+
},
173183

174184
],
175185
}, 'correct json returned';

0 commit comments

Comments
 (0)