TransfersmileTransfersmile
  • EN
  • PT
  • ES
  • EN
  • PT
  • ES
  • Introduction
  • Payin API
    • Environments
    • Direct integration
      • Brazil
        • Credit Card
        • Pix
        • Lottery
        • Boleto
        • Deposit Express
        • Wallet
    • Notification
      • Security
    • Payin Detail
    • Refund
    • Plug-in & Tools
      • transfersmile JavaScript
      • transfersmile SDK
      • Get CreditCard Token
      • Supported Bank List Query
      • Installment Detail Query
    • Data
      • Payment Method
      • Data for test (Sandbox)
      • Payin Status
      • Icon of methods
    • API Code
  • Payout API
    • Environments
    • Security
    • Submit a payout
      • transfersmile Wallet
        • WebView Example
        • H5 Authorization
        • Native App Authorization
        • Send Prizes
      • Brazil
        • Pix
        • BankTransfer
    • Notification
    • Payout DryRun
    • Account Balance
    • Payout Status
    • Payout List
    • Payout Detail
    • Payment Method
    • Data for test
    • Bank Code
      • Bank in Brazil
    • API Code

Native App Authorization

Native application get user authorization

1. Provide the authorization link to users.

The authorization link is concatenated with Basic URL+ source

Parameter

ExplainationExample value
sourcea string which can recognize the merchant

Tip

Don't put # sign in the URL

Test environment

Basic URL

https://sandbox-wallet.transfersmile.com/authenticationYS?

Example:

https://sandbox-wallet.transfersmile.com/authenticationYS?source=transfersmile

Live environment

Basic URL

https://wallet.transfersmile.com/authenticationYS?

Example:

https://wallet.transfersmile.com/authenticationYS?source=transfersmile

Users will be redirected to this page to authorize.

2. Users authorize and the merchant gets UUID. Then the merchant needs Interactive development through android and js, then callback with web view.

3. Within web view callback, the merchant needs to link user ID with UUID of transfersmile wallet. Then the authorization page can be closed.

android:

String url = "https://wallet.transfersmile.com/authenticationYS?source="+merchant_app;

webView.loadUrl(url);

//add js monitor so html can call the app
webView.addJavascriptInterface(this, "PWA");
webView.setWebChromeClient(webChromeClient);
webView.setWebViewClient(webViewClient);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.setWebContentsDebuggingEnabled(true);
webSettings.setSupportMultipleWindows(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);//allow popup window
webSettings.setSupportMultipleWindows(true);
webSettings.setDomStorageEnabled(true);
webSettings.setDatabaseEnabled(true);
webSettings.setAllowFileAccess(true);
webSettings.setBlockNetworkLoads(false); //whether get the resource from network

/**
* LOAD_CACHE_ONLY: only read local data from cache
* LOAD_DEFAULT: (default)according to cache-control, decide whether get data from network
* LOAD_NO_CACHE: Only get data from network without using cache
* LOAD_CACHE_ELSE_NETWORK,use data from cache whatever if expired, whatever there is cache or not
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
//support screen zoom
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
//hide webview zoom button
webSettings.setDisplayZoomControls(false);
webSettings.setUseWideViewPort(true); //adjust photo size to fit webview
webSettings.setLoadWithOverviewMode(true); // zoom size to fit screen

@JavascriptInterface
public void bindSuc(String uuid) {
    Log.i(TAG, "bindSuc: uuid = "+uuid);
    //bound logic code {}
    finish();
}


OC:
[self.webView.userContentController addScriptMessageHandler:self name:@"bindSuc"];

Prev
H5 Authorization
Next
Send Prizes