public CheckoutRequest pairingId(Context context, String pairingId) { mPairingId = pairingId; clientMetadataId(PayPalOneTouchCore.getClientMetadataId(context, pairingId)); return this; }
/** * Defines the host to be used in the success url for browser switch (the package name will be * used as the scheme) */ @SuppressWarnings("unchecked") public T successUrl(String scheme, String host) { mSuccessUrl = scheme + "://" + redirectURLHostAndPath() + host; return (T) this; }
@Override public CheckoutRequest createFromParcel(Parcel source) { return new CheckoutRequest(source); } };
@Override public void trackFpti(Context context, TrackingPoint trackingPoint, Protocol protocol) { Map<String, String> fptiDataBundle = new HashMap<>(); fptiDataBundle.put("clid", getClientId()); PayPalOneTouchCore.getFptiManager(context).trackFpti(trackingPoint, getEnvironment(), fptiDataBundle, protocol); }
public static Result parseBrowserSwitchResponse(ContextInspector contextInspector, Request request, Uri uri) { Result result = request.parseBrowserResponse(contextInspector, uri); switch (result.getResultType()) { case Error: request.trackFpti(contextInspector.getContext(), TrackingPoint.Error, null); break; case Cancel: request.trackFpti(contextInspector.getContext(), TrackingPoint.Cancel, null); break; case Success: request.trackFpti(contextInspector.getContext(), TrackingPoint.Return, null); break; } return result; } }
@Override public AuthorizationRequest createFromParcel(Parcel source) { return new AuthorizationRequest(source); } };
@Override public BillingAgreementRequest createFromParcel(Parcel source) { return new BillingAgreementRequest(source); } };
private boolean isPayPalInstalled(Context context) { try { Class.forName(PayPalOneTouchCore.class.getName()); return PayPalOneTouchCore.isWalletAppInstalled(context); } catch (ClassNotFoundException | NoClassDefFoundError ignored) { return false; } } }
public BillingAgreementRequest pairingId(Context context, String pairingId) { super.pairingId(context, pairingId); return this; }
@Override public BillingAgreementRequest approvalURL(String approvalURL) { super.approvalURL(approvalURL); mTokenQueryParamKey = TOKEN_QUERY_PARAM_KEY_BA_TOKEN; return this; }
/** * @deprecated use {@link BillingAgreementRequest#pairingId(Context, String)} instead. */ @Deprecated @Override public BillingAgreementRequest pairingId(String pairingId) { return pairingId(null, pairingId); }
@Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeString(mApprovalUrl); dest.writeString(mTokenQueryParamKey); dest.writeString(mPairingId); }
/** * @deprecated Use {@link #parseBrowserResponse(Uri)} instead. */ @Deprecated @Override public Result parseBrowserResponse(ContextInspector contextInspector, Uri uri) { return parseBrowserResponse(uri); }
/** * @deprecated Use {@link #getBrowserSwitchUrl()} instead. */ @Deprecated @Override public String getBrowserSwitchUrl(Context context, OtcConfiguration config) { return getBrowserSwitchUrl(); }
/** * @deprecated Use {@link #validateV1V2Response(Bundle)}. */ @Override public boolean validateV1V2Response(ContextInspector contextInspector, Bundle extras) { return validateV1V2Response(extras); }
public static FptiManager getFptiManager(Context context) { initService(context); return sFptiManager; }
/** * @deprecated Use {@link #validateV1V2Response(Bundle)} instead. */ @Deprecated @Override public boolean validateV1V2Response(ContextInspector contextInspector, Bundle extras) { return validateV1V2Response(extras); }
/** * @deprecated use {@link CheckoutRequest#pairingId(Context, String)} instead. */ @Deprecated public CheckoutRequest pairingId(String pairingId) { return pairingId(null, pairingId); }
@Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeString(mPrivacyUrl); dest.writeString(mUserAgreementUrl); dest.writeSerializable(mScopes); dest.writeSerializable(mAdditionalPayloadAttributes); dest.writeString(mMsgGuid); dest.writeInt(mEncryptionKey.length); dest.writeByteArray(mEncryptionKey); }
/** * Defines the host to be used in the cancellation url for browser switch (the package name will * be used as the scheme) */ @SuppressWarnings("unchecked") public T cancelUrl(String scheme, String host) { mCancelUrl = scheme + "://" + redirectURLHostAndPath() + host; return (T) this; }