Programming Guide Nov 9, 2017

Samsung In-App Purchase (IAP) allows third-party applications to use the Samsung payment service to offer items for sale inside your app. IAP provides the service as an Android package to ensure independence between applications. IAP needs to communicate with your IAP-integrated applications using the Android Interface Definition Language (AIDL).

This method has numerous advantages but requires specialized skills in Android to manage several processes, including linking the IAP service, linking Samsung accounts, and running the IAP package validity test.

To link conveniently with IAP, a separate Helper class is provided. The following picture depicts the linking process between a third-party application and IAP via the IAP Helper class.

public class PurchaseActivity extends Activity implements OnPaymentListener
{
    private IapHelper    mIapHelper  = null;
    
    ...
    
    protected void onCreate( Bundle savedInstanceState )
    {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main );
        
        mIapHelper = IapHelper.getInstance( this );
		mIapHelper.setOperationMode( OPERATION_MODE_PRODUCTION );
    }
    
    public void doPurchase( View _view )
    {
		// The passThroughParam should be a generated value by you.
        mIapHelper.startPayment(ITEM_ID, "pLKjLKjLJL87=76df56rf+4f5", true, this );
    }
    
    @Override
    public void onPayment( ErrorVo _errorVo, PurchaseVo _purchaseVo )
    {
        // Success or failure of payment is processed here.
    }
...
}
Note

In order to link to In-App Purchase, the com.samsung.android.iap.permission.BILLING privilege is required in IAP Version 5. Modified privilege to AndroidManifest.xml as follows:

<uses-permission android:name=" com.samsung.android.iap.permission.BILLING"/>
<uses-permission android:name="android.permission.INTERNET"/>

See the attached pdf file for more information.