@Override public SKErrorCode getErrorCode() { SKErrorCode code = null; try { code = SKErrorCode.valueOf(getCode()); } catch (IllegalArgumentException e) { // ignore } return code; } /*<methods>*/
public static /*<name>*/SKErrorCode/*</name>*/ valueOf(long n) { for (/*<name>*/SKErrorCode/*</name>*/ v : values()) { if (v.n == n) { return v; } } throw new IllegalArgumentException("No constant with value " + n + " found in " + /*<name>*/SKErrorCode/*</name>*/.class.getName()); } }
@Override public void restoreCompletedTransactionsFailed (SKPaymentQueue queue, NSError error) { // Restoration failed. // Decide if user cancelled or transaction failed. if (error.getCode() == SKErrorCode.PaymentCancelled.value()) { log(LOGTYPEERROR, "Restoring of transactions was cancelled by user!"); observer.handleRestoreError(new RuntimeException("Restoring of purchases was cancelled by user!")); } else { log(LOGTYPEERROR, "Restoring of transactions failed: " + error.toString()); observer.handleRestoreError(new RuntimeException("Restoring of purchases failed: " + error.toString())); } } }
observer.handlePurchaseError(new RuntimeException("Transaction failed: " + transaction)); else if (error.getCode() == SKErrorCode.PaymentCancelled.value()) { log(LOGTYPEERROR, "Transaction was cancelled by user!"); observer.handlePurchaseCanceled();
public static /*<name>*/SKErrorCode/*</name>*/ valueOf(long n) { for (/*<name>*/SKErrorCode/*</name>*/ v : values()) { if (v.n == n) { return v; } } throw new IllegalArgumentException("No constant with value " + n + " found in " + /*<name>*/SKErrorCode/*</name>*/.class.getName()); } }
@Override public SKErrorCode getErrorCode() { SKErrorCode code = null; try { code = SKErrorCode.valueOf(getCode()); } catch (IllegalArgumentException e) { // ignore } return code; } /*<methods>*/
public static /*<name>*/SKErrorCode/*</name>*/ valueOf(long n) { for (/*<name>*/SKErrorCode/*</name>*/ v : values()) { if (v.n == n) { return v; } } throw new IllegalArgumentException("No constant with value " + n + " found in " + /*<name>*/SKErrorCode/*</name>*/.class.getName()); } }
@Override public SKErrorCode getErrorCode() { SKErrorCode code = null; try { code = SKErrorCode.valueOf(getCode()); } catch (IllegalArgumentException e) { // ignore } return code; } /*<methods>*/