@Test public void createSourceSynchronous_withAlipaySingleUseParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams alipayParams = SourceParams.createAlipaySingleUseParams( 1000L, "usd", "Example Payer", "abc@def.com", "stripe://start"); try { Source alipaySource = stripe.createSourceSynchronous(alipayParams, FUNCTIONAL_SOURCE_PUBLISHABLE_KEY); assertNotNull(alipaySource); assertNotNull(alipaySource.getId()); assertNotNull(alipaySource.getClientSecret()); assertNotNull(alipaySource.getAmount()); assertEquals(1000L, alipaySource.getAmount().longValue()); assertEquals(Source.ALIPAY, alipaySource.getType()); assertEquals("redirect", alipaySource.getFlow()); assertNotNull(alipaySource.getOwner()); assertEquals("Example Payer", alipaySource.getOwner().getName()); assertEquals("abc@def.com", alipaySource.getOwner().getEmail()); assertEquals("usd", alipaySource.getCurrency()); assertEquals(Source.SINGLE_USE, alipaySource.getUsage()); assertNotNull(alipaySource.getRedirect()); assertEquals("stripe://start", alipaySource.getRedirect().getReturnUrl()); } catch (StripeException stripeEx) { fail("Unexpected error: " + stripeEx.getLocalizedMessage()); } }
assertNotNull(sofortSource.getSourceTypeData()); assertNull(sofortSource.getSourceTypeModel()); assertEquals(70000L, sofortSource.getAmount().longValue()); assertNotNull(sofortSource.getRedirect()); assertEquals("example://return", sofortSource.getRedirect().getReturnUrl());
assertNotNull(idealSource.getClientSecret()); assertNotNull(idealSource.getId()); assertEquals(5500L, idealSource.getAmount().longValue()); assertEquals(Source.IDEAL, idealSource.getType()); assertEquals("eur", idealSource.getCurrency());
assertNotNull(idealSource.getClientSecret()); assertNotNull(idealSource.getId()); assertEquals(5500L, idealSource.getAmount().longValue()); assertEquals(Source.IDEAL, idealSource.getType()); assertEquals("eur", idealSource.getCurrency());
stripe.createSourceSynchronous(threeDParams, FUNCTIONAL_SOURCE_PUBLISHABLE_KEY); assertNotNull(threeDSource); assertEquals(50000L, threeDSource.getAmount().longValue()); assertEquals("brl", threeDSource.getCurrency()); assertNotNull(threeDSource.getClientSecret());
assertNotNull(bancontactSource.getClientSecret()); assertEquals(Source.BANCONTACT, bancontactSource.getType()); assertEquals(1000L, bancontactSource.getAmount().longValue()); assertNotNull(bancontactSource.getSourceTypeData()); assertNull(bancontactSource.getSourceTypeModel());
assertNotNull(idealSource.getClientSecret()); assertNotNull(idealSource.getId()); assertEquals(5500L, idealSource.getAmount().longValue()); assertEquals(Source.IDEAL, idealSource.getType()); assertEquals("eur", idealSource.getCurrency());
assertNotNull(giropaySource.getId()); assertEquals("eur", giropaySource.getCurrency()); assertEquals(2000L, giropaySource.getAmount().longValue()); assertEquals(Source.GIROPAY, giropaySource.getType()); assertNotNull(giropaySource.getSourceTypeData());