Ir para o conteúdo

Methods that search the SDK for acquirer logos previously adjusted on the PayStore portal.


This method must be called when you want to search for the logo previously added to the Paystore portal. At the end of execution, the Logo is sent via sendResponse () , containing the logo encrypted in base64.

Métodos

Signature Description
void onHandleGetLogo(Messenger owner) Starts the process that captures the Logo coming 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 initialization themePreference.getLogo() and sends it to the encoder getBase64FromImageUrl(String uri) which converts the image to Bitmap and encrypts it to Base64.

Example

import android.os.Message;

public class MyActivity {


    //[...]

    public void onHandleGetLogo(Messenger owner) {

        setBase64ImagePaymentSettings();
        String logo = mPaymentSettings.getLogoInitialization();


        if(logo != null && !logo.isEmpty()){

            sendResponse(owner, PaymentClient.ON_SUCCESS, DataUtils.toBundleString(logo, PaymentClient.BUNDLE_LOGO));

        }else {
            this.sendErrorResponse(new ErrorData(ResponseCodes.INVALID_LOGO, null, getString(R.string.invalid_logo)), owner);
        }

    }

}

Parameters

Name Type Required Description
owner Messenger Sim Field indicating the ID that sent the message.

Example

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:
                onHandleGetLogo(msg.replyTo);
                break;

        default:
                Log.e(Constants.TAG, "Invalid request data");       
        }
    }
}

Return

Name Type Description
getLogoInitialization String Returns the Logo coming from Initialization