PGW Initialization

The Payment Options API is for retrieve merchant details, transaction details and enabled payment options based on merchant account’s configuration.

Below are steps to retrieve payment options.

Step 1 : Construct System Initialization Request

Step 2 : Retrieve System Initialization Response

Full Sample Code

 

📘

API Method

PGW SDK API Interface

🚧

References

SDK Payment Classes
SDK Payment Enums

 

 

Step 1 : Construct System Initialization Request

Below code show how to construct system initialization request.

📘

Request API Parameter

Please refer: System Initialization Request API Parameter

SystemInitializationRequest systemInitializationRequest = new SystemInitializationRequest();
SystemInitializationRequest *systemInitializationRequest = [[SystemInitializationRequest alloc] init];
let systemInitializationRequest: SystemInitializationRequest = SystemInitializationRequest()

 

Step 2 :Retrieve System Initialization Response

Below code show how to retrieve system initialization response.

📘

Response API Parameter

Please refer: System Initialization Response API Parameter

PGWSDK.getInstance().systemInitialization(systemInitializationRequest, new APIResponseCallback<SystemInitializationResponse>() {
 
     @Override
     public void onResponse(SystemInitializationResponse response) {
         if(response.getResponseCode().equals(APIResponseCode.APISuccess)) {
             //Read system initialization response. 
         } else {
             //Get error response and display error.
         }
     }
 
     @Override
     public void onFailure(Throwable error) {
         //Get error response and display error.
     }
});
[[PGWSDK shared] systemInitializationWithSystemInitializationRequest: systemInitializationRequest response: ^(SystemInitializationResponse * _Nonnull response) {      
     if([response.responseCode isEqualToString: APIResponseCode.APISuccess]) {
          //Read system initialization response.
     } else {
         //Get error response and display error.
     }
} failure: ^(NSError * _Nonnull error) {  
     //Get error response and display error.
}];
PGWSDK.shared.systemInitialization(systemInitializationRequest: systemInitializationRequest, { (response: SystemInitializationResponse) in
     if response.responseCode == APIResponseCode.APISuccess {
          //Read system initialization response.
     } else {
          //Get error response and display error.
     }
}) { (error: NSError) in
     //Get error response and display error.
}

 

Full Sample Code

Full Sample Code Show below.

//Step 1: Construct system initialization request.
SystemInitializationRequest systemInitializationRequest = new SystemInitializationRequest();
 
//Step 2: Retrieve system initialization response.
PGWSDK.getInstance().systemInitialization(systemInitializationRequest, new APIResponseCallback<SystemInitializationResponse>() {
 
     @Override
     public void onResponse(SystemInitializationResponse response) { 
         if(response.getResponseCode().equals(APIResponseCode.APISuccess)) {
             //Read system initialization response. 
         } else {
             //Get error response and display error.
         }
     }
 
     @Override
     public void onFailure(Throwable error) {
         //Get error response and display error.
     }
});
//Step 1: Construct payment option request.
SystemInitializationRequest *systemInitializationRequest = [[SystemInitializationRequest alloc] init];
     
//Step 2: Retrieve system initialization response.
[[PGWSDK shared] systemInitializationWithSystemInitializationRequest: systemInitializationRequest response: ^(SystemInitializationResponse * _Nonnull response) {    
     if([response.responseCode isEqualToString: APIResponseCode.APISuccess]) {
          //Read system initialization response.
     } else {
         //Get error response and display error.
     }
} failure: ^(NSError * _Nonnull error) { 
     //Get error response and display error.
}];
//Step 1: Construct system initialization request.
let systemInitializationRequest: SystemInitializationRequest = SystemInitializationRequest()
         
//Step 2: Retrieve system initialization response.
PGWSDK.shared.systemInitialization(systemInitializationRequest: systemInitializationRequest, { (response: SystemInitializationResponse) in
     if response.responseCode == APIResponseCode.APISuccess {
          //Read system initialization response.
     } else {
          //Get error response and display error.
     }
}) { (error: NSError) in
     //Get error response and display error.
}