adyen-skinbuilder 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +9 -9
  2. data/CHANGELOG.md +4 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/adyen-skinbuilder/server.rb +15 -4
  5. data/lib/adyen-skinbuilder/server/views/_adyen_form.html.erb +14 -19
  6. data/lib/adyen-skinbuilder/server/views/_adyen_payment_fields.html.erb +1560 -910
  7. data/lib/adyen-skinbuilder/server/views/css/reset.css +137 -5
  8. data/lib/adyen-skinbuilder/server/views/img/pm/bankTransfer_IBAN.png +0 -0
  9. data/lib/adyen-skinbuilder/server/views/img/pm/bankTransfer_NL.png +0 -0
  10. data/lib/adyen-skinbuilder/server/views/img/pm/directdebit_NL.png +0 -0
  11. data/lib/adyen-skinbuilder/server/views/img/pm/hyvesafrekenen.png +0 -0
  12. data/lib/adyen-skinbuilder/server/views/img/pm/maestro_small.png +0 -0
  13. data/lib/adyen-skinbuilder/server/views/img/pm/openinvoice.png +0 -0
  14. data/lib/adyen-skinbuilder/server/views/js/animatedcollapse.js +114 -0
  15. data/lib/adyen-skinbuilder/server/views/js/cc.js +456 -0
  16. data/lib/adyen-skinbuilder/server/views/js/default.js +214 -7
  17. data/lib/adyen-skinbuilder/server/views/layout.html.erb +8 -6
  18. data/lib/adyen-skinbuilder/server/views/skin.html.erb +1 -6
  19. data/lib/adyen-skinbuilder/version.rb +1 -1
  20. data/spec/lib/adyen-skinbuilder/server_spec.rb +1 -1
  21. metadata +11 -8
  22. data/lib/adyen-skinbuilder/server/views/img/icons/error.png +0 -0
  23. data/lib/adyen-skinbuilder/server/views/img/pm/card.png +0 -0
  24. data/lib/adyen-skinbuilder/server/views/img/pm/ideal.png +0 -0
  25. data/lib/adyen-skinbuilder/server/views/img/pm/vias_small.png +0 -0
  26. data/lib/adyen-skinbuilder/server/views/img/pm/visa.png +0 -0
@@ -103,11 +103,15 @@
103
103
 
104
104
  .pmBach { background-image: url(../img/pm/ach.png) !important; }
105
105
  .pmBachcolombia { background-image: url(../img/pm/achcolombia.png) !important; }
106
+ .pmBafterpay_default { background-image: url(../img/pm/afterpay_default.png) !important; }
107
+ .pmBafterpay_directdebit { background-image: url(../img/pm/afterpay_directdebit.png) !important; }
106
108
  .pmBalbelligiftcard { background-image: url(../img/pm/albelligiftcard.png) !important; }
107
109
  .pmBalipay { background-image: url(../img/pm/alipay.png) !important; }
110
+ .pmBalipay_wap { background-image: url(../img/pm/alipay_wap.png) !important; }
108
111
  .pmBamex { background-image: url(../img/pm/amex.png) !important; }
109
112
  .pmBargencard { background-image: url(../img/pm/argencard.png) !important; }
110
113
  .pmBasiapay { background-image: url(../img/pm/asiapay.png) !important; }
114
+ .pmBasiapay_unionpay { background-image: url(../img/pm/asiapay_unionpay.png) !important; }
111
115
  .pmBaura { background-image: url(../img/pm/aura.png) !important; }
112
116
  .pmBautopay { background-image: url(../img/pm/autopay.png) !important; }
113
117
 
@@ -148,6 +152,9 @@
148
152
  .pmBbankTransfer_SE { background-image: url(../img/pm/bankTransfer_SE.png) !important; }
149
153
  .pmBbankTransfer_SK { background-image: url(../img/pm/bankTransfer_SK.png) !important; }
150
154
  .pmBbankTransfer_US { background-image: url(../img/pm/bankTransfer_US.png) !important; }
155
+ .pmBbankTransfer_MX { background-image: url(../img/pm/bankTransfer_MX.png) !important; }
156
+ .pmBbankTransfer_MX_offline { background-image: url(../img/pm/bankTransfer_MX_offline.png) !important; }
157
+ .pmBbankTransfer_MX_linked { background-image: url(../img/pm/bankTransfer_MX_linked.png) !important; }
151
158
 
152
159
  .pmBbanorte { background-image: url(../img/pm/banorte.png) !important; }
153
160
  .pmBbarras { background-image: url(../img/pm/barras.png) !important; }
@@ -155,15 +162,27 @@
155
162
  .pmBbeelinesms { background-image: url(../img/pm/beelinesms.png) !important; }
156
163
  .pmBbijcard { background-image: url(../img/pm/bijcard.png) !important; }
157
164
  .pmBbijcadeaucard { background-image: url(../img/pm/bijcadeaucard.png) !important; }
165
+ .pmBbijenkorf { background-image: url(../img/pm/bijenkorf.png) !important; }
166
+ .pmBbijpoints { background-image: url(../img/pm/bijpoints.png) !important; }
167
+ .pmBbijvoucher { background-image: url(../img/pm/bijvoucher.png) !important; }
158
168
  .pmBbill99 { background-image: url(../img/pm/bill99.png) !important; }
169
+ .pmBasiabillpay { background-image: url(../img/pm/asiabillpay.png) !important; }
159
170
  .pmBboleto { background-image: url(../img/pm/boleto.png) !important; }
160
171
  .pmBbradesco { background-image: url(../img/pm/bradesco.png) !important; }
161
172
  .pmBbualuangibanking { background-image: url(../img/pm/bualuangibanking.png) !important; }
173
+ .pmBsmartmoney { background-image: url(../img/pm/smartmoney.png) !important; }
174
+ .pmBasiapay_m2u { background-image: url(../img/pm/asiapay_m2u.png) !important; }
175
+ .pmBasiapay_cimbclick { background-image: url(../img/pm/asiapay_cimbclick.png) !important; }
176
+ .pmBvisaalphabankbonus { background-image: url(../img/pm/visaalphabankbonus.png) !important; }
177
+ .pmBmcalphabankbonus { background-image: url(../img/pm/mcalphabankbonus.png) !important; }
162
178
 
163
179
  .pmBcabal { background-image: url(../img/pm/cabal.png) !important; }
164
180
  .pmBcard { background-image: url(../img/pm/card.png) !important; }
