omise / card.js

Deprecation Notice: Moved to Omise.js
6 stars 3 forks source link

getScriptElement in card.js get wrong content and consistency #3

Open fake-or-dead opened 9 years ago

fake-or-dead commented 9 years ago

I plan to use card.js in Dialog box to paid

but when load with html example in https://docs.omise.co/card-js/ is not working I try to reproduce getScriptElement methods so i found this screen shot 2014-12-19 at 6 19 44 pm

from the same page with 2 scenario normal and popup dialog

so that make omise payment popup is not have any data screen shot 2014-12-19 at 6 21 17 pm

robinclart commented 9 years ago

@tommy-omise already opened a PR (#2) to let multiple instance live on the same page. We'll merge soon.

fake-or-dead commented 9 years ago

we need to change card.js source to https://omise-cdn.s3.amazonaws.com/card.js right?

robinclart commented 9 years ago

Don't need to. I've started invalidating the CDN cache. The new version will be up in a few minutes. Let me know if the problem is solved.

fake-or-dead commented 9 years ago

ok thanks ;D

robinclart commented 9 years ago

@fake-or-dead working?

fake-or-dead commented 9 years ago

nope still the same :(

I think the problems is

var target = document.documentElement;
    while (target.childNodes.length && target.lastChild.nodeType == 1) {
      target = target.lastChild;
    }

in getScriptElement function because I put omise button in another html template and popup dialog via ngDialog and card.js try to insert button in wrong place like this (in ng-close div of ngDialog)

screen shot 2014-12-22 at 7 56 50 pm

so card.js cannot capture any attributes that need (as you see in picture above)

screen shot 2014-12-22 at 8 02 03 pm

may be this is expected results that occur when I open html template alone

robinclart commented 9 years ago

OK we've looked at the issue more thoroughly today and given the way you're loading the button I'm not sure how we'll be able to solve this.

Since we have not yet added programmatic access to open the form from a method call you won't be able to use card.js for now. And I'm not sure when we'll have the time to do it.

The only way I can recommend you to do now is to build your own form and use omise/omise.js directly to create a token.