Class CustomSheet
java.lang.Object
com.samsung.android.sdk.samsungpay.v2.payment.sheet.CustomSheet
- All Implemented Interfaces:
android.os.Parcelable
This class provides custom payment sheet which contains various SheetControls.
- Since:
- API Level 1.3
-
Nested Class Summary
-
Field Summary
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
ConstructorDescriptionConstructor to create CustomSheet.
CustomSheet is used to contain various SheetControls. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addControl
(int location, SheetControl sheetControl) API to add SheetControl in specific location.void
addControl
(SheetControl sheetControl) API to add SheetControl.getSheetControl
(String controlId) API to get SheetControl.API to get SheetControl list.boolean
removeControl
(SheetControl sheetControl) API to remove SheetControl.boolean
updateControl
(SheetControl sheetControl) API to update SheetControl.
-
Constructor Details
-
CustomSheet
public CustomSheet()Constructor to create CustomSheet.
CustomSheet is used to contain various SheetControls.// Construct CustomSheet CustomSheet customSheet = new CustomSheet(); // Make SheetControls you want and add to CustomSheet. // Each SheetControl is located in sequence. // There must be a AmountBoxControl and it must be located on last. // Add {@link AddressControl} on custom payment sheet. customSheet.addControl(new AddressControl());
- Since:
- API Level 1.3
- See Also:
-
-
Method Details
-
addControl
API to add SheetControl.- Parameters:
sheetControl
- SheetControl to be set.
The possible values are:
AddressControl
AmountBoxControl
PlainTextControl
- Throws:
NullPointerException
- If the sheetControl is null.IllegalArgumentException
- If same ID is used in other SheetControls.IllegalArgumentException
- If there is no data in AmountBoxControl.IllegalArgumentException
-AmountBoxControl.setAmountTotal(double, String)
API method should be called when AmountBoxControl is created or updated.
If setAmountTotal() is not called, AMOUNT_TOTAL SheetItemType is not the last item in AmountBoxControl.- Since:
- API Level 1.3
-
addControl
API to add SheetControl in specific location.- Parameters:
location
- SheetControl location to be displayed on custom payment sheet.sheetControl
- SheetControl to be set.
The possible values are:
AddressControl
AmountBoxControl
PlainTextControl
- Throws:
NullPointerException
- If the sheetControl is null.IllegalArgumentException
- If there is abnormal location.IllegalArgumentException
- If same ID is used in other SheetControls.IllegalArgumentException
- If there is no data in AmountBoxControl.IllegalArgumentException
-AmountBoxControl.setAmountTotal(double, String)
API method should be called when AmountBoxControl is created or updated.
If setAmountTotal() is not called, AMOUNT_TOTAL SheetItemType is not the last item in AmountBoxControl.- Since:
- API Level 1.3
-
updateControl
API to update SheetControl.- Parameters:
sheetControl
- SheetControl to be updated.
The possible values are:
AddressControl
AmountBoxControl
PlainTextControl
- Returns:
- If successfully updated, return true. Otherwise, return false.
- Throws:
NullPointerException
- Thrown if the sheetControl is null.- Since:
- API Level 1.3
-
removeControl
API to remove SheetControl.- Parameters:
sheetControl
- SheetControl to be removed.
The possible values are:
AddressControl
AmountBoxControl
PlainTextControl
- Returns:
- If successfully deleted, return true. Otherwise, return false.
- Throws:
NullPointerException
- If the sheetControl is null.IllegalArgumentException
- If SheetControl type isSheetControl.Controltype.AMOUNTBOX
orSheetControl.Controltype.ADDRESS
.- Since:
- API Level 1.3
- See Also:
-
getSheetControl
API to get SheetControl.- Parameters:
controlId
- ID to find SheetControl.- Returns:
- SheetControl which has the controlId.
- Throws:
NullPointerException
- If the controlId is null.- Since:
- API Level 1.3
-
getSheetControls
API to get SheetControl list.- Returns:
- SheetControl list.
- Since:
- API Level 1.3
-
Samsung Electronics.
Samsung Pay SDK 2.18.00 - Aug 25 2023