@Test(expected = ActivityNotFoundException.class) public void createIntentWithInvalidPointOfSaleThrows() { chargeActivities.clear(); installApp("com.squareup", 2, INVALID_SIGNATURE); client.createChargeIntent(new ChargeRequest.Builder(1_00, CurrencyCode.USD).build()); }
@NonNull @Override public Intent createChargeIntent(@NonNull ChargeRequest chargeRequest) { nonNull(chargeRequest, "chargeRequest"); List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); return createPinnedChargeIntent(chargeRequest, pointOfSalePackage); }
RealPosClient implements PosClient { @NonNull @Override public Intent createChargeIntent(@NonNull ChargeRequest chargeRequest) { nonNull(chargeRequest, "chargeRequest"); List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); return createPinnedChargeIntent(chargeRequest, pointOfSalePackage); } }
RealPosClient implements PosClient { @NonNull @Override public Intent createChargeIntent(@NonNull ChargeRequest chargeRequest) { nonNull(chargeRequest, "chargeRequest"); List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); return createPinnedChargeIntent(chargeRequest, pointOfSalePackage); } RealPosClient(Context context, String clientId); }
RealPosClient implements PosClient { @NonNull @Override public Intent createChargeIntent(@NonNull ChargeRequest chargeRequest) { nonNull(chargeRequest, "chargeRequest"); List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); return createPinnedChargeIntent(chargeRequest, pointOfSalePackage); } RealPosClient(Context context, String clientId); @NonNull @Override Intent createChargeIntent(@NonNull ChargeRequest chargeRequest); @Override boolean isPointOfSaleInstalled(); @Override void launchPointOfSale(); @Override void openPointOfSalePlayStoreListing(); @NonNull @Override ChargeRequest.Success parseChargeSuccess(@NonNull Intent data); @NonNull @Override ChargeRequest.Error parseChargeError(@NonNull Intent data); }
RealPosClient implements PosClient { @NonNull @Override public Intent createChargeIntent(@NonNull ChargeRequest chargeRequest) { nonNull(chargeRequest, "chargeRequest"); List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); return createPinnedChargeIntent(chargeRequest, pointOfSalePackage); } RealPosClient(Context context, String clientId); @NonNull @Override Intent createChargeIntent(@NonNull ChargeRequest chargeRequest); @Override boolean isPointOfSaleInstalled(); @Override void launchPointOfSale(); @Override void openPointOfSalePlayStoreListing(); @NonNull @Override ChargeRequest.Success parseChargeSuccess(@NonNull Intent data); @NonNull @Override ChargeRequest.Error parseChargeError(@NonNull Intent data);  }