Skip to content

IOTPaySDK/IOTPay-android

Repository files navigation

IOTPay-Android

IOTPay sdk for Android

IOTPay-Android is a sdk called in merchant app to collect consumer's credit/debit card information.
For the whole business picture please refer the '2.3 Event Flow and Options'

1 Embed a credit entry GUI into a ViewGroup to collect consumer’s credit/debit card information:
card number, holder name, expiry date, CVV/CVC
2 provide add card, payment methods alt text

Step 1: Install


(1) copy IOTPayAndroidCredit-release.aar to app/libs
(2) add followings in app/build.gradle

repositories {
	flatDir {
		dirs 'libs'
   	}
}


dependencies {
   ...
	compile(name:'IOTPayAndroidCredit-release',ext:'aar')
   ...
}

Step 2: Setup View

Embed IOTPay credit entry GUI into a ViewGroup in your app.

IOTCardInfoView IOTCardInfoView(ViewGroup viewGroup, int creditCardStyle)
  • creditCardStyle:

Triple Lines:

   (int)IOTPayConstants.TripleLine.label

alt text

Single Line:

   (int)IOTPayConstants.SingleLine.label

alt text

  • Example:
 IOTCardInfoView iotCardInfoView;
 ...
 iotCardInfoView = IOTPayService.IOTCardInfoView(myViewGroup,(int)IOTPayConstants.TripleLine.label);

Step 3: Send the Request

pay or add card

IOTPayService.sendRequest(String secureId, Object layoutType, IOTCardInfoView creditForm,IOTPayCallback iotPayCallback);
  • layoutType:
  IOTPayConfig.SimplePurchase 
  IOTPayConfig.AddCard
  • Example:

(2.1) pay:

Make sure secureID for payment has been retrieved from context
About the secureID please refer the '4 Temporary secureID'

 try{
IOTPayService.sendRequest(secureId,IOTPayConfig.SimplePurchase, iotCardInfoView,new IOTPayCallback(){
        public void onResultIOTPay(String result) {
            //please process result in your own way, Ex: as following;
	    /*
	     if retCode == FAIL
	       go to failure page with retMsg,
	         Ex: order payment failed, reason: ....., please retry....
	     else if  retCode == SUCCESS
	        check retData.status
		  if status in(2,3)
		    go to success page,
		      Ex: Order payment successfull....
		  else
		     means order status is unknow, go to Order status Unknow page, and involve in 
		     the support team for order final result.
		       Ex: Order is processing, please call (xxx)xxx xxx for order[xxxxxxxxx] payment result.
	    */
        }
      });
  }catch (Exception e){
      //showMsg("Error:" + e.getMessage());
  }

(2.2) Add card: binding the card to a consumer

Make sure secureID for payment has been retrieved from context
About the secureID please refer the '4 Temporary secureID'

  try{
IOTPayService.sendRequest(secureId,IOTPayConfig.AddCard,iotCardInfoView,new IOTPayCallback(){
        public void onResultIOTPay(String result) {
          //please process result in your own way, ex: showMsg("Payment Result:" + result);
        }
      });
   }catch (Exception e){
       //showMsg("Error:" + e.getMessage());
  }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages