sample-payment-frame icon indicating copy to clipboard operation
sample-payment-frame copied to clipboard

Multiple Payment Form Documentation

Open tiffanywang3 opened this issue 8 years ago • 3 comments

Documentation should explain the need for a unique iFrame initialization script tag for each new iFrame instance and explicitly state the options object to pass to Spreedly.init().

e.g.

<script
      id="spreedly-iframe-1"
      data-environment-key="SPREEDLY_ENV_KEY"
      data-number-id="spreedly-number-1"
      data-cvv-id="spreedly-cvv-1">
</script>
<script
      id="spreedly-iframe-2"
      data-environment-key="SPREEDLY_ENV_KEY"
      data-number-id="spreedly-number-2"
      data-cvv-id="spreedly-cvv-2">
</script>
<script>
Spreedly.init(SPREEDLY_ENV_KEY, {
    numberEl: 'spreedly-number-1',
    cvvEl: 'spreedly-cvv-1'
  });
let otherSpreedlyInstance = new SpreedlyPaymentFrame();
otherSpreedlyInstance.init(SPREEDLY_ENV_KEY, {
    numberEl: 'spreedly-number-2',
    cvvEl: 'spreedly-cvv-2'
});
</script>

tiffanywang3 avatar Jun 03 '16 20:06 tiffanywang3

Hi @tiffanywang3! Thanks for submitting this issue.

So documentation and sample apps are a sticky subject. I would say that sample apps should not be the place where docs exist for all cases (the multiple iframe case being an edge-case). Instead, you should refer to our iFrame docs for that level of detail.

Or perhaps you're saying we don't document the multi-iframe use-case anywhere (I'm having trouble finding it myself on docs.spreedly.com)?

rwdaigle avatar Jun 06 '16 18:06 rwdaigle

Hi @rwdaigle! Thanks for addressing the issue I opened. I agree, I don't think that the sample app is the best place the put documentation for multi-iframe use-case. I just personally found the existing multi-iframe docs a little lacking. Just thought it might be helpful to include a little more information for people to reference :)

tiffanywang3 avatar Jun 06 '16 18:06 tiffanywang3

I agree, @tiffanywang3, thanks!

We really need to take another pass at our iFrame docs as they're getting a bit unwieldy, as well as better address these alternative workflows.

I'll create an internal issue for our doc site, but will leave this open until it's been addressed. Thank you for the suggestion, Tiffany!

rwdaigle avatar Jun 06 '16 19:06 rwdaigle