181
+ .pmBcartebancaire { background-image: url(../img/pm/cartebancaire.png) !important; }
165
182
  .pmBcashticket { background-image: url(../img/pm/cashticket.png) !important; }
166
183
  .pmBcashu { background-image: url(../img/pm/cashu.png) !important; }
184
+ .pmBpayu_IN { background-image: url(../img/pm/payu_IN.png) !important; }
185
+ .pmBclickandbuy { background-image: url(../img/pm/clickandbuy.png) !important; }
167
186
  .pmBc_cash { background-image: url(../img/pm/c_cash.png) !important; }
168
187
  .pmBccavenue { background-image: url(../img/pm/ccavenue.png) !important; }
169
188
  .pmBcellpaypoint { background-image: url(../img/pm/cellpaypoint.png) !important; }
@@ -171,7 +190,9 @@
171
190
  .pmBciberpay { background-image: url(../img/pm/ciberpay.png) !important; }
172
191
  .pmBc_invoice { background-image: url(../img/pm/c_invoice.png) !important; }
173
192
  .pmBcontact_ru { background-image: url(../img/pm/contact_ru.png) !important; }
174
- .pmBc_oprekening { background-image: url(../img/pm/c_oprekening.png) !important; }
193
+ .pmBcostesgiftcard { background-image: url(../img/pm/costesgiftcard.png) !important; }
194
+ .pmBscoregiftcard { background-image: url(../img/pm/scoregiftcard.png) !important; }
195
+ .pmBchasingiftcard { background-image: url(../img/pm/chasingiftcard.png) !important; }
175
196
  .pmBc_paypal { background-image: url(../img/pm/c_paypal.png) !important; }
176
197
  .pmBc_pos { background-image: url(../img/pm/c_pos.png) !important; }
177
198
  .pmBcredencial { background-image: url(../img/pm/credencial.png) !important; }
@@ -179,8 +200,17 @@
179
200
 
180
201
  .pmBdankort { background-image: url(../img/pm/dankort.png) !important; }
181
202
  .pmBdineromail { background-image: url(../img/pm/dineromail.png) !important; }
203
+ .pmBoxxo { background-image: url(../img/pm/oxxo.png) !important; }
204
+ .pmBseveneleven { background-image: url(../img/pm/seveneleven.png) !important; }
182
205
  .pmBdiners { background-image: url(../img/pm/diners.png) !important; }
183
206
  .pmBdirectdebit_NL { background-image: url(../img/pm/directdebit_NL.png) !important; }
207
+ .pmBdirectdebit_BR { background-image: url(../img/pm/directdebit_BR.png) !important; }
208
+ .pmBdirectdebit_BR_bancodobrasil { background-image: url(../img/pm/directdebit_BR_bancodobrasil.png) !important; }
209
+ .pmBdirectdebit_BR_bradesco { background-image: url(../img/pm/directdebit_BR_bradesco.png) !important; }
210
+ .pmBdirectdebit_BR_caixa { background-image: url(../img/pm/directdebit_BR_caixa.png) !important; }
211
+ .pmBdirectdebit_BR_hsbc { background-image: url(../img/pm/directdebit_BR_hsbc.png) !important; }
212
+ .pmBdirectdebit_BR_itau { background-image: url(../img/pm/directdebit_BR_itau.png) !important; }
213
+ .pmBdirectdebit_BR_santander { background-image: url(../img/pm/directdebit_BR_santander.png) !important; }
184
214
  .pmBdirectEbanking { background-image: url(../img/pm/directEbanking.png) !important; }
185
215
  .pmBdirectEbanking_de { background-image: url(../img/pm/directEbanking_de.png) !important; }
186
216
  .pmBdiscover { background-image: url(../img/pm/discover.png) !important; }
@@ -189,10 +219,14 @@
189
219
  .pmBebanking_FI { background-image: url(../img/pm/ebanking_FI.png) !important; }
190
220
  .pmBebucks { background-image: url(../img/pm/ebucks.png) !important; }
191
221
  .pmBelecsnet { background-image: url(../img/pm/elecsnet.png) !important; }
222
+ .pmBelo { background-image: url(../img/pm/elo.png) !important; }
223
+ .pmBuatp { background-image: url(../img/pm/uatp.png) !important; }
192
224
  .pmBelv { background-image: url(../img/pm/elv.png) !important; }
193
225
  .pmBentertainmentcard { background-image: url(../img/pm/entertainmentcard.png) !important; }
194
226
  .pmBeps { background-image: url(../img/pm/eps.png) !important; }
195
227
 
228
+ .pmBfijncadeau { background-image: url(../img/pm/fijncadeau.png) !important; }
229
+ .pmBfonqgiftcard { background-image: url(../img/pm/fonqgiftcard.png) !important; }
196
230
  .pmBforwardmobile { background-image: url(../img/pm/forwardmobile.png) !important; }
197
231
 
198
232
  .pmBgallgall { background-image: url(../img/pm/gallgall.png) !important; }
@@ -201,11 +235,23 @@
201
235
 
202
236
  .pmBhdfc { background-image: url(../img/pm/hdfc.png) !important; }
203
237
  .pmBhipercard { background-image: url(../img/pm/hipercard.png) !important; }
238
+ .pmBhmclub { background-image: url(../img/pm/hmclub.png) !important; }
239
+ .pmBhmlingerie { background-image: url(../img/pm/hmlingerie.png) !important; }
204
240
  .pmBhppPos { background-image: url(../img/pm/hppPos.png) !important; }
241
+ .pmBhpppos_redirect { background-image: url(../img/pm/hppPos.png) !important; }
205
242
  .pmBhsbc { background-image: url(../img/pm/hsbc.png) !important; }
206
243
  .pmBhyvesafrekenen { background-image: url(../img/pm/hyvesafrekenen.png) !important; }
207
244
 
208
245
  .pmBideal { background-image: url(../img/pm/ideal.png) !important; }
246
+ .pmBinicis_creditcard { background-image: url(../img/pm/inicis_creditcard.png) !important; }
247
+ .pmBinicisMobile_creditcard { background-image: url(../img/pm/inicisMobile_creditcard.png) !important; }
248
+ .pmBinicisMobile_accounttransfer { background-image: url(../img/pm/inicisMobile_accounttransfer.png) !important; }
249
+ .pmBinicisMobile_virtualaccount { background-image: url(../img/pm/inicisMobile_virtualaccount.png) !important; }
250
+ .pmBinicisMobile_mobilephone { background-image: url(../img/pm/inicisMobile_mobilephone.png) !important; }
251
+ .pmBinicisIniPay_creditcard { background-image: url(../img/pm/inicisIniPay_creditcard.png) !important; }
252
+ .pmBinicisIniPay_accounttransfer { background-image: url(../img/pm/inicisIniPay_accounttransfer.png) !important; }
253
+ .pmBinicisIniPay_virtualaccount { background-image: url(../img/pm/inicisIniPay_virtualaccount.png) !important; }
254
+ .pmBinicisIniPay_mobilephone { background-image: url(../img/pm/inicisIniPay_mobilephone.png) !important; }
209
255
  .pmBinterac { background-image: url(../img/pm/interac.png) !important; }
