@@ -2,7 +2,9 @@ import exceptions from './bancard-checkout-exceptions';
22import constants from './constants' ;
33
44const CHECKOUT_IFRAME_URL = `${ constants . BANCARD_URL } /checkout/new` ;
5+ const CHECKOUT_EXAMPLE_IFRAME_URL = `${ constants . BANCARD_URL } /checkout/static_example` ;
56const NEW_CARD_IFRAME_URL = `${ constants . BANCARD_URL } /checkout/register_card/new` ;
7+ const CARD_EXAMPLE_IFRAME_URL = `${ constants . BANCARD_URL } /checkout/static_example/register_card` ;
68const ZIMPLE_IFRAME_URL = `${ constants . BANCARD_URL } /checkout/zimple/new` ;
79const ALLOWED_STYLES_URL = `${ constants . BANCARD_URL } /checkout/allowed_styles` ;
810const CONFIRMATION_IFRAME_URL = `${ constants . BANCARD_URL } /alias_token/confirmation/new` ;
@@ -159,6 +161,18 @@ const internalMethods = {
159161 internalMethods . initializeIframe ( divId , iFrameUrl , options ) ;
160162 } ,
161163
164+ createStaticForm : ( {
165+ divId, applicationId, options, url,
166+ } ) => {
167+ if ( typeof applicationId !== 'string' || applicationId === '' ) {
168+ throw new exceptions . InvalidParameter ( 'Application id' ) ;
169+ }
170+
171+ const iFrameUrl = internalMethods . addParamToUrl ( url , 'application_id' , applicationId ) ;
172+
173+ internalMethods . initializeIframe ( divId , iFrameUrl , options ) ;
174+ } ,
175+
162176 loadPinPad : ( {
163177 divId, aliasToken, options, url,
164178 } ) => {
@@ -190,6 +204,17 @@ class Bancard {
190204 } ;
191205 }
192206
207+ get CheckoutExample ( ) {
208+ return {
209+ createStaticForm : ( divId , applicationId , options ) => {
210+ this . divId = divId ;
211+ internalMethods . createStaticForm ( {
212+ divId, applicationId, options, url : CHECKOUT_EXAMPLE_IFRAME_URL ,
213+ } ) ;
214+ } ,
215+ } ;
216+ }
217+
193218 get Cards ( ) {
194219 return {
195220 createForm : ( divId , processId , options ) => {
@@ -201,6 +226,17 @@ class Bancard {
201226 } ;
202227 }
203228
229+ get CardsExample ( ) {
230+ return {
231+ createStaticForm : ( divId , applicationId , options ) => {
232+ this . divId = divId ;
233+ internalMethods . createStaticForm ( {
234+ divId, applicationId, options, url : CARD_EXAMPLE_IFRAME_URL ,
235+ } ) ;
236+ } ,
237+ } ;
238+ }
239+
204240 get Zimple ( ) {
205241 return {
206242 createForm : ( divId , processId , options ) => {
0 commit comments