Card provider service
Card provider service API exposes CardProvider interface which defines the following basic card account operations:
Dworkin provides out of box two absolutely different types of implementation for this interface:
First – using external Card Processor services allowing to issue and handle scheme virtual/plastic cards using external API.
Second option – is own e-wallet solution allowing customers to operate electronic funds hosted locally at your server.
All types of implementations are located in card-provider-service-impl module.
GlobalProcessingCardProvider class is an example of external card supplier model. It uses JAX-WS integration with processor system which is wrapped in Java 8 CompletableFuture objects. Card holder data(CHD) information is not stored in Dworkin DB. System stores and uses only card tokens returning from external Card API after card creation in order to perform all card related operations.
WalletCardProvider class is responsible for Dworkin own e-wallet implementation and based completely on local Dworkin payment transaction model for card load/unload and transfer financial operations. Transactions are done through Dworkin operation-processor-service
Dworkin framework exposes card API through card provider service descriptor located at CardProviderService interface for API. Implementation part is located in CardProviderServiceImpl
System supports simultaneous usage though Dworkin card provider service API of different types of card accounts from different card processors as well as own e-wallet account. Customers can have several card and wallet accounts and transfer funds between them.
The only requirements is to define proper request header in Lagom ServiceCall invocation for all card-provider-service API methods. For fund transfer operation it requires to define two header “card-provider-from” and “card-provider-to” with provider name value for both cardFrom and cardTo account:
Proper card provider vendor type value can be found in Card entity in cardProviderVendorType enumeration field.
For all other card operations it requires to define only one header value with name “card-provider” for source card account: