The Blockchain Platform SDK supports the simple payment UI with cryptocurrency. This simple payment UI feature is embedded in the SDK and doesn’t need any other information on UI components. It supports Ethereum and Tron. See each section for detailed information.
Ethereum
It supports to send Ethereum, ERC20, and ERC721. There are three options for the transaction fee: faster, normal, and slower. It's estimated value is based on the Big Data analysis of the proxy node of Samsung. Take note that it is not estimated in real time.
ETH
Deprecated:
createEthereumPaymentSheetActivityIntent() without EthereumTransactionType parameter API has been deprecated in 1.2.00.
Use createEthereumPaymentSheetActivityIntent(Context, HardwareWallet, EthereumTransactionType, EthereumAccount, String, BigInteger, String, BigInteger) instead.
createEthereumPaymentSheetActivityIntent creates an Intent instance for the Ethereum payment sheet activity. Optionally, you can use data and nonce parameters. If you want to get the txid for results, you should call startActivityForResult(Intent intent, int requestCode) instead of the startActivity(Intent intent). This API can be blocked with the AvailabilityException by the SDK’s Availability smart contract in case of critical issue or Ethereum’s own problem.
Note :
The unit of value is wei.
Note :
SDK supports Legacy and EIP-1559 types of transaction.
createTokenPaymentSheetActivityIntent() without EthereumTransactionType parameter API has been deprecated in 1.2.00.
Use createTokenPaymentSheetActivityIntent(Context, HardwareWallet, EthereumTransactionType, EthereumAccount, String, String, BigInteger, BigInteger) instead.
createTokenPaymentSheetActivityIntent creates an Intent instance for the ERC20 token payment sheet activity. Optionally, you can use the data and nonce parameters. If you want to get the txid for results, you should call the startActivityForResult(Intent intent, int requestCode) instead of the startActivity(Intent intent). It does require the token’s contract address for payment. This API can be blocked with the AvailabilityException by the SDK’s Availability smart contract in case of critical issue or Ethereum’s own problem.
createNftPaymentSheetActivityIntent and createSafeNftPaymentSheetActivityIntent creates an Intent instance for the ERC721 token payment sheet activity. Optionally, you can use the data and nonce parameters. If you want to get the txid for result, you should call the startActivityForResult(Intent intent, int requestCode) instead of the startActivity(Intent intent). It requires the token’s contract address and tokenId for payment. This API can be blocked with the AvailabilityException by SDK’s Availability smart contract in case of critical issue or Ethereum’s own problem.
createTronPaymentSheetActivityIntent creates an Intent instance for the Tron payment sheet activity. If you want to get the txid for results, you should call startActivityForResult(Intent intent, int requestCode) instead of the startActivity(Intent intent). This API can be blocked with the AvailabilityException by the SDK’s Availability smart contract in case of critical issue or Tron’s own problem.
createTrc10PaymentSheetActivityIntent creates an Intent instance for the TRC10 token payment sheet activity. If you want to get the txid for results, you should call the startActivityForResult(Intent intent, int requestCode) instead of the startActivity(Intent intent). It does require the token id for payment. This API can be blocked with the AvailabilityException by the SDK’s Availability smart contract in case of critical issue or Tron’s own problem.
Intent intent = tronService
.createTrc10PaymentSheetActivityIntent(
context,
connectedWallet,
trc10Account,
toAddress,
"1002000", // token id
new BigInteger("1000")
);
startActivityForResult(intent, 0);
TRC20
createTrc20PaymentSheetActivityIntent creates an Intent instance for the TRC20 token payment sheet activity. If you want to get the txid for results, you should call the startActivityForResult(Intent intent, int requestCode) instead of the startActivity(Intent intent). It does require the token’s contract address for payment. This API can be blocked with the AvailabilityException by the SDK’s Availability smart contract in case of critical issue or Tron’s own problem.
After completing a payment, you can get the txid and coin type from onActivityResult(int requestCode, int resultCode, Intent data). You can get the txid in the received Intent parameter with the txid key. You can get the coin type in the received Intent parameter with the coinType key.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0) {
switch (resultCode) {
case Activity.RESULT_OK:
Log.d(TAG, "txid : " + data.getStringExtra("txid"));
Log.d(TAG, "coinType: " + data.getStringExtra("coinType"));
break;
case Activity.RESULT_CANCELED:
Log.d(TAG, "user canceled");
break;
}
}
}
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.