## If shop admin does not want to show the payment methods' name during the checkout, please follow the instruction below:
--------------------------------------------------------------------------------------------------------------------------
1. go to file {your shop root folder}/wp-content/plugins/{woocommerce plugin}/template/checkout/payment-method.php

at line 27
		<?php echo $gateway->get_title(); ?> <?php echo $gateway->get_icon(); ?>

change to this code :
		<?php
			if (strpos($gateway->id, 'viveum') === false){
                echo $gateway->get_title(); 
            }
		?> 
		<?php echo $gateway->get_icon(); ?>


## If shop admin does not want to show the payment methods' name during the order detail, please follow the instruction below:
------------------------------------------------------------------------------------------------------------------------------
1. go to file {your shop root folder}/wp-content/plugins/{woocommerce plugin}/template/order/order-details.php

at line 62
			foreach ( $order->get_order_item_totals() as $key => $total ) {
				?>
				<tr>
					<th scope="row"><?php echo $total['label']; ?></th>
					<td><?php echo $total['value']; ?></td>
				</tr>
				<?php
			}

change to this code :

			global $wpdb;

			$isViveum = false;
	        $query = $wpdb->prepare("SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key = '_payment_method' AND post_id = %d", $order->id);
	        $row = $wpdb->get_row($query, ARRAY_A);
			$payment_method = $row['meta_value'];
			if (strpos($payment_method, 'viveum') !== false)
				$isViveum = true;

			foreach ( $order->get_order_item_totals() as $key => $total ) {
				if (!$isViveum || ($isViveum && $total['label'] != 'Payment Method:')):
				?>
				<tr>
					<th scope="row"><?php echo $total['label']; ?></th>
					<td><?php echo $total['value']; ?></td>
				</tr>
				<?php
				endif;
			}

## If shop admin does not want to show the payment methods' name during the checkout form, please follow the instruction below:
-------------------------------------------------------------------------------------------------------------------------------
1. go to file {your shop root folder}/wp-content/plugins/{woocommerce plugin}/include/shortcodes/class-wc-shortcode-checkout.php

at line 152

						<?php if ($order->payment_method_title) : ?>
						<li class="method">
							<?php _e( 'Payment Method:', 'woocommerce' ); ?>
							<strong><?php
								echo $order->payment_method_title;
							?></strong>
						</li>
						<?php endif; ?>


change to this code :

						<?php
						if ($order->payment_method_title) :

							global $wpdb;
							$order_id = $order->get_order_number();

					        $query = $wpdb->prepare("SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key = '_payment_method' AND post_id = %d", $order_id);
					        $row = $wpdb->get_row($query, ARRAY_A);
							$payment_method = $row['meta_value'];

							if (strpos($payment_method, 'viveum') === false):
								?>
								<li class="method">
									<?php _e( 'Payment Method:', 'woocommerce' ); ?>
										<strong><?php
											echo $order->payment_method_title;
										?></strong>
								</li>
								<?php
							endif;
						endif;
						?>

## If shop admin does not want to show the payment methods' name during the success order, please follow the instruction below:
-------------------------------------------------------------------------------------------------------------------------------
1. go to file {your shop root folder}/wp-content/plugins/{woocommerce plugin}/template/checkout/thankyou.php

at line 53

			<?php if ( $order->get_payment_method_title() ) : ?>
			<li class="method">
				<?php _e( 'Payment Method:', 'woocommerce' ); ?>
				<strong><?php echo $order->get_payment_method_title(); ?></strong>
			</li>
			<?php endif; ?>

change to this code :

			<?php
			if ( $order->get_payment_method_title() ) :

				global $wpdb;
				$order_id = $order->get_order_number();
		        $query = $wpdb->prepare("SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key = '_payment_method' AND post_id = %d", $order_id);
		        $row = $wpdb->get_row($query, ARRAY_A);
				$payment_method = $row['meta_value'];

				if (strpos($payment_method, 'viveum') === false):
					?>
					<li class="method">
						<?php _e( 'Payment Method:', 'woocommerce' ); ?>
						<strong><?php echo $order->get_payment_method_title(); ?></strong>
					</li>
					<?php
				endif;
			endif;
			?>

***********************************************************************************************************************	
***********************************************************************************************************************		

## Add My Account, Shop, Cart and Checkout Menu at homepage

1. login to backend
2. Click Apperance -> Menus
3. Create New Menu at right panel and add My Account My Account, Shop, Cart and Chackout from left panel

## Viveum General Setting

1. login to backend
2. Click Woocommerce -> Settings
3. Click Tab : Viveum General Setting
4. Fill in "Access Token" with Access Token from BIP
5. Enable "Recurring" if you want CC, DB, and PayPal to support saved card/token
# The setting on "Payments" tab also will use setting for payment method that has "Recurring" in the name
6. Enabled "Require date of birth and gender field" if you want to use klarna payment method

## Viveum Payment Setting

1. login to backend
2. Click Woocommerce -> Settings
3. Click Tab : Payments
4. Choose the payment on top list
5. Click "Manage"/"Set Up" to set Entity ID, mode, etc

## Viveum Webhook Setting
1. Open Viveum General Setting
2. Copy "Secret for url" to clipboard
3. Open Bussiness Inteligence Platform (BIP) on another browser tab and login
4. Go to Administration -> Webhooks
5. Click Add New Webhook and Popup will show up
6. Paste the URL you just copied from Viveum Setting to the URL on the Popup
7. On PAYMENTS section, enable PA and DB. We don't support anything else at the moment.
8. Disable anythink on REGISTRATIONS and RISKS sections if there's any enabled
9. Copy "Secret for encryption" to clipboard
10. Set "Wrapper for encrypted notification" to "JSON"
11. Click "Save" and back to Viveum General Setting
12. Paste the string you just copy to "Secret for encryption"

## Remove index.php at URL structure (APACHE)

1. create .htacess file
2. add this code at root:

A. if shop location on main folder ex: (http://my-domain.com/)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

B. if shop location on sub folder ex: (http://my-domain.com/my-shop/)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /my-shop/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /my-shop/index.php [L]
</IfModule>
# END WordPress

## Remove index.php at URL structure (NGINX)

1 add this code at nginx configuration -> default

A. if shop location on main folder ex: (http://my-domain.com/)
location / {
    try_files $uri $uri/ /index.php?$args;
}


B. if shop location on sub folder ex: (http://my-domain.com/my-shop/)
location /my-shop/ {
    try_files $uri $uri/ /my-shop/index.php?$args;
}

## How to update the plugin
1. Unistall plugin
2. Install plugin from package
3. Configure the plugin in Woocommerce setting
or
1. Direct upload to your web using FTP
2. Deactivate plugin
3. Activate plugin
4. Configure the plugin in Woocommerce setting