210
256
  .pmBipay88 { background-image: url(../img/pm/ipay88.png) !important; }
211
257
  .pmBisracard { background-image: url(../img/pm/isracard.png) !important; }
@@ -219,31 +265,64 @@
219
265
 
220
266
  .pmBkadowereld { background-image: url(../img/pm/kadowereld.png) !important; }
221
267
  .pmBklarna { background-image: url(../img/pm/klarna.png) !important; }
268
+ .pmBklarna_de { background-image: url(../img/pm/klarna_DE.png) !important; }
269
+ .pmBklarna_dk { background-image: url(../img/pm/klarna_DK.png) !important; }
270
+ .pmBklarna_fi { background-image: url(../img/pm/klarna_FI.png) !important; }
271
+ .pmBklarna_nl { background-image: url(../img/pm/klarna_NL.png) !important; }
272
+ .pmBklarna_no { background-image: url(../img/pm/klarna_NO.png) !important; }
273
+ .pmBklarna_se { background-image: url(../img/pm/klarna_SE.png) !important; }
274
+ .pmBklarna_account { background-image: url(../img/pm/klarna_account.png) !important; }
275
+ .pmBklarna_account_de { background-image: url(../img/pm/klarna_account_DE.png) !important; }
276
+ .pmBklarna_account_dk { background-image: url(../img/pm/klarna_account_DK.png) !important; }
277
+ .pmBklarna_account_fi { background-image: url(../img/pm/klarna_account_FI.png) !important; }
278
+ .pmBklarna_account_nl { background-image: url(../img/pm/klarna_account_NL.png) !important; }
279
+ .pmBklarna_account_no { background-image: url(../img/pm/klarna_account_NO.png) !important; }
280
+ .pmBklarna_account_se { background-image: url(../img/pm/klarna_account_SE.png) !important; }
281
+ .pmBklarna_b2b { background-image: url(../img/pm/klarna.png) !important; }
282
+ .pmBklarna_b2b_dk { background-image: url(../img/pm/klarna_DK.png) !important; }
283
+ .pmBklarna_b2b_fi { background-image: url(../img/pm/klarna_FI.png) !important; }
284
+ .pmBklarna_b2b_no { background-image: url(../img/pm/klarna_NO.png) !important; }
285
+ .pmBklarna_b2b_se { background-image: url(../img/pm/klarna_SE.png) !important; }
286
+ .pmBkonbini { background-image: url(../img/pm/konbini.png) !important; }
222
287
  .pmBkrungsrionline { background-image: url(../img/pm/krungsrionline.png) !important; }
223
288
  .pmBktbonline { background-image: url(../img/pm/ktbonline.png) !important; }
224
289
 
225
290
  .pmBlaser { background-image: url(../img/pm/laser.png) !important; }
291
+ .pmBleisurecard { background-image: url(../img/pm/leisurecard.png) !important; }
226
292
 
227
293
  .pmBmaestro { background-image: url(../img/pm/maestro.png) !important; }
228
294
  .pmBmaestrouk { background-image: url(../img/pm/maestrouk.png) !important; }
229
295
  .pmBmc { background-image: url(../img/pm/mc.png) !important; }
230
296
  .pmBmercadopago { background-image: url(../img/pm/mercadopago.png) !important; }
231
297
  .pmBmimoney { background-image: url(../img/pm/mimoney.png) !important; }
298
+ .pmBmobile_suica { background-image: url(../img/pm/mobile_suica.png) !important; }
232
299
  .pmBmoneta { background-image: url(../img/pm/moneta.png) !important; }
233
300
  .pmBmoneybookers { background-image: url(../img/pm/moneybookers.png) !important; }
234
301
  .pmBmoneymail { background-image: url(../img/pm/moneymail.png) !important; }
235
302
  .pmBmoneymoney { background-image: url(../img/pm/moneymoney.png) !important; }
303
+ .pmBmultibanco { background-image: url(../img/pm/multibanco.png) !important; }
304
+ .pmBmusicalcard { background-image: url(../img/pm/musicalcard.png) !important; }
305
+ .pmBcup { background-image: url(../img/pm/cup.png) !important; }
236
306
 
237
307
  .pmBnaranja { background-image: url(../img/pm/naranja.png) !important; }
308
+ .pmBnationalebioscoopbon { background-image: url(../img/pm/nationalebioscoopbon.png) !important; }
238
309
  .pmBnedbank { background-image: url(../img/pm/nedbank.png) !important; }
239
310
  .pmBneteller { background-image: url(../img/pm/neteller.png) !important; }
311
+ .pmBnordea { background-image: url(../img/pm/nordea.png) !important; }
240
312
 
313
+ .pmBonebip { background-image: url(../img/pm/onebip.png) !important; }
314
+ .pmBonetwothree { background-image: url(../img/pm/onetwothree.png) !important; }
241
315
  .pmBonline_RU { background-image: url(../img/pm/online_RU.png) !important; }
242
316
  .pmBopeninvoice { background-image: url(../img/pm/openinvoice.png) !important; }
243
317
 
244
318
  .pmBpagosonline { background-image: url(../img/pm/pagosonline.png) !important; }
319
+ .pmBpathegiftcard { background-image: url(../img/pm/pathegiftcard.png) !important; }
245
320
  .pmBpaypal { background-image: url(../img/pm/paypal.png) !important; }
246
321
  .pmBpaysafecard { background-image: url(../img/pm/paysafecard.png) !important; }
322
+ .pmBpayshop { background-image: url(../img/pm/payshop.png) !important; }
323
+ .pmBpaythru_card { background-image: url(../img/pm/paythru_card.png) !important; }
324
+ .pmBpaythru_eft { background-image: url(../img/pm/paythru_eft.png) !important; }
325
+ .pmBpaythru_amt { background-image: url(../img/pm/paythru_amt.png) !important; }
247
326
  .pmBpayu { background-image: url(../img/pm/payu.png) !important; }
