spreedly / sample-payment-frame

Sample app showing how to use the Spreedly iFrame payment form
https://spreedly-payment-frame.herokuapp.com/
MIT License
17 stars 21 forks source link

Multiple Payment Form Documentation #4

Open tiffanywang3 opened 8 years ago

tiffanywang3 commented 8 years ago

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>
rwdaigle commented 8 years ago

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)?

tiffanywang3 commented 8 years ago

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 :)

rwdaigle commented 8 years ago

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!