<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
        id="cordova-e-ghl-plugin" version="1.0.0">

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <name>eGHL</name>
    <author>GHL Sdn. Bhd</author>
    <description>Plugin to integrate with eGHL's mobile SDK.</description>
    <license>Apache 2.0</license>
    <keywords>eghl,payment,gateway</keywords>

    <js-module src="www/eGHL.js" name="eGHL">
        <clobbers target="eGHL" />
    </js-module>

    <platform name="android">
        <framework src="build-extras-eghl.gradle" custom="true" type="gradleReference" />
        <framework src="com.android.support:support-compat:25.0.1" />
        <config-file target="res/xml/config.xml" parent="/*">
            <preference name="android-minSdkVersion" value="17" />
            <feature name="eGHL">
                <param name="android-package" value="my.com.nexstream.cordovaPlugins.eGHLPay"/>
            </feature>
            <access origin="https://test2pay.ghl.com" />
            <access origin="https://*" /><!-- Bank websites... -->
        </config-file>
        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-permission android:name="android.permission.INTERNET" />
            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
        </config-file>

        <source-file src="android/eGHLPay.java" target-dir="src/my/com/nexstream/cordovaPlugins" />
        <source-file src="android/EghlPayment.java" target-dir="src/my/com/nexstream/cordovaPlugins" />
        <!-- <source-file src="android/eghl-sdk-v2.2.8.aar" target-dir="libs" /> -->

        <framework src="android/android_specific.gradle" custom="true" type="gradleReference" />

        <resource-file src="aar/eghl-sdk-v2.2.8.aar" target="android/eghl-sdk-v2.2.8.aar" />
    </platform>

    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="eGHL">
                <param name="ios-package" value="EGHL"/>
            </feature>
            <access origin="https://test2pay.ghl.com" />
            <access origin="https://*" />
        </config-file>


        <resource-file src="ios/eghl-sdk/guidehandicon.png" />
        <header-file src="ios/eghl-sdk/EGHLPayment.h" />
        <source-file src="ios/eghl-sdk/libEGHLPayment.a" framework="true" />
        <header-file src="ios/EGHL.h" />
        <source-file src="ios/EGHL.m" />
        <header-file src="ios/EGHLPayViewController.h" />
        <source-file src="ios/EGHLPayViewController.m" />
    </platform>

</plugin>
