Theme Customization¶
Through the PayStore Portal, it is possible to customize the theme of the Payment application, however this is also possible via programming.
Methods¶
| Signature | Description |
|---|---|
void setTheme(String theme, PaymentCallback paymentCallback) |
Defines a theme for the Payments application. |
setTheme()¶
This method must be called to set a default color theme for screenshots in the Payments application.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
theme |
String |
Yes | Name of the theme to be defined (case-sensitive). |
callback |
PaymentCallback |
Yes | Interface that will run for success or error notifications. |
Parameter detail
theme
RedTheme PinkTheme PurpleTheme DeepPurpleTheme IndigoTheme BlueTheme LightBlueTheme CyanTheme TealTheme GreenTheme LightGreenTheme LimeTheme YellowTheme AmberTheme OrangeTheme DeepOrangeTheme BrownTheme GreyTheme BlueGreyTheme
callback
| Name | Type | Required | Description |
|---|---|---|---|
onSuccess |
Method for notification on success | ||
onError |
Method for notification in case of error. | ||
ErrorData.paymentsResponseCode |
String |
Yes | Response code for the error that occurred. See Response Codes |
ErrorData.responseMessage |
String |
Yes | Descriptive message of the cause of the error. |
Example¶
public class MyActivity extends Activity implements PaymentClient.PaymentCallback {
private PaymentClient paymentClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment);
paymentClient = new PaymentClientImpl();
}
@Override
protected void onResume() {
super.onResume();
paymentClient.bind(this);
}
@Override
protected void onDestroy() {
try {
paymentClient.unbind(this);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
super.onDestroy();
}
public void doExecute(){
ApplicationInfo appInfo = new ApplciationInfo();
appInfo.setCredentials(new Credentials("demo-app", "TOKEN-KEY-DEMO"));
appInfo.setSoftwareVersion("1.0.0.0");
try {
paymentClient.setTheme("GreyTheme", this);
} catch (ClientException e) {
Log.e(TAG, "Error setting theme", e);
}
}
@Override
public void onError(Object data) {
Log.e(TAG, "Error: " + errorData.getResponseMessage());
}
@Override
public void onSuccess(Object data) {
Log.i(TAG, "Success!");
}
}