wp-pay-gateways /
omnikassa
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Pronamic\WordPress\Pay\Gateways\OmniKassa; |
||||
| 4 | |||||
| 5 | use Pronamic\WordPress\Pay\Core\GatewaySettings; |
||||
| 6 | |||||
| 7 | /** |
||||
| 8 | * Title: iDEAL gateway settings |
||||
| 9 | * Description: |
||||
| 10 | * Copyright: 2005-2019 Pronamic |
||||
| 11 | * Company: Pronamic |
||||
| 12 | * |
||||
| 13 | * @author Remco Tolsma |
||||
| 14 | * @version 2.0.0 |
||||
| 15 | * @since 1.0.0 |
||||
| 16 | */ |
||||
| 17 | class Settings extends GatewaySettings { |
||||
| 18 | public function __construct() { |
||||
| 19 | add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) ); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 20 | add_filter( 'pronamic_pay_gateway_fields', array( $this, 'fields' ) ); |
||||
| 21 | } |
||||
| 22 | |||||
| 23 | public function sections( array $sections ) { |
||||
| 24 | // iDEAL |
||||
| 25 | $sections['omnikassa'] = array( |
||||
| 26 | 'title' => __( 'OmniKassa', 'pronamic_ideal' ), |
||||
|
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 27 | 'methods' => array( 'omnikassa' ), |
||||
| 28 | ); |
||||
| 29 | |||||
| 30 | // Advanced |
||||
| 31 | $sections['omnikassa_advanced'] = array( |
||||
| 32 | 'title' => __( 'Advanced', 'pronamic_ideal' ), |
||||
| 33 | 'methods' => array( 'omnikassa' ), |
||||
| 34 | ); |
||||
| 35 | |||||
| 36 | return $sections; |
||||
| 37 | } |
||||
| 38 | |||||
| 39 | public function fields( array $fields ) { |
||||
| 40 | // Merchant ID |
||||
| 41 | $fields[] = array( |
||||
| 42 | 'filter' => FILTER_SANITIZE_STRING, |
||||
| 43 | 'section' => 'omnikassa', |
||||
| 44 | 'meta_key' => '_pronamic_gateway_omnikassa_merchant_id', |
||||
| 45 | 'title' => __( 'Merchant ID', 'pronamic_ideal' ), |
||||
|
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 46 | 'type' => 'text', |
||||
| 47 | 'classes' => array( 'code' ), |
||||
| 48 | ); |
||||
| 49 | |||||
| 50 | // Secret Key |
||||
| 51 | $fields[] = array( |
||||
| 52 | 'filter' => FILTER_SANITIZE_STRING, |
||||
| 53 | 'section' => 'omnikassa', |
||||
| 54 | 'meta_key' => '_pronamic_gateway_omnikassa_secret_key', |
||||
| 55 | 'title' => __( 'Secret Key', 'pronamic_ideal' ), |
||||
| 56 | 'type' => 'text', |
||||
| 57 | 'classes' => array( 'large-text', 'code' ), |
||||
| 58 | ); |
||||
| 59 | |||||
| 60 | // Key Version |
||||
| 61 | $fields[] = array( |
||||
| 62 | 'filter' => FILTER_SANITIZE_STRING, |
||||
| 63 | 'section' => 'omnikassa', |
||||
| 64 | 'meta_key' => '_pronamic_gateway_omnikassa_key_version', |
||||
| 65 | 'title' => __( 'Key Version', 'pronamic_ideal' ), |
||||
| 66 | 'type' => 'text', |
||||
| 67 | 'classes' => array( 'code' ), |
||||
| 68 | 'size' => 5, |
||||
| 69 | 'description' => sprintf( __( 'You can find the key version in the <a href="%s" target="_blank">OmniKassa Download Dashboard</a>.', 'pronamic_ideal' ), 'https://download.omnikassa.rabobank.nl/' ), |
||||
| 70 | ); |
||||
| 71 | |||||
| 72 | // Transaction feedback |
||||
| 73 | $fields[] = array( |
||||
| 74 | 'section' => 'omnikassa', |
||||
| 75 | 'title' => __( 'Transaction feedback', 'pronamic_ideal' ), |
||||
| 76 | 'type' => 'description', |
||||
| 77 | 'html' => sprintf( |
||||
| 78 | '<span class="dashicons dashicons-yes"></span> %s', |
||||
| 79 | __( 'Payment status updates will be processed without any additional configuration.', 'pronamic_ideal' ) |
||||
| 80 | ), |
||||
| 81 | ); |
||||
| 82 | |||||
| 83 | // Purchase ID |
||||
| 84 | $fields[] = array( |
||||
| 85 | 'filter' => FILTER_SANITIZE_STRING, |
||||
| 86 | 'section' => 'omnikassa_advanced', |
||||
| 87 | 'meta_key' => '_pronamic_gateway_omnikassa_order_id', |
||||
| 88 | 'title' => __( 'Order ID', 'pronamic_ideal' ), |
||||
| 89 | 'type' => 'text', |
||||
| 90 | 'classes' => array( 'regular-text', 'code' ), |
||||
| 91 | 'tooltip' => sprintf( |
||||
| 92 | __( 'The OmniKassa %s parameter.', 'pronamic_ideal' ), |
||||
| 93 | sprintf( '<code>%s</code>', 'orderId' ) |
||||
| 94 | ), |
||||
| 95 | 'description' => sprintf( |
||||
| 96 | '%s %s<br />%s', |
||||
| 97 | __( 'Available tags:', 'pronamic_ideal' ), |
||||
| 98 | sprintf( |
||||
| 99 | '<code>%s</code> <code>%s</code>', |
||||
| 100 | '{order_id}', |
||||
| 101 | '{payment_id}' |
||||
| 102 | ), |
||||
| 103 | sprintf( |
||||
| 104 | __( 'Default: <code>%s</code>', 'pronamic_ideal' ), |
||||
| 105 | '{payment_id}' |
||||
| 106 | ) |
||||
| 107 | ), |
||||
| 108 | ); |
||||
| 109 | |||||
| 110 | return $fields; |
||||
| 111 | } |
||||
| 112 | } |
||||
| 113 |