248
327
  .pmBplastix { background-image: url(../img/pm/plastix.png) !important; }
249
328
  .pmBplatezhru { background-image: url(../img/pm/platezhru.png) !important; }
@@ -251,16 +330,26 @@
251
330
  .pmBpodiumcard { background-image: url(../img/pm/podiumcard.png) !important; }
252
331
  .pmBpostoffice_ru { background-image: url(../img/pm/postoffice_ru.png) !important; }
253
332
  .pmBpps { background-image: url(../img/pm/pps.png) !important; }
333
+ .pmBprimeracadeaucard { background-image: url(../img/pm/primeracadeaucard.png) !important; }
254
334
  .pmBpse { background-image: url(../img/pm/pse.png) !important; }
255
335
 
256
336
  .pmBqiwi { background-image: url(../img/pm/qiwi.png) !important; }
337
+ .pmBqiwiwallet { background-image: url(../img/pm/qiwiwallet.png) !important; }
257
338
 
339
+ .pmBrakuten_edy { background-image: url(../img/pm/rakuten_edy.png) !important; }
340
+ .pmBrituals { background-image: url(../img/pm/rituals.png) !important; }
341
+
342
+ .pmBsafeshop_ukash { background-image: url(../img/pm/ukash.png) !important; }
258
343
  .pmBsafetypay { background-image: url(../img/pm/safetypay.png) !important; }
344
+ .pmBsafetypay_cash { background-image: url(../img/pm/safetypay_cash.png) !important; }
345
+ .pmBsagiftcard { background-image: url(../img/pm/sagiftcard.png) !important; }
259
346
  .pmBsantandercredit { background-image: url(../img/pm/santandercredit.png) !important; }
260
347
  .pmBsantanderdebit { background-image: url(../img/pm/santanderdebit.png) !important; }
261
348
  .pmBscbeasy { background-image: url(../img/pm/scbeasy.png) !important; }
262
349
  .pmBscotiabank { background-image: url(../img/pm/scotiabank.png) !important; }
350
+ .pmBsebdirectpayment{ background-image: url(../img/pm/sebdirectpayment.png) !important;}
263
351
  .pmBsendEmail { background-image: url(../img/pm/sendEmail.png) !important; }
352
+ .pmBsepadirectdebit { background-image: url(../img/pm/sepadirectdebit.png) !important; }
264
353
  .pmBshopping { background-image: url(../img/pm/shopping.png) !important; }
265
354
  .pmBsms { background-image: url(../img/pm/sms.png) !important; }
266
355
  .pmBsolo { background-image: url(../img/pm/solo.png) !important; }
@@ -268,13 +357,33 @@
268
357
  .pmBtenpay { background-image: url(../img/pm/tenpay.png) !important; }
269
358
  .pmBterminal_RU { background-image: url(../img/pm/terminal_RU.png) !important; }
270
359
  .pmBtesco { background-image: url(../img/pm/tesco.png) !important; }
360
+ .pmBthestinggiftcard { background-image: url(../img/pm/thestinggiftcard.png) !important; }
271
361
  .pmBtmbinternetbanking { background-image: url(../img/pm/tmbinternetbanking.png) !important; }
362
+ .pmBtrustpay { background-image: url(../img/pm/trustpay.png) !important; }
363
+ .pmBtrustly { background-image: url(../img/pm/trustly.png) !important; }
272
364
 
365
+ .pmBuobdirectdebit { background-image: url(../img/pm/uobdirectdebit.png) !important; }
273
366
  .pmBukash { background-image: url(../img/pm/ukash.png) !important; }
274
367
  .pmBunionpay { background-image: url(../img/pm/unionpay.png) !important; }
275
- .pmBuobdirectdebit { background-image: url(../img/pm/uobdirectdebit.png) !important; }
276
-
277
- .pmBvias { background-image: url(../img/pm/vias.png) !important; }
368
+ .pmBnetaxept_bankaxess { background-image: url(../img/pm/netaxept_bankaxess.png) !important; }
369
+ .pmBboku { background-image: url(../img/pm/boku.png) !important; }
370
+ .pmBpoli { background-image: url(../img/pm/poli.png) !important; }
371
+
372
+ .pmBdragonpay { background-image: url(../img/pm/dragonpay.png) !important; }
373
+ .pmBdragonpay_ebanking { background-image: url(../img/pm/dragonpay_ebanking.png) !important; }
374
+ .pmBdragonpay_gcash { background-image: url(../img/pm/dragonpay_gcash.png) !important; }
375
+ .pmBdragonpay_otc_banking { background-image: url(../img/pm/dragonpay_otc_banking.png) !important; }
376
+ .pmBdragonpay_otc_international { background-image: url(../img/pm/dragonpay_otc_international.png) !important; }
377
+
378
+ .pmBboletobancario { background-image: url(../img/pm/boleto.png) !important; }
379
+ .pmBboletobancario_santander { background-image: url(../img/pm/boleto.png) !important; }
380
+ .pmBboletobancario_itau { background-image: url(../img/pm/boleto.png) !important; }
381
+ .pmBboletobancario_bradesco { background-image: url(../img/pm/boleto.png) !important; }
382
+ .pmBboletobancario_bancodobrasil { background-image: url(../img/pm/boleto.png) !important; }
383
+ .pmBboletobancario_hsbc { background-image: url(../img/pm/boleto.png) !important; }
384
+
385
+ .pmBadyen_test_voucher { background-image: url(../img/pm/adyen_test_voucher.png) !important; }
386
+ .pmBvdcadeaucard { background-image: url(../img/pm/vdcadeaucard.png) !important; }
278
387
  .pmBvisa { background-image: url(../img/pm/visa.png) !important; }
279
388
  .pmBvisa_fr { background-image: url(../img/pm/visa_fr.png) !important; }
280
389
  .pmBvisadankort { background-image: url(../img/pm/visadankort.png) !important; }
@@ -283,24 +392,47 @@
283
392
  .pmBwallet_RU { background-image: url(../img/pm/wallet_RU.png) !important; }
284
393
  .pmBwallie { background-image: url(../img/pm/wallie.png) !important; }
285
394
  .pmBwebmoney { background-image: url(../img/pm/webmoney.png) !important; }
395
+ .pmBwebshopgiftcard { background-image: url(../img/pm/webshopgiftcard.png) !important; }
396
+ .pmBwefashiongiftcard { background-image: url(../img/pm/wefashiongiftcard.png) !important; }
397
+ .pmBwesternunion { background-image: url(../img/pm/westernunion.png) !important; }
286
398
  .pmBwiwallet { background-image: url(../img/pm/wiwallet.png) !important; }
