<template>
	<web-view v-if="payUrl" :src="payUrl" @message="getStatus" @onPostMessage="getStatus"></web-view>
</template>
<script>
export default {
    data () {
        return {
            payUrl: null
        }
    },
    onLoad(options) {
		let payUrl = options.url;
		for (let key in options) {
		  if (options.hasOwnProperty(key) && key != 'url') {
			payUrl += '&' + key + '=' + options[key];
		  }
		}
		this.payUrl = payUrl.replace("&", "?");
    },
    methods: {
        getStatus (event) {
            console.log(event)
        }
    }
}
</script>