제가 이 결제 페이지를 부모에서 아래처럼 호출하고, 자식 페이지서 "결제" 버튼을 타서 version 3 결제를 탑니다.
//충전페이지 호출
Intent intent = new Intent(MyBank_ListActivity.this, MyCash_ChargeActivity.class);
intent.putExtra("fromWhere", "MyBank");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Version 2의 경우 매니페스트에
------------------------------------------------------------------------------------------
<service android:name="dungeons.BillingService" />
<receiver android:name="dungeons.BillingReceiver" >
<intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
[출처] 부분 결재 InAppBilling 리모콘 구현|작성자 바람돌이
------------------------------------------------------------------------------------------
이렇게 설정해서 리턴을 받자나요... version 3 sample 보면 이 선언 부분이 없던데 제가 놓친걸까요? 아니면 없는건가요?
결제 후 에러나는게 Receiver가 없어서 나는건가 해서요...
최신 바이너리 업로드 하고, 폰으로 직접 옮겨서 설치해서 테스트 하는 방법은 너무 시간이 걸리는데...
이거 디버깅 하면서 테스트 하는 방법은 없을까요?? 디버깅이 안되니 에러를 잡을 방법이 없네요.
public void launchPurchaseFlow(Activity act, String sku, int requestCode, OnIabPurchaseFinishedListener listener, String extraData) {
checkSetupDone("launchPurchaseFlow");
flagStartAsync("launchPurchaseFlow");
IabResult result;
try {
logDebug("Constructing buy intent for " + sku);
Bundle buyIntentBundle = mService.getBuyIntent(3, mContext.getPackageName(), sku, ITEM_TYPE_INAPP, extraData);
int response = getResponseCodeFromBundle(buyIntentBundle);
if (response != BILLING_RESPONSE_RESULT_OK) {
logError("Unable to buy item, Error response: " + getResponseDesc(response));
result = new IabResult(response, "Unable to buy item");
if (listener != null) listener.onIabPurchaseFinished(result, null);
}
PendingIntent pendingIntent = buyIntentBundle.getParcelable(RESPONSE_BUY_INTENT);
logDebug("Launching buy intent for " + sku + ". Request code: " + requestCode);
mRequestCode = requestCode;
mPurchaseListener = listener;
act.startIntentSenderForResult(pendingIntent.getIntentSender(),
requestCode, new Intent(),
Integer.valueOf(0), Integer.valueOf(0),
Integer.valueOf(0)); --> 여기서 디버깅 오류나고 멈추네요...
---> IabHelper.launchPurchaseFlow(Activity, String, int, IabHelper$OnIabPurchaseFinishedListener, String) line: 334
----
도움 좀 부탁드립니다.
아이템을 구매하였는 데 소비하지 않고, 또 같은 아이템을 구매하려 하기때문입니다.
구매 직후 consumePurchase() 를 호출해서 바로 소비하던지, 구매전 호출해서 소비해야합니다.
구매 직후 consumePurchase() 호출 예시.
onIabPurchaseFinished() 메서드에서 결제 성공 처리 부분에 consumePurchase()를 호출
public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
mHelper.mService.consumePurchase(3, 페키지네임, purchase.getToken());
}
mHelper 는 IabHelper 클래스 안에서 아래와 같이 생성되었습니다.
public static IInAppBillingService mHelper
참고
http://developer.android.com/google/play/billing/api.html#consume




item Already Owned 이 발생되면 NullPointException 으로 뒤집니다.
아주 잘 만들어놔서... 뻑뻑 뒤지게 샘플을 주더군요..
한번 구매한 상품이므로 익셉션 처리만 해 두셔도 무난합니다.