Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. CreditCard card = await Navigator.of(context)
  2. .push(MaterialPageRoute(builder: (_) => AddCardPage()));
  3. if(card != null){
  4. var token = await StripePayment.createTokenWithCard(card);
  5. print(token.tokenId);
  6. String url = await ApiRepository.instance.stripeAddCard(token: token.tokenId);
  7. }
  8. else{
  9. print('wrong card data');
  10. }
  11. // if (presenter.isNeedRegistration) {
  12. // if (Platform.isIOS)
  13. // launcher.launch(presenter.registrationUrl);
  14. // else
  15. // launch(presenter.registrationUrl,
  16. // option: CustomTabsOption(
  17. // showPageTitle: false,
  18. // enableUrlBarHiding: true,
  19. // enableInstantApps: false));
  20. // } else {
  21. // String addCardUrl = await ApiRepository.instance.addCard();
  22. // if (Platform.isIOS)
  23. // launcher.launch(addCardUrl);
  24. // else
  25. // await launch(addCardUrl,
  26. // option: CustomTabsOption(
  27. // showPageTitle: false,
  28. // enableUrlBarHiding: true,
  29. // enableInstantApps: false));
  30. // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement