아이템 구매

Namespace: Matrix.Component
Assembly: MatrixGames (in MatrixGames.dll)

void BuyItem( 
string itemTypeID
Callback<BuyItemResponse> cb 
)
This language is not supported or no code example is available.

Parameters

itemTypeID

Type: string

구매할 아이템 타입 ID.

cb

Type: Callback<BuyItemResponse>

Callback function

Return Value

  • On Successful -

    cb.result: 0.

    cb.cause: "OK"

    cb.response: Response Data BuyItemResponse

  • On Error -

    cb.result: 0가 아닌 integer 값

    cb.cause: 상세 에러 메세지

아이템 구매 Method.

gem/coin으로 아이템을 구매함

	
  using UnityEngine;
  using System;
  using System.Collections;
  using System.Collections.Generic;
  using Matrix;
 
  static void onPaymentBuyItemTest(Matrix.CallbackInfo<Matrix.Domain.Payment.BuyItemResponse> info)
  {
      Debug.Log("onPaymentBuyItemTest Called");
      Debug.Log("result: " + info.result);
 
      if (info.result == 0)
      {
          string message = info.response.StructToJson();
 
          Debug.Log(message);
      }
  }
 
  static void PaymentBuyItemTest()
  {
      IMatrix API = MatrixManager.Instance;
      Debug.Log("[PaymentBuyItemTest]");
 
      API.Payment.BuyItem("CO1", onPaymentBuyItemTest);
  }
 					

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0