287
399
  .pmByandexmoney { background-image: url(../img/pm/yandexmoney.png) !important; }
288
400
  .pmByourgift { background-image: url(../img/pm/yourgift.png) !important; }
289
401
 
290
-
291
402
  .pmOcamex { background-image: url(../img/pm/amex_small.png); }
292
403
  .pmOcbijcard { background-image: url(../img/pm/bijcard_small.png); }
404
+ .pmOcbcmc { background-image: url(../img/pm/bcmc_small.png); }
293
405
  .pmOccard { background-image: url(../img/pm/card_small.png); }
294
406
  .pmOcdiners { background-image: url(../img/pm/diners_small.png); }
295
407
  .pmOcdiscover { background-image: url(../img/pm/discover_small.png); }
296
408
  .pmOcelv { background-image: url(../img/pm/elv_small.png); }
409
+ .pmOcelo { background-image: url(../img/pm/elo_small.png); }
410
+ .pmOcuatp { background-image: url(../img/pm/uatp_small.png); }
297
411
  .pmOcgiropay { background-image: url(../img/pm/giropay_small.png); }
412
+ .pmOchipercard { background-image: url(../img/pm/hipercard_small.png); }
298
413
  .pmOcmaestrouk { background-image: url(../img/pm/maestrouk_small.png); }
299
414
  .pmOcmc { background-image: url(../img/pm/mc_small.png); }
415
+ .pmOcmaestro { background-image: url(../img/pm/maestro_small.png); }
300
416
  .pmOcsolo { background-image: url(../img/pm/solo_small.png); }
301
417
  .pmOcvisa { background-image: url(../img/pm/visa_small.png); }
418
+ .pmOcvisadankort { background-image: url(../img/pm/visadankort_small.png); }
419
+ .pmOcmoneybookers { background-image: url(../img/pm/moneybookers_small.png); }
420
+ .pmOcpaypal { background-image: url(../img/pm/paypal_small.png); }
421
+ .pmOcdirectdebit_NL { background-image: url(../img/pm/directdebit_NL_small.png); }
422
+ .pmOcdirectdebit_BR_bancodobrasil { background-image: url(../img/pm/directdebit_BR_bancodobrasil_small.png); }
423
+ .pmOcdirectdebit_BR_bradesco { background-image: url(../img/pm/directdebit_BR_bradesco_small.png); }
424
+ .pmOcdirectdebit_BR_caixa { background-image: url(../img/pm/directdebit_BR_caixa_small.png); }
425
+ .pmOcdirectdebit_BR_hsbc { background-image: url(../img/pm/directdebit_BR_hsbc_small.png); }
426
+ .pmOcdirectdebit_BR_itau { background-image: url(../img/pm/directdebit_BR_itau_small.png); }
427
+ .pmOcdirectdebit_BR_santander { background-image: url(../img/pm/directdebit_BR_santander_small.png); }
428
+ .pmOcneteller { background-image: url(../img/pm/neteller_small.png); }
429
+ .pmOnetaxept_bankaxess { background-image: url(../img/pm/netaxept_bankaxess_small.png) !important; }
430
+ .pmOcsepadirectdebit { background-image: url(../img/pm/sepadirectdebit_small.png); }
302
431
 
303
432
  .pinimg { border: 1px solid #00aaef; }
304
433
 
305
434
  .pmmextradescription { text-align: center; }
306
435
  .pmmextradescriptionimg { padding-top: 4px; padding-left: 2px; padding-right: 2px; }
436
+
437
+
438
+
@@ -0,0 +1,114 @@
1
+ //Animated Collapsible DIV- Author: Dynamic Drive (http://www.dynamicdrive.com)
2
+ //Last updated Aug 1st, 07'. Fixed bug with "block" parameter not working when persist is enabled
3
+ //Updated June 27th, 07'. Added ability for a DIV to be initially expanded.
4
+
5
+
6
+ function animatedcollapse(divId, animatetime, persistexpand, initstate, animate){
7
+ this.animate=animate
8
+ this.divId=divId
9
+ this.divObj=document.getElementById(divId)
10
+ this.divObj.style.overflow="hidden"
11
+ this.timelength=animatetime
12
+ this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
13
+ this.isExpanded="no";
14
+ this.contentheight=parseInt(this.divObj.style.height)
15
+ var thisobj=this
16
+ if (isNaN(this.contentheight)){ //if no CSS "height" attribute explicitly defined, get DIV's height on window.load
17
+ animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load")
18
+ if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
19
+ this.divObj.style.visibility="hidden" //hide content (versus collapse) until we can get its height
20
+ }
21
+ else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
22
+ this.divObj.style.height=0 //just collapse content if CSS "height" attribute available
23
+ if (persistexpand){
24
+ animatedcollapse.dotask(window, function(){
25
+ }, "unload")
26
+ }
27
+ }
28
+
29
+ animatedcollapse.prototype._getheight=function(persistexpand){
30
+ this.contentheight=this.divObj.offsetHeight
31
+ if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){ //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
32
+ this.divObj.style.height=0 //collapse content
33
+ this.divObj.style.visibility="visible"
34
+ }
35
+ else //else if persistence is enabled AND this content should be expanded, define its CSS height value so slideup() has something to work with
36
+ this.divObj.style.height=this.contentheight+"px"
37
+ }
38
+
39
+
40
+ animatedcollapse.prototype._slideengine=function(direction, offset){
41
+ var elapsed=new Date().getTime()-this.startTime //get time animation has run
42
+ var thisobj=this
43
+ if (elapsed<this.timelength && this.animate == true){ //if time run is less than specified length
44
+ var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength)
45
+ this.divObj.style.height=(offset+(distancepercent * (this.contentheight-offset))) +"px"
46
+ this.runtimer=setTimeout(function(){thisobj._slideengine(direction,offset)}, 10)
47
+ }
48
+ else{ //if animation finished
49
+ this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0
50
+ this.isExpanded=(direction=="down")? "yes" : "no" //remember whether content is expanded or not
51
+ this.runtimer=null
52
+ }
53
+ }
54
+
55
+
56
+ animatedcollapse.prototype.slidedown=function(){
57
+ if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
58
+ if (isNaN(this.contentheight)) {//if content height not available yet (until window.onload)
59
+ //alert("Please wait until document has fully loaded then click again")
60
+ } else if (parseInt(this.divObj.style.height)==0){ //if content is collapsed
61
+ this.startTime=new Date().getTime() //Set animation start time
62
+ this._slideengine("down",0)
63
+ }
64
+ }
65
+ }
66
+
67
+ animatedcollapse.prototype.forceslidedown=function(offset){
68
+ if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
69
+ if (isNaN(this.contentheight)) {//if content height not available yet (until window.onload)
70
+ //alert("Please wait until document has fully loaded then click again")
71
+ } else { //if content is collapsed
72
+ this.startTime=new Date().getTime() //Set animation start time
73
+ this._slideengine("down",offset)
74
+ }
75
+ }
76
+ }
77
+
78
+ animatedcollapse.prototype.slideup=function(){
79
+ if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
80
+ if (isNaN(this.contentheight)) {//if content height not available yet (until window.onload)
81
+ //alert("Please wait until document has fully loaded then click again")
82
+ } else if (parseInt(this.divObj.style.height)==this.contentheight){ //if content is expanded
83
+ this.startTime=new Date().getTime()
84
+ this._slideengine("up",0)
85
+ }
86
+ }
87
+ }
88
+
89
+ animatedcollapse.prototype.slideit=function(){
90
+ if (isNaN(this.contentheight)) { //if content height not available yet (until window.onload)
91
+ //alert("Please wait until document has fully loaded then click again")
92
+ } else if (parseInt(this.divObj.style.height)==0) {
93
+ this.slidedown()
94
+ } else if (parseInt(this.divObj.style.height)==this.contentheight) {
95
+ this.slideup()
96
+ }
97
+ }
98
+
99
+ // -------------------------------------------------------------------
100
+ // A few utility functions below:
101
+ // -------------------------------------------------------------------
102
+
103
+ animatedcollapse.curveincrement=function(percent){
104
+ return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
105
+ }
106
+
107
+
108
+ animatedcollapse.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
109
+ var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
110
+ if (target.addEventListener)
111
+ target.addEventListener(tasktype, functionref, false)
112
+ else if (target.attachEvent)
113
+ target.attachEvent(tasktype, functionref)
114
+ }
@@ -0,0 +1,456 @@
1
+ <!-- Original: Simon Tneoh (tneohcb@pc.jaring.my) -->
2
+
3
+ /*Cardtype format: name, starting numbers ( , separated, (is not a range)), number of digits ( , separated) */
4
+ var Cards = new makeArray(22);
5
+ Cards[0] = new CardType("mc", "51,52,53,54,55", "16");
6
+ var MasterCard = Cards[0];
7
+ Cards[1] = new CardType("visadankort", "4571", "16");
8
+ var VisaDankort = Cards[1];
9
+ Cards[2] = new CardType("visa", "4", "13,16");
10
+ var VisaCard = Cards[2];
11
+ Cards[3] = new CardType("amex", "34,37", "15");
12
+ var AmExCard = Cards[3];
13
+ Cards[4] = new CardType("vias", "9", "16");
14
+ var AdyenCard = Cards[4];
15
+ Cards[5] = new CardType("diners", "36", "14");
16
+ var DinersClubCard = Cards[5];
17
+ Cards[6] = new CardType("maestrouk", "6759", "16,18,19");
18
+ var MaestroUKCard = Cards[6];
19
+ Cards[7] = new CardType("solo", "6767", "16,18,19");
20
+ var SoloCard = Cards[7];
21
+ Cards[8] = new CardType("laser", "6304,6706,677117,677120", "16,17,18,19");
22
+ var LaserCard = Cards[8];
23
+ Cards[9] = new CardType("discover", "6011,644,645,646,647,648,649,65", "16");
24
+ var DiscoverCard = Cards[9];
25
+ Cards[10] = new CardType("jcb", "3528,3529,353,354,355,356,357,358", "16,19");
26
+ var JCBCard = Cards[10];
27
+ Cards[11] = new CardType("bcmc", "6703", "16,17,18,19");
28
+ var Bcmc = Cards[11];
29
+ Cards[12] = new CardType("bijcard", "5100081", "16");
30
+ var BijCard = Cards[12];
31
+ Cards[13] = new CardType("dankort", "5019", "16");
32
+ var Dankort = Cards[13];
33
+ Cards[14] = new CardType("hipercard", "606282", "16");
34
+ var Hipercard = Cards[14];
35
+ Cards[15] = new CardType("maestro", "50,56,57,58,6", "16");
36
+ var MaestroCard = Cards[15];
37
+ Cards[16] = new CardType("elo", "506699,50670,50671,50672,50673,50674,50675,50676,506770,506771,506772,506773,506774,506775,506776,506777,506778,401178,438935,451416,457631,457632,504175,627780,636297,636368", "16");
38
+ var Elo = Cards[16];
39
+ Cards[17] = new CardType("uatp", "1", "15");
40
+ var Uatp = Cards[17];
41
+ Cards[18] = new CardType("cup", "62", "14,15,16,17,18,19");
42
+ var Cup = Cards[18];
43
+ Cards[19] = new CardType("cartebancaire", "4,5,6", "16");
44
+ var CarteBancaire = Cards[19];
45
+ Cards[20] = new CardType("visaalphabankbonus", "450903", "16");
46
+ var VisAlphaBankBonus = Cards[20];
47
+ Cards[21] = new CardType("mcalphabankbonus", "510099", "16");
48
+ var McAlphaBankBonus = Cards[21];
49
+
50
+ var LuhnCheckSum = Cards[21] = new CardType();
51
+
52
+
53
+
54
+ /*************************************************************************\
55
+ CheckCardNumber(form)
56
+ function called when users click the "check" button.
57
+ \*************************************************************************/
58
+ function CheckCardNumber(cardNumber, expYear, expMon, cardType) {
59
+ var tmpyear;
60
+
61
+ if (cardNumber.length == 0) {
62
+ alert("Please enter a Card Number.");
63
+ return false;
64
+ }
65
+
66
+ if (expYear.length == 0) {
67
+ alert("Please enter the Expiration Year.");
68
+ return false;
69
+ }
70
+
71
+ if (expYear > 96)
72
+ tmpyear = "19" + expYear;
73
+ else if (expYear < 21)
74
+ tmpyear = "20" + expYear;
75
+ else {
76
+ alert("The Expiration Year is not valid.");
77
+ return false;
78
+ }
79
+
80
+ tmpmonth = expMon;
81
+ // The following line doesn't work in IE3, you need to change it
82
+ // to something like "(new CardType())...".
83
+ // if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
84
+ if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) {
85
+ alert("This card has already expired.");
86
+ return false;
87
+ }
88
+ card = cardType;
89
+ var retval = eval(card + ".checkCardNumber(\"" + cardNumber + "\", " + tmpyear + ", " + tmpmonth + ");");
90
+ cardname = "";
91
+
92
+ if (retval){
93
+ // comment this out if used on an order form
94
+ return true;
95
+ }
96
+ else {
97
+ // The cardnumber has the valid luhn checksum, but we want to know which
98
+ // cardtype it belongs to.
99
+ for (var n = 0; n < Cards.size; n++) {
100
+ if (Cards[n].checkCardNumber(cardNumber, tmpyear, tmpmonth)) {
101
+ cardname = Cards[n].getCardType();
102
+ break;
103
+ }
104
+ }
105
+ if (cardname.length > 0) {
106
+ alert("This looks like a " + cardname + " number, not a " + card + " number.");
107
+ }
108
+ else {
109
+ alert("This card number is not valid.");
110
+ }
111
+ }
112
+ }
113
+
114
+ /*************************************************************************\
115
+ Object CardType([String cardtype, String rules, String len, int year,
116
+ int month])
117
+ cardtype : type of card, eg: MasterCard, Visa, etc.
118
+ rules : rules of the cardnumber, eg: "4", "6011", "34,37".
119
+ len : valid length of cardnumber, eg: "16,19", "13,16".
120
+ year : year of expiry date.
121
+ month : month of expiry date.
122
+ eg:
123
+ var VisaCard = new CardType("Visa", "4", "16");
124
+ var AmExCard = new CardType("AmEx", "34,37", "15");
125
+ \*************************************************************************/
126
+ function CardType() {
127
+ var n;
128
+ var argv = CardType.arguments;
129
+ var argc = CardType.arguments.length;
130
+
131
+ this.objname = "object CardType";
132
+
133
+ var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
134
+ var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
135
+ var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";
136
+
137
+ this.setCardNumber = setCardNumber; // set CardNumber method.
138
+ this.setCardType = setCardType; // setCardType method.
139
+ this.setLen = setLen; // setLen method.
140
+ this.setRules = setRules; // setRules method.
141
+ this.setExpiryDate = setExpiryDate; // setExpiryDate method.
142
+
143
+ this.setCardType(tmpcardtype);
144
+ this.setLen(tmplen);
145
+ this.setRules(tmprules);
146
+ if (argc > 4)
147
+ this.setExpiryDate(argv[3], argv[4]);
148
+
149
+ this.checkCardNumber = checkCardNumber; // checkCardNumber method.
150
+ this.getExpiryDate = getExpiryDate; // getExpiryDate method.
151
+ this.getCardType = getCardType; // getCardType method.
152
+ this.isCardNumber = isCardNumber; // isCardNumber method.
153
+ this.isExpiryDate = isExpiryDate; // isExpiryDate method.
154
+ this.luhnCheck = luhnCheck;// luhnCheck method.
155
+ return this;
156
+ }
157
+
158
+ /*************************************************************************\
159
+ boolean checkCardNumber([String cardnumber, int year, int month])
160
+ return true if cardnumber pass the luhncheck and the expiry date is
161
+ valid, else return false.
162
+ \*************************************************************************/
163
+ function checkCardNumber() {
164
+ var argv = checkCardNumber.arguments;
165
+ var argc = checkCardNumber.arguments.length;
166
+ var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
167
+ var year = (argc > 1) ? argv[1] : this.year;
168
+ var month = (argc > 2) ? argv[2] : this.month;
169
+
170
+ this.setCardNumber(cardnumber);
171
+ this.setExpiryDate(year, month);
172
+
173
+ if (!this.isCardNumber())
174
+ return false;
175
+ if (!this.isExpiryDate())
176
+ return false;
177
+
178
+ return true;
179
+ }
180
+ /*************************************************************************\
181
+ String getCardType()
182
+ return the cardtype.
183
+ \*************************************************************************/
184
+ function getCardType() {
185
+ return this.cardtype;
186
+ }
187
+ /*************************************************************************\
188
+ String getExpiryDate()
189
+ return the expiry date.
190
+ \*************************************************************************/
191
+ function getExpiryDate() {
192
+ return this.month + "/" + this.year;
193
+ }
194
+ /*************************************************************************\
195
+ boolean isCardNumber([String cardnumber])
196
+ return true if cardnumber pass the luhncheck and the rules, else return
197
+ false.
198
+ \*************************************************************************/
199
+ function isCardNumber() {
200
+ var argv = isCardNumber.arguments;
201
+ var argc = isCardNumber.arguments.length;
202
+ var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
203
+ if (!this.luhnCheck())
204
+ return false;
205
+
206
+ for (var n = 0; n < this.len.size; n++)
207
+ if (cardnumber.toString().length == this.len[n]) {
208
+ for (var m = 0; m < this.rules.size; m++) {
209
+ var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
210
+ if (headdigit == this.rules[m])
211
+ return true;
212
+ }
213
+ return false;
214
+ }
215
+ return false;
216
+ }
217
+
218
+ /*************************************************************************\
219
+ boolean isExpiryDate([int year, int month])
220
+ return true if the date is a valid expiry date,
221
+ else return false.
222
+ \*************************************************************************/
223
+ function isExpiryDate() {
224
+ var argv = isExpiryDate.arguments;
225
+ var argc = isExpiryDate.arguments.length;
226
+
227
+ year = argc > 0 ? argv[0] : this.year;
228
+ month = argc > 1 ? argv[1] : this.month;
229
+
230
+ if (!isNum(year+""))
231
+ return false;
232
+
233
+ if (!isNum(month+""))
234
+ return false;
235
+
236
+ today = new Date();
237
+ expiry = new Date(year, month);
238
+
239
+ if (today.getTime() > expiry.getTime())
240
+ return false;
241
+ else
242
+ return true;
243
+ }
244
+
245
+ /*************************************************************************\
246
+ boolean isNum(String argvalue)
247
+ return true if argvalue contains only numeric characters,
248
+ else return false.
249
+ \*************************************************************************/
250
+ function isNum(argvalue) {
251
+ argvalue = argvalue.toString();
252
+
253
+ if (argvalue.length == 0)
254
+ return false;
255
+
256
+ for (var n = 0; n < argvalue.length; n++)
257
+ if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
258
+ return false;
259
+ return true;
260
+ }
261
+
262
+ /*************************************************************************\
263
+ boolean luhnCheck([String CardNumber])
264
+ return true if CardNumber pass the luhn check else return false.
265
+ Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
266
+ \*************************************************************************/
267
+ function luhnCheck() {
268
+ var argv = luhnCheck.arguments;
269
+ var argc = luhnCheck.arguments.length;
270
+
271
+ var CardNumber = argc > 0 ? argv[0] : this.cardnumber;
272
+
273
+ if (! isNum(CardNumber)) {
274
+ return false;
275
+ }
276
+
277
+ var no_digit = CardNumber.length;
278
+ var oddoeven = no_digit & 1;
279
+ var sum = 0;
280
+
281
+ for (var count = 0; count < no_digit; count++) {
282
+ var digit = parseInt(CardNumber.charAt(count));
283
+ if (!((count & 1) ^ oddoeven)) {
284
+ digit *= 2;
285
+ if (digit > 9)
286
+ digit -= 9;
287
+ }
288
+ sum += digit;
289
+ }
290
+
291
+ if (sum % 10 == 0)
292
+ return true;
293
+ else
294
+ return false;
295
+ }
296
+
297
+ /*************************************************************************\
298
+ ArrayObject makeArray(int size)
299
+ return the array object in the size specified.
300
+ \*************************************************************************/
301
+ function makeArray(size) {
302
+ this.size = size;
303
+ return this;
304
+ }
305
+
306
+ /*************************************************************************\
307
+ CardType setCardNumber(cardnumber)
308
+ return the CardType object.
309
+ \*************************************************************************/
310
+ function setCardNumber(cardnumber) {
311
+ this.cardnumber = cardnumber;
312
+ return this;
313
+ }
314
+
315
+ /*************************************************************************\
316
+ CardType setCardType(cardtype)
317
+ return the CardType object.
318
+ \*************************************************************************/
319
+ function setCardType(cardtype) {
320
+ this.cardtype = cardtype;
321
+ return this;
322
+ }
323
+
324
+ /*************************************************************************\
325
+ CardType setExpiryDate(year, month)
326
+ return the CardType object.
327
+ \*************************************************************************/
328
+ function setExpiryDate(year, month) {
329
+ this.year = year;
330
+ this.month = month;
331
+ return this;
332
+ }
333
+
334
+ /*************************************************************************\
335
+ CardType setLen(len)
336
+ return the CardType object.
337
+ \*************************************************************************/
338
+ function setLen(len) {
339
+ // Create the len array.
340
+ if (len.length == 0 || len == null)
341
+ len = "13,14,15,16,19";
342
+
343
+ var tmplen = len;
344
+ n = 1;
345
+ while (tmplen.indexOf(",") != -1) {
346
+ tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
347
+ n++;
348
+ }
349
+
350
+ this.len = new makeArray(n);
351
+ n = 0;
352
+ while (len.indexOf(",") != -1) {
353
+ var tmpstr = len.substring(0, len.indexOf(","));
354
+ this.len[n] = tmpstr;
355
+ len = len.substring(len.indexOf(",") + 1, len.length);
356
+ n++;
357
+ }
358
+ this.len[n] = len;
359
+ return this;
360
+ }
361
+
362
+ /*************************************************************************\
363
+ CardType setRules()
364
+ return the CardType object.
365
+ \*************************************************************************/
366
+ function setRules(rules) {
367
+ // Create the rules array.
368
+ if (rules.length == 0 || rules == null)
369
+ rules = "0,1,2,3,4,5,6,7,8,9";
370
+
371
+ var tmprules = rules;
372
+ n = 1;
373
+ while (tmprules.indexOf(",") != -1) {
374
+ tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
375
+ n++;
376
+ }
377
+ this.rules = new makeArray(n);
378
+ n = 0;
379
+ while (rules.indexOf(",") != -1) {
380
+ var tmpstr = rules.substring(0, rules.indexOf(","));
381
+ this.rules[n] = tmpstr;
382
+ rules = rules.substring(rules.indexOf(",") + 1, rules.length);
383
+ n++;
384
+ }
385
+ this.rules[n] = rules;
386
+ return this;
387
+ }
388
+
389
+
390
+ /*****************\
391
+ * helpers
392
+ \*****************/
393
+
394
+ function contains(a, obj) {
395
+ var i = a.length;
396
+ while (i--) {
397
+ if (a[i] === obj) {
398
+ return true;
399
+ }
400
+ }
401
+ return false;
402
+ }
403
+
404
+ /*****************\
405
+
406
+ Added
407
+
408
+ \*****************/
409
+ function getBaseCard(cardnumber, availablecards){
410
+ //for each card (except the luhncheck card (last element))
411
+ for (var i = 0; i < (Cards.size - 1); i++) {
412
+ //for each card length
413
+ for (var n = 0; n < Cards[i].len.size; n++){
414
+ if (cardnumber.toString().length <= Cards[i].len[n]) {
415
+ for (var m = 0; m < Cards[i].rules.size; m++) {
416
+ // Get the max length
417
+ var l = Cards[i].rules[m].toString().length;
418
+ // If the length of the rule is longer than the cardnumber, it is still a potential candidate
419
+ if(l>cardnumber.toString().length) {
420
+ l = cardnumber.toString().length;
421
+ }
422
+ var headdigit = cardnumber.substring(0, l);
423
+ var headruledigit = Cards[i].rules[m].toString().substring(0,l);
424
+ if (headdigit === headruledigit){
425
+ if(contains(availablecards,Cards[i].cardtype)) {
426
+ //alert("cc type: "+Cards[i].getCardType());
427
+ return Cards[i];
428
+ }
429
+ //See if the card is a MaestroCard which is a sub-brand of Mastercard
430
+ //TODO make this change generic for all card and subcards if required
431
+ if(contains(availablecards,MasterCard.cardtype)) {
432
+ if(Cards[i].cardtype === MaestroCard.cardtype){
433
+ return MasterCard;
434
+ }
435
+ }
436
+ }
437
+ }
438
+ //return null;
439
+ }
440
+ //return null;
441
+ }
442
+ }
443
+ return null;
444
+ }
445
+
446
+ function getBaseCardByType(variant){
447
+ //for each card (except the luhncheck card (last element))
448
+ for (var i = 0; i < (Cards.size - 1); i++) {
449
+ if(Cards[i].cardtype == variant) {
450
+ return Cards[i];
451
+ }
452
+ }
453
+ return null;
454
+ }
455
+
456
+