Last active
September 23, 2016 18:56
-
-
Save philmadden83/c4aed9813cd1f2095f13122b7db86513 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@POST | |
@Path("/paymentmethods") | |
public Response (String paymentNonce, String email) throws RequestException { | |
Account account = userService.getAccount(email); | |
PaymentAccount paymentAccount = paymentService.verifyPaymentMethod(request); | |
return Response.ok(paymentAccount.getExternalId()).build; | |
} | |
public PaymentAccount storeCreditCard(String paymentNonce, Account account) throws ClientException { | |
try{ | |
PaymentAccount paymentAccount = paymentProcessingService.storePaymentAccount(request.getPaymentNonce(), account, false, true ); | |
creditCardService.insertOrUpdateLastUsedStickyCreditCard(paymentAccount.getCreditCard()); | |
return paymentAccount; | |
} catch(PaymentProcessingException ppx){ | |
throw new ClientException((ErrorCode.PAYMENT_ACCOUNT_VALIDATION_PROBLEM, ppx.getErrorMessages())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment