/
omg-forms-authorize-net.php
39 lines (31 loc) · 1.01 KB
/
omg-forms-authorize-net.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
if ( ! defined( 'OMG_FORMS_AUTHORIZE_VERSION' ) ) {
define( 'OMG_FORMS_AUTHORIZE_VERSION', '0.6.0' );
}
if ( ! defined( 'OMG_FORMS_AUTHORIZE_DIR' ) ) {
define( 'OMG_FORMS_AUTHORIZE_DIR', dirname( __FILE__ ) );
}
if ( ! defined( 'OMG_FORMS_AUTHORIZE_FILE' ) ) {
define( 'OMG_FORMS_AUTHORIZE_FILE', __FILE__ );
}
\AaronHolbrook\Autoload\autoload( OMG_FORMS_AUTHORIZE_DIR . '/includes' );
\OMGForms\Authorize\Settings\setup();
\OMGForms\Authorize\Core\setup();
function authorize_net_force_rest( $args ) {
if ( OMGForms\Helpers\is_form_type( 'authorize_net', $args ) ) {
$args[ 'rest_api' ] = true;
}
return $args;
}
add_filter( 'omg_form_filter_register_args', 'authorize_net_force_rest' );
function authorize_net_filter_form_fields( $args ) {
$args = \OMGForms\Core\register_supplementary_field(
'authorize_net', [
'slug' => 'transaction_amount',
'type' => 'hidden'
],
$args
);
return $args;
}
add_filter( 'omg_form_filter_register_args', __NAMESPACE__ . '\authorize_net_filter_form_fields' );