File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232class Bogus_Gateway extends \WC_Payment_Gateway {
3333
3434
35+ /** @var string the "accepted" payment result code */
36+ const PAYMENT_RESULT_APPROVED = 'approved ' ;
37+
38+ /** @var string the "declined" payment result code */
39+ const PAYMENT_RESULT_DECLINED = 'declined ' ;
40+
41+ /** @var string the "held" payment result code */
42+ const PAYMENT_RESULT_HELD = 'held ' ;
43+
44+
3545 /** @var string subscriptions setting */
3646 private $ subscriptions ;
3747
@@ -130,6 +140,27 @@ public function init_form_fields() {
130140 }
131141
132142
143+ /**
144+ * Renders the gateway payment fields.
145+ *
146+ * @since x.y.z
147+ */
148+ public function payment_fields () {
149+
150+ parent ::payment_fields ();
151+
152+ woocommerce_form_field ( "{$ this ->id }_payment_result " , [
153+ 'type ' => 'select ' ,
154+ 'label ' => __ ( 'Result ' , 'woocommerce-dev-helper ' ),
155+ 'options ' => [
156+ self ::PAYMENT_RESULT_APPROVED => __ ( 'Approved ' , 'woocommerce-dev-helper ' ),
157+ self ::PAYMENT_RESULT_DECLINED => __ ( 'Declined ' , 'woocommerce-dev-helper ' ),
158+ self ::PAYMENT_RESULT_HELD => __ ( 'Held ' , 'woocommerce-dev-helper ' ),
159+ ],
160+ ] );
161+ }
162+
163+
133164 /**
134165 * Returns true if Subscriptions support is enabled.
135166 *
You can’t perform that action at this time.
0 commit comments