Last active
August 29, 2015 14:13
-
-
Save IanSaunders/6940ec15bdb0eafec93d to your computer and use it in GitHub Desktop.
capture card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StripeToken token = new StripeToken(); | |
token.setCardDetailsID("card details id"); | |
token.setStripeCustomerID("stripe customer id"); | |
if(token_.getAccountID() == null) { | |
Account account = new Account(); | |
account.getProfile().setFirstName("First Name"); | |
account = Account.create(account); | |
token_.setAccountID(account.getID()); | |
} | |
token = StripeToken.create(token_); | |
PaymentMethod paymentMethod = new PaymentMethod(); | |
paymentMethod.setLinkID(token.getID()); | |
paymentMethod.setName("Name"); | |
paymentMethod.setAccountID(token.getAccountID()); | |
paymentMethod.setDescription("Stripe (...)"); | |
paymentMethod.setExpiryDate("YY/MM"); //Month with leading 0 | |
paymentMethod.setGateway(PaymentGateway.stripe); | |
PaymentMethod.create(paymentMethod) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment