Initialize PGW SDK

Initialize the PGW SDK in your application.

Merchants must initialize the 2C2P PGW SDK in their mobile apps before performing any payment transactions. To do so, refer to the sample code below.

import com.ccpp.pgw.sdk.android.builder.PGWSDKParamsBuilder;
import com.ccpp.pgw.sdk.android.core.PGWSDK;
import com.ccpp.pgw.sdk.android.enums.APIEnvironment;
import com.ccpp.pgw.sdk.android.model.core.PGWSDKParams;
 
public class CustomApplication extends Application {
 
    @Override
    public void onCreate() {
        super.onCreate();
 
        PGWSDKParams pgwsdkParams = new PGWSDKParamsBuilder(this, APIEnvironment.Production)
                                    .build();
 
        PGWSDK.initialize(pgwsdkParams);
    }
}
@import PGW;
 
@implementation AppDelegate
      
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
           
        PGWSDKParams *pgwsdkParams = [[[PGWSDKParamsBuilder alloc] initWithApiEnvironment: APIEnvironmentProduction]
                                                                                           build];
     
        [PGWSDK initializeWithParams: pgwsdkParams];
     
        return YES;
    }
@end
import PGW
 
class AppDelegate: UIResponder, UIApplicationDelegate {
     
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
     
        let pgwsdkParams: PGWSDKParams = PGWSDKParamsBuilder(apiEnvironment: APIEnvironment.Production)
                                        .build()
 
        PGWSDK.initialize(params: pgwsdkParams)
    }
}

📘

The 2C2P PGW SDK should be initialized using the Application / AppDelegate class

 

Next : Handle PGW Payment Authentication
Understand client callbacks for handling PGW payment authentication.