Integration with SkyFlow¶
The Skyflow module facilitates seamless integration with SkyFlow, a Data Privacy Vault service, enabling secure payment processing within Virto Commerce Platform. This integration ensures compliance with industry standards for handling payment data securely while offering a unified experience for credit card transactions.
Key features¶
- Unified Credit Card User Experience: Enhance user payment journeys with a consistent credit card transaction experience across multiple payment providers.
- PCI Compliance: Ensure PCI compliance with SkyFlow, simplifying adherence to industry standards for secure payment data handling.
- Integration with Virto Commerce Frontend Application: Seamlessly integrate with Virto Frontend Application to provide a cohesive e-commerce experience.
- Flexible Customization: Utilize the flexibility of the Virto Commerce Native Extensibility Framework and SkyFlow to tailor integrations with a variety of payment providers to meet your specific requirements.
- Optimized for Marketplaces: Streamline marketplace operations by effortlessly connecting with multiple Payment Service Providers, catering to diverse payment preferences for customers and suppliers.
- Saved Credit Card: Enhance convenience and checkout speed by offering customers the ability to securely save their credit card information for future transactions.
Prerequisites¶
- SkyFlow Account: Create and configure your SkyFlow Account to take full advantage of the module.
- Authorize.NET Account: Create and configure your Authorize.NET Account for seamless integration with the module.
- Installation: Install the SkyFlow Module to start using its powerful features and functionality.
Architecture¶
Order Placement:
- As a customer, I add items to my cart and proceed to checkout.
- On the payment selection page, I see a Credit Card option.
Credit Card Payment Form:
- I select the "Credit Card" payment method.
- The frontend displays a Credit Card form built with PCI compliance and Skyflow integration, maintaining the current design of the platform.
- I enter my Credit Card details securely into the form.
Tokenization Process:
- I submit the form, and the payment process utilizes Skyflow for PCI-compliant Credit Card storage.
- Skyflow tokenizes my Credit Card information securely.
Transaction Processing:
- The tokenized Credit Card information is seamlessly integrated with Payment processing through SkyFlow.
- The transaction is created successfully via Authorize.NET.
Payment Document Creation:
- A Payment document is automatically created within Virto Commerce Payment Processing for the Credit Card transaction.
- This Payment document includes all necessary details for tracking and processing the transaction within the Virto Commerce platform.
Saved Credit Card:
- The Skyflow-generated token for Credit Card is stored within the Virto Commerce Payment document securely.
- Virto Commerce can save the token and use later as a Saved Credit Card.
Setup¶
To integrate Skyflow with Virto Commerce for secure payment processing:
Configure Skyflow¶
Skyflow configuration includes creating:
Create roles¶
To create a role:
- Sign in to Skyflow Portal.
- Create a system role named Vault Editor for frontend operations. This role will be responsible for sending card data to Skyflow.
- When creating a connection, the second system role is automatically generated and associated with the connection.
Create Authorize.NET connectors¶
To create Authorize.NET connectors:
- Create a new connector.
- Modify Connector via RestAPI:
- If default connections are not suitable (e.g., mismatched card number format), modify the connector via RestAPI.
- Use the Update Outbound Connection endpoint to adjust the connector's configuration according to your requirements.
- Generate and save credentials file.
Configure Virto Commerce¶
Configuring Virto Commerce includes:
Configure appsettings.json¶
Configure the appsettings.json file as follows:
Node | Default or Sample Value | Description |
---|---|---|
tokenURI | The URI for obtaining authentication tokens from the Skyflow API. Can be taken from credentials.json file downloaded from Skyflow dashboard. | |
vaultURI | The URI for the Skyflow vault. Can be taken from Skyflow studio by clicking three dots on the vault and selecting View details action. | |
gatewayURI | The URI for invoking outbound connection rules. Replace vault with gateway in the vaultURI. | |
vaultId | The identifier for the Skyflow vault. | |
tableName | The table name for storing credit card data. | |
PaymentFormAccount | Service account configuration section with credentials taken from the Skyflow service account configuration in the previous steps. | |
PaymentFormAccount:clientID | The client ID for authentication with the Skyflow Payment Form account. | |
PaymentFormAccount:keyID | The key ID for authentication with the Skyflow Payment Form account. | |
PaymentFormAccount:privateKey | The private key for authentication with the Skyflow Payment Form account. | |
IntegrationsAccount | Service account configuration section with credentials taken from the Skyflow service account configuration in the previous steps. | |
IntegrationsAccount:clientID | The client ID for authentication with the Skyflow Integrations account. | |
IntegrationsAccount:keyID | The key ID for authentication with the Skyflow Integrations account. | |
IntegrationsAccount:privateKey | The private key for authentication with the Skyflow Integrations account. | |
TargetPaymentMethod | "AuthorizeNetPaymentMethod" | The payment method used for authorizing payments via Skyflow. To outbound Payment Service Provider API through the Skyflow connection, create an HttpClient instance IHttpServiceFactory.CreateClient("Skyflow") and execute the request to the Payment Service API with the tokenized card data. |
TargetConnectionRoute | The connection route for the target payment method. |
Note
To execute the outbound Payment Service Provider API through Skyflow connection, create an HttpClient instance IHttpServiceFactory.CreateClient("Skyflow") and execute the request to the Payment Service API with the tokenized card data.
See code example
public override PostProcessPaymentRequestResult PostProcessPayment(PostProcessPaymentRequest request)
{
....
if (request.Parameters["CreditCard"] != null)
{
var tokenizedCard = JsonConvert.DeserializeObject<dynamic>(request.Parameters["CreditCard"]);
creditCard = new AuthorizeNetCreditCard
{
CardCode = tokenizedCard.Cvv,
CardNumber = tokenizedCard.CardNumber,
ExpirationDate = tokenizedCard.CardExpiration,
ProxyEndpointUrl = request.Parameters["ProxyEndpointUrl"],
ProxyHttpClientName = request.Parameters["ProxyHttpClientName"]
};
using var stream = new MemoryStream();
var proxyHttpClient = _httpClientFactory.CreateClient(request.CreditCard.ProxyHttpClientName);
var xmlSerializer = new XmlSerializer(typeof(AuthorizeNetCreateTransactionRequest));
using var xmlWriter = XmlWriter.Create(stream, new XmlWriterSettings
{
Encoding = new UTF8Encoding(false, true), //Exclude BOM
Indent = true,
});
xmlSerializer.Serialize(xmlWriter, this);
using var content = new StreamContent(stream);
content.Headers.ContentType = new MediaTypeHeaderValue(MediaTypeNames.Application.Xml);
var proxyRequest = new HttpRequestMessage(HttpMethod.Post, new Uri(request.CreditCard.ProxyEndpointUrl))
{
Content = content
};
var response = proxyHttpClient.Send(proxyRequest);
}
Example
{
"Payments": {
"Skyflow": {
"tokenURI": "https://manage.skyflowapis-preview.com/v1/auth/sa/oauth/token",
"vaultURI": "https://a370a9658141.vault.skyflowapis-preview.com",
"gatewayURI": "https://a370a9658141.gateway.skyflowapis-preview.com",
"vaultId": "ff9fc275bec848318361cc8928e094d1",
"tableName": "credit_cards",
"PaymentFormAccount": {
"clientID": "j873500104e6439bbbeb8cec63a6d21",
"keyID": "a70d977de5f24532810df376585031aa",
"privateKey": "-----BEGIN PRIVATE KEY-----Base64-----END PRIVATE KEY-----"
},
"IntegrationsAccount": {
"clientID": "b47bea9c61c74cf4aac3b26d09aaf825",
"keyID": "c950c459157548f0817500288ec8ac96",
"privateKey": "-----BEGIN PRIVATE KEY-----Base64-----END PRIVATE KEY-----"
},
"TargetPaymentMethod": "AuthorizeNetPaymentMethod",
"TargetConnectionRoute": "b47bea9c61c74cf4aac3b26d09aaf825/xml/v1/request.api"
}
}
}
Setup Virto Commerce back office¶
To setup Virto Commerce back office:
- Go to Virto Commerce Back Office and click Stores in the main menu.
- In the next blade, select a store.
-
In the Store details blade, click on the Payment methods widget.
-
In the Payment methods blade, select SkyFlow.
- In the Edit payment method blade, activate the Skyflow payment method.
- In the same blade, click on the Settings widget.
-
In the next blade, fill in the following properties:
VaultId
andVaultUrl
: Retrieve from the settings in Skyflow.TableName
: Specify the name of the table for storing Credit Card data.
-
Click OK to save the changes.
The SkyFlow payment method has been activated for the Store.
Customization¶
To customize the module:
- Integrate it with Payment Providers:
- By default, the module supports Authorize.NET payment provider.
- To integrate with another provider or implement custom orchestration:
- Create a new Virto Commerce Module.
- Implement IPaymentClient interface.
- Register
IPaymentClient
inIPaymentClientFactory
.
- Use
SkyflowPaymentMethod
class for:initializePayment
(in GraphQL): Returns a token for frontend operations.authorizePayment
: InvokesIPaymentClientFactory
to obtain an instance ofIPaymentClient
for processing transactions using the required Connection.