WAStorePaymentEditor


Seaside-Examples-Store

Comment:

A component for editing WAStoreCreditCard instances.  When called, it presents a form for the user to choose credit card type, and enter name, number, and expiry date.  On submit, it will create and answer an instance of the appropiate credit card subclass.  Note the difference with WAStoreAddressEditor, where the form modifies the address instance directly.  Used by WAStoreTask>>getPaymentInfo.

Hierarchy:

ProtoObject
Object
WAPresenter
WAComponent
WAFormDialog
WALabelledFormDialog
WAStorePaymentEditor

Summary:

instance variables:

cardNumber cardType month name year

methods:

instance class
as yet unclassified no messages

Detail:

instance variables:

cardNumber
cardType
month
name
year

instance methods:

as yet unclassified
cardTypes

	^ WAStoreCreditCard subclasses
months

	^ (1 to: 12)
ok

	self answer:
		(cardType new
			name: name;
			number: cardNumber;
			expiry: (Date newDay: 1 monthNumber: month year: year))
renderCardNumberOn: html

	html textInputWithValue: cardNumber callback: [:v | cardNumber _ v]
renderCardTypeOn: html

	html
		selectFromList: self cardTypes
		selected: cardType
		callback: [:v | cardType _ v]
		labels: [:ea | ea abbreviation]
renderExpirationDateOn: html
 
	html selectFromList: self months selected: month callback: [:m | month _ m].
	html selectFromList: self years selected: year callback: [:y | year _ y]
renderNameOn: html

	html textInputWithValue: name callback: [:v | name _ v]
rows

	^ #(cardType name cardNumber expirationDate)
years

	^ (Date today year to: Date today year + 5)

class methods:

^top


- made by Dandelion -