Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Example Custom Integration does not work #12

Open
pongsakornsemsuwan opened this issue Nov 7, 2016 · 0 comments
Open

Example Custom Integration does not work #12

pongsakornsemsuwan opened this issue Nov 7, 2016 · 0 comments

Comments

@pongsakornsemsuwan
Copy link

pongsakornsemsuwan commented Nov 7, 2016

Hi,
I was trying this 'card.js' and run into errors.

First thing first, the example in README is using gz compression and I'm not sure if it is supposed to be decompressed on the fly or not but my browser console show
card.js.gz:1 Uncaught SyntaxError: Invalid or unexpected token

When I remove the gz, the error is gone but I run into

omise.html:6 Uncaught ReferenceError: OmiseCard is not defined
omise.html:23 Uncaught ReferenceError: OmiseCard is not defined

which is understandable because when I look into card.js, there is no exporting/declaring of OmiseCard obj.

I also try get a copy of gz version and decompress it and I see no different with uncompressed version

<html>
<body>
<script type="text/javascript" src="https://cdn.omise.co/card.js.gz"></script>
<script type="text/javascript">
    // Set default parameters
    OmiseCard.configure({
        publicKey: 'YOUR_PUBLIC_KEY',
        amount: 99500
    });
    // Configuring your own custom button
    OmiseCard.configureButton('#checkout-button-1', {
        frameLabel: 'Merchant site name',
        submitLabel: 'PAY NOW',
    });
</script>
<form name="checkoutForm" method="POST" action="test.html">
    <!--Sample checkout for a 995.00 THB charge-->
    <button type="submit" id="checkout-button-1">Checkout</button>
</form>
<script type="text/javascript">OmiseCard.attach();</script>
</body>
</html>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant