Code Monkey home page Code Monkey logo

card.js's People

Contributors

fred avatar guzzilar avatar ozinepank avatar ratchagarn avatar tommy-omise avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

card.js's Issues

Example Custom Integration does not work

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>

Update usability in popup UI

screen shot 2559-05-03 at 10 02 12 am

IA

1. What I pay for

2. How much I commit to pay

3. Name on card

  • Name of card holder
  • Card holder name
  • Name on card < shortest and clearest
  • Name (as it appears on your card)
  • Full name on card

4. My card can pay?

use logo

5. Expire date

Because this input requires a particular format for the date, we included placeholder text inside the input. Note that the placeholder text includes a “/”, but this is not required to be typed by the user. We limit the input value to numbers only, so if a user does type a forward slash, it is not registered. After the month is entered, the slash is automatically appended.

1-uagwthesgjyz4w2shrakmq

6. Security code

it’s meant to make cards more secure. The problem is that this code suffers severely from non-standardized naming. What should we call it? Every card brand has its own naming convention:

  • MasterCard — card validation code (“CVC2”)
  • Visa — card verification value (“CVV2”)
  • JCB -- security code < use this

nicos

select popup help depend on card number

screen shot 2559-05-03 at 5 38 21 pm

## 7. Address should have more detail not only zipcode

[ address text area ]
[ zipcode ]

8. Add more secure feeling

submit button should have total money + secure icon under button

screen shot 2559-05-03 at 5 43 37 pm

## 9. Show what happen after pay

1-bpfw5xpkg6hv09gzxuszda

result fail handle is missing

function listenToCardJsIframeMessage(event) {
    if (!event.origin) {
      return;
    };

    if (event.origin !== serverOrigin) {
      return;
    };

    if (event.data == "closeOmiseCardJsPopup") {
      hideIframe();
    } else {

      try {
        if (formObject && formObject.active) {
          var result = JSON.parse(event.data);
          omiseTokenHiddenField.value = result.omiseToken;
          hideIframe();
          formObject.submit();
        };
      }
      catch (e) {
        hideIframe();
      };

    };
  };

I can't find a way to handle error message if Omise return Error https://docs.omise.co/api/errors/
It's just cactch and hide iframe

incase that Omise return error msg correctly I still can't get error msg because of submit form only omiseToken data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.