Skip to content

gamedreamerSinglePay method ​

  • Optional. Calling this method will pull up the google payment page.

Method ​

java
public static void gamedreamerSinglePay(Context context, HashMap<String, String> map, GamedreamerPayListener gamedreamerPayListener)

Parameters ​

ParameterDescription
contextContext object
mapthe map need to pass a parameter: the key of the parameter is GDValues.PROITEMID, the value is stored item’s Special ID.
gamedreamerPayListenerPayment listener

Callback Description ​

GamedreamerPayListener.onPayResult() callback method description:

  • When isSuccess is true, it means payment is successful, the value of point is the number of points to pay for success. When isSuccess is false, the payment fails, and the point is 0.
  • Attention must not be returned by the client as the result of the user's payment. It should be based on the server's received payment notification or the results returned by the query API.

Example Code ​

java
HashMap<String,String> map=new HashMap<String,String>();
map.put(GDValues.PRO_ITEM_ID, "LD1");
GDSDK.gamedreamerSinglePay(this, map, new GamedreamerPayListener() {
	@Override
	public void onPayResult(boolean isSuccess, int point) {	
		// payment successful
		if(isSuccess) {

		}
		// Payment failed
		else {
		}
	}
});