Methods that search the SDK for the logo of the acquirer’s receipt previously set in the PayStore portal.¶
This method must be called when you want to search for the logo of the receipt previously added to the Paystore portal, at the end of the execution the Logo is sent via sendResponse() , containing the logo encrypted in base64.
Methods¶
| Subscription | Description |
|---|---|
void onHandleGetReceiptLogo(Messenger owner) |
Starts the process of capturing the Logo from the SDK. |
Warning
The setBase64ImagePaymentSettings() and getBase64FromImageUrl(String uri) methods must be called , before calling any Logo capture method, the setBase64ImagePaymentSettings() method receives the Logo object from the initialization themePreference. getLogo() and sends it to the encoder getBase64FromImageUrl(String uri) which converts the image to Bitmap and encrypts it in Base64.
Example¶
import android.os.Message;
public class MyActivity {
//[...]
public void onHandleGetReceiptLogo(Messenger owner){
setBase64ImagePaymentSettings();
String receiptLogo = mPaymentSettings.getReceiptLogoInitialization();
if(receiptLogo != null && !receiptLogo.isEmpty()){
sendResponse(owner, PaymentClient.ON_SUCCESS, DataUtils.toBundleString(receiptLogo, PaymentClient.BUNDLE_RECEIPT_LOGO));
} else {
this.sendErrorResponse(new ErrorData(ResponseCodes.INVALID_RECEIPT_LOGO, null, getString(R.string.invalid_logo)), owner);
}
}
}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
owner |
Messenger |
Yes | Field indicating the ID that sent the message. |
Exemplo¶
import android.os.Message;
public class MyActivity {
//[...]
protected void onMessageReceived(Message msg) {
messagesToReply.incrementAndGet();
Log.d(TAG, String.format("onMessageReceived: %d, isBusy: %b, messagesToReply: %d", msg.what, mStateMonitor.isBusy(), messagesToReply.get()));
mOwner = msg.replyTo;
messageType = msg.what;
switch (msg.what) {
case PaymentClient.LOGO:
onHandleGetReceiptLogo(msg.replyTo);
break;
default:
Log.e(Constants.TAG, "Invalid request data");
}
}
}
Return¶
| Name | Type | Description |
|---|---|---|
getReceiptLogoInitialization |
String |
Returns the Logo from Initialization |