Midtrans interface payment plugin for Wisataone.id
Follow two section instructions below:
Login wp-admin > Plugins > Add New > Upload Plugin > Choose wisataone-midtrans-*-plugin.zip > Install Now > Activate
- pada berkas plugin "tourmaster/include/payment-util.php" cari fungsi
tourmaster_payment_method()
tambahkan baris berikut
$midtrans_enable = in_array('midtrans', $payment_method);
tepat setelah baris
$paypal_enable = in_array('paypal', $payment_method);
- pada berkas yang sama, ubah baris berikut
if( $admin_approval && ($paypal_enable...
menjadi
if( $admin_approval && ($midtrans_enable || $paypal_enable...
- masih pada berkas yang sama tambahkan blok baris berikut dibawah perubahan nomor 2,
if( $midtrans_enable ){
$midtrans_button_atts = apply_filters('tourmaster_midtrans_button_atts', array());
$ret .= '<div class="tourmaster-online-payment-method tourmaster-payment-paypal" >';
$ret .= '<img style="object-fit: contain; background: rgba(255, 255, 255, .7); border-radius: 3px; padding: 4px;" src="https://algorit.ma/wp-content/uploads/2017/08/midtrans.png" alt="midtrans" width="170" height="76" ';
if( !empty($midtrans_button_atts['method']) && $midtrans_button_atts['method'] == 'ajax' ){
$ret .= 'data-method="ajax" data-action="tourmaster_payment_selected" data-ajax="' . esc_url(TOURMASTER_AJAX_URL) . '" ';
if( !empty($midtrans_button_atts['type']) ){
$ret .= 'data-action-type="' . esc_attr($midtrans_button_atts['type']) . '" ';
}
}
$ret .= ' />';
$ret .= '</div>';
}
tepat setelah baris
$ret .= '<div class="tourmaster-payment-gateway clearfix" >';
- pada berkas plugin "tourmaster/include/plugin-option.php" cari baris berikut
'payment-method' => array(
lalu tambahkan
'midtrans' => esc_html__('Midtrans', 'tourmaster'),
pada bagian options.
- Select Midtrans payment method on Tourmaster Setting page.
Tourmaster > Payment > Choose Midtrans on section "Payment Method"
- Setup your Midtrans credential key on
Tourmaster > Payment > Midtrans
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Date | Description |
---|---|
Sep 21st, 2019 | Init Project |
Oct 7th, 2019 | Final version 1.0 |