Guest User

Untitled

a guest
Feb 27th, 2020
184
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  12. // if (presenter.isNeedRegistration) { // deleteStart
  13. // if (Platform.isIOS)
  14. // launcher.launch(presenter.registrationUrl);
  15. // else
  16. // launch(presenter.registrationUrl,
  17. // option: CustomTabsOption(
  18. // showPageTitle: false,
  19. // enableUrlBarHiding: true,
  20. // enableInstantApps: false));
  21. // } else {
  22. // String addCardUrl = await ApiRepository.instance.addCard(); //deleteEnd
  23.  
  24. // if (Platform.isIOS) //start
  25. // launcher.launch(addCardUrl);
  26. // else
  27. // await launch(addCardUrl,
  28. // option: CustomTabsOption(
  29. // showPageTitle: false,
  30. // enableUrlBarHiding: true,
  31. // enableInstantApps: false));
  32. // } //end
RAW Paste Data