### Redirect URL Example Source: https://docs.solapayments.com/products/paymentsite An example of a redirect URL used to return transaction response parameters to the merchant's system. This URL includes various parameters indicating the transaction's status and details. ```URL https://www.cardknox.com/?xCurrency=USD&xDate=6%2F29%2F2020%204%3A26%3A47%20PM&xResult=A&xStatus=Approved&xErrorCode=00000&xAuthCode=09379A&xAuthAmount=1.03&xRefNum=341260411&xToken=0p3q5479g1g3h2p34g5763008044gg0p&xBatch=5128197&xMID=xxxxxxxxxx9999&xTID=xxxxx6789&xAvsResult=Address%3A%20No%20Match%20&5-Digit_Zip%3A_No_Match&xAvsResultCode=NNN&xCvvResult=No%20CVV%20data%20available&xMaskedCardNumber=4xxxxxxxxxxx1111&xName=t%20test&xExp=0620&xCardType=Visa&xEntryMethod=Keyed&xCustom10=Payment%20Site ``` -------------------------------- ### Recurring Line Item Example (SolaPayments) Source: https://docs.solapayments.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request Demonstrates how to create a line item for a recurring payment of $20 per month, starting today and lasting for one year. This example utilizes JavaScript and specifies payment timing, start and end dates, and interval details. ```javascript const startDate = new Date(); const endDate = new Date(startDate.getFullYear()+1, startDate.getMonth(), startDate.getDate()); lineItem = { "label": "Subscription", "amount": "20.00", "type": "final", "paymentTiming": "recurring", "recurringPaymentStartDate": startDate, "recurringPaymentIntervalUnit": "month", "recurringPaymentIntervalCount": 1, "recurringPaymentEndDate": endDate, } ``` -------------------------------- ### Initialize Cardknox SDK Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Configure the Cardknox SDK with essential keys and software details. This setup is crucial before initiating any payment transactions. ```Objective-C [CardknoxSDK setPrincipalKey:@"Your xKey"]; [CardknoxSDK setxSoftwareName:@"Your app name" xSoftwareVersion:@"1.0.0" xVersion:@"4.5.9"]; ``` -------------------------------- ### Start Bluetooth Scanning (Swift) Source: https://docs.solapayments.com/sdk/ios-sdk This snippet shows how to initiate a Bluetooth device scanning process using the Solapayments SDK. It involves calling a specific function to start the scan, after which the SDK will notify subscribers about newly discovered devices and when the scan is completed. ```Swift import Foundation // Assuming SolaPaymentsSDK is the SDK's main class // and it has methods for Bluetooth operations. // Example: Start scanning for Bluetooth devices SolaPaymentsSDK.shared.startScanning() { // Callback for when scanning starts (optional) print("Bluetooth scanning started.") } // To connect to a scanned device, you would typically use the device information // received from the 'ScannedDeviceNotification' or 'ScanCompletedNotification'. // Example (conceptual, assuming you have device data): // SolaPaymentsSDK.shared.connectToDevice(deviceInfo) { // result in // switch result { // case .success(let connectionId): // print("Successfully connected to device: \(connectionId)") // case .failure(let error): // print("Failed to connect to device: \(error)") // } // } // To stop scanning: // SolaPaymentsSDK.shared.stopScanning() { // print("Bluetooth scanning stopped.") // } ``` -------------------------------- ### BBPOS Integration Source: https://docs.solapayments.com/articles/card-present-integration-guide Facilitates card present payments using BBPOS with Sola-supported devices. This integration works on Windows and Mac, but Mac installation can be complex and requires the BBPOS application to be running. ```Shell # Ensure BBPOS application is installed and running # Refer to Cardknox documentation for specific setup and usage. ``` -------------------------------- ### Get Shipping Methods Callback Example Source: https://docs.solapayments.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request This JavaScript callback function, `onGetShippingMethods`, returns an array of available shipping methods. Each method includes a label, amount, identifier, and a detail description, providing options for users to select their preferred shipping. ```javascript onGetShippingMethods: function() { return [ { label: 'Free Shipping', amount: '0.00', identifier: 'free', detail: 'Delivers in five business days', }, { label: 'Express Shipping', amount: '5.00', identifier: 'express', detail: 'Delivers in two business days', }, ]; } ``` -------------------------------- ### Shipping Method Example (SolaPayments) Source: https://docs.solapayments.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request Provides an example of a shipping method object, including its label, amount, detail, and identifier. This JSON structure is used to define shipping options for transactions. ```json { "label": "Free Shipping", "amount": "0.00", "detail": "Arrives in 7 to 10 business days", "identifier": "free" } ``` -------------------------------- ### ClickToPayResponse Object Example Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-response An example of the ClickToPayResponse object, which includes transaction status, amount, merchant identifiers, and a nested payload containing payment details. ```JSON { "status": "success", "amount": 6, "merchantRequestId": "Merchant defined request ID", "merchantOrderId": "Merchant defined order ID", "payload": { "transactionId": "1947120568389887601", "externalClientId": "test123", "encryptionKey": "Pqdjv842Nv...8q14l", "token": "FPA6TTy0q457.....tCf+tqH5/ruIQ1Iz4FI9hE5NBD+EM=" } } ``` -------------------------------- ### Sola App Transaction Deep Link Example Source: https://docs.solapayments.com/products/deep-linking An example of a deep link URL used to initiate a transaction with the Sola app. It includes required parameters such as amount, API key, redirect URL, and command. ```url dck://app.cardknox.com/transaction?xAmount=1.0&xKey=CardknoxSupport_Test&xRedirectURL=https://www.test.com/&xCommand=cc:sale ``` -------------------------------- ### Download Sola iOS SDK Sample Apps Source: https://docs.solapayments.com/sdk/ios-sdk Download sample applications demonstrating Sola iOS SDK integration with different UI frameworks. ```Swift Swift with SwiftUI app: https://tstcdn.cardknox.com/dl/mobile/CardknoxPaymentsSDK-SampleApp-Swift-SwiftUI.zip ``` ```Swift Swift with Storyboard app: https://tstcdn.cardknox.com/dl/mobile/CardknoxPaymentsSDK-SampleApp-Swift-Storyboard.zip ``` ```Objective C Objective C with Storyboard app: https://tstcdn.cardknox.com/dl/mobile/CardknoxPaymentsSDK-SampleApp-Objc.zip ``` -------------------------------- ### Transaction Result Schema - Response Example Source: https://docs.solapayments.com/products/cloudim-developer-guide Provides an example of the response when retrieving transaction details, including reference number, type, amount, status, approval code, and date. ```json { "xRefNum": "X123456789", "xTransactionType": "cc:sale", "xAmount": 100.00, "xStatus": "approved", "xApprovalCode": "123456", "xDate": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### Server-Side API Integration for Click-To-Pay Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup Demonstrates how to integrate Click-To-Pay with the Sola API on the server-side using C#. This involves creating a server endpoint to receive the Click-To-Pay payload and making a POST request to the Sola gateway with specific headers and parameters, including transaction details and payment commands. ```csharp public async Task Authorize(clickToPayResponse resp) { var reqGateway = new { xKey = "Your xKey", xDigitalWalletType = "ClickToPay", xAmount = (decimal)resp.amount, xClickToPayTransactionId = resp.payload.transactionId, xClickToPayExternalClientId = resp.payload.externalClientId, xClickToPayEncryptionKey = resp.payload.encryptionKey, xCardNum = resp.payload.token, xCommand = "cc:sale", xVersion = "4.5.8", xSoftwareName= "Your Software Name", xSoftwareVersion = "Your Software Version" }; var respMsg = ""; using (var http = new HttpClient()) { var resp = await http.PostAsJsonAsync("https://x1.cardknox.com/gatewayJSON", reqGateway); respMsg = await resp.Content.ReadAsStringAsync(); ..... } ..... } ``` -------------------------------- ### Configure Cardknox SDK Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Configure the Cardknox SDK with essential details like xKey, software name, software version, and gateway version. This is the initial setup step for using the SDK. ```Swift CardknoxSDK.setPrincipalKey("Your xKey value"); CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9"); ``` -------------------------------- ### RMH EBTCB Tender Type Setup Source: https://docs.solapayments.com/plugins/rmh-retail-management-hero This section details the configuration steps for setting up 'EBTCB' as a tender type in RMH for EBT Cash Benefit transactions. It includes creating a new tender type with specific descriptions and tender codes if it doesn't already exist. ```RMH Configuration Description: "EBT Cash Benefit" Tender Code: EBTCB Tender type: "Debit Card" ``` -------------------------------- ### HTML Container for Click-To-Pay Button Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup This HTML snippet provides the container element where the Click-To-Pay button will be rendered. It's a simple div with a specific ID. ```html
``` -------------------------------- ### JavaScript Request Object for Click-To-Pay Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup This JavaScript object defines the structure for Click-To-Pay requests. It includes a `paymentPrefill` method to set transaction details like currency, order ID, and calculates the total amount. It also includes a `paymentCallback` and `setPayload` method to handle the response payload. ```javascript const click2payRequest = { paymentPrefill: function(){ const result = { merchantRequestId: "Merchant defined request ID", currencyCode: "USD", description: "...corp Product", orderId: "Merchant defined order ID", promoCode: "Merchant defined promo code", subtotal: roundTo(getAmount(), 2), shippingHandling: "2.00", tax: "2.00", discount: "1.00", giftWrap: "2.00", misc: "1.00", setTotal: function() { this.total = roundTo( roundToNumber(this.subtotal, 2) + roundToNumber(this.shippingHandling, 2) + roundToNumber(this.tax, 2) + roundToNumber(this.giftWrap, 2) + roundToNumber(this.misc, 2) - roundToNumber(this.discount, 2) , 2); delete this.setTotal; return this; }, }.setTotal(); logDebug({ label: "paymentPrefill", data: result }); return result; }, paymentCallback: function (payload) { click2payRequest.setPayload(payload); }, setPayload: function (value) { document.getElementById('c2p-payload').value = JSON.stringify(value, null, 2); showHide("divC2PPayload", value); } } ``` -------------------------------- ### RMH EBTFS Tender Type Setup Source: https://docs.solapayments.com/plugins/rmh-retail-management-hero This section details the configuration steps for setting up 'EBTFS' as a tender type in RMH for EBT Food Stamp transactions. It includes creating a new tender type with specific descriptions and tender codes if it doesn't already exist. ```RMH Configuration Description: "EBT Food Stamp" Tender Code: `EBTFS` Tender type: "Food Stamp" ``` -------------------------------- ### Error Response Schema - Example Source: https://docs.solapayments.com/products/cloudim-developer-guide Illustrates the structure of an error response from the API, including an error code, reference number, and result indicator. ```json { "xError": "dynamic error code", "xRefnum": "cim123456", "xResult": "E" } ``` -------------------------------- ### Enable Click-To-Pay Client-Side Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup Enables the Click-To-Pay functionality on the client-side using JavaScript. It requires initialization parameters such as the environment (sandbox or production), an external client ID, a container element ID, and callback functions for payment prefill and success events. ```javascript ckClick2Pay.enableClickToPay({ environment: c2pEnvironment.sandbox, externalClientId: "", click2payContainer: "click2payContainer", onPaymentPrefill: click2payRequest.paymentPrefill, onPaymentSuccess: click2payRequest.paymentCallback }); ``` -------------------------------- ### RMH EBT Balance Custom Button Configuration Source: https://docs.solapayments.com/plugins/rmh-retail-management-hero This snippet outlines the setup for a custom POS button in RMH to check the balance of EBT (Electronic Benefit Transfer) cards. It specifies the button's style, caption, and the internal command to execute for retrieving the EBT balance. ```RMH Configuration Style: Internal Command Caption: EBT Balance Command: CustomActionCommand ebtBalance_0586D912-FC34-401B-A55E-0B977C7F47B0 ``` -------------------------------- ### SwiftUI: Initialize and Configure Cardknox SDK Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Demonstrates how to initialize and configure the Cardknox SDK in a SwiftUI application. This includes setting the principal key and software details. The SDK object is created and stored as a state variable. ```Swift CardknoxSDK.setPrincipalKey("Your xKey value"); CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9"); ``` ```Swift func viewDidAppear() { // Example of a "view appear" method in a SwiftUI View // Store the object instance as a @State in the View for later use let cardknoxSDKDirect = CardknoxSDKDirect.create() as? CardknoxSDKDirect; } ``` -------------------------------- ### SolaPayments Sale Request Payload Example Source: https://docs.solapayments.com/api/transaction/credit-card This is a detailed example of a request payload for a credit card sale transaction via the SolaPayments API. It includes various fields for transaction details, customer information, billing and shipping addresses, item details, and specific transaction types like hotel or installment payments. ```json { "xCardNum": "4444333322221111", "xExp": "1030", "xKey": "[xkeycredentials]", "xVersion": "4.5.9", "xSoftwareName": "YourSoftwareName", "xSoftwareVersion": "1.0.0", "xCommand": "cc:sale", "xAmount": "35.00", "xToken": "61h72mmh68phn9q233634ph3g54p1499m69qhp4816pn528h84", "xCustom01": "Register01", "xCVV": "123", "xStreet": "123 Main Street", "xZip": "12345", "xMagstripe": "%B4444333322221111^TEST CARD/VISA^4912101123456789?;4444333322221111=4912101123456789?", "xName": "John Doe", "xDUPKT": "Example", "xDigitalWalletType": "Google Pay", "xTax": "2.00", "xTip": "2.00", "xInvoice": "123456A", "xPONum": "123456B", "xComments": "This is a comment", "xDescription": "This is a description", "xIP": "1.2.3.4", "xEmail": "text@example.com", "xFax": "1234567890", "xBillFirstName": "John", "xBillMiddleName": "Max", "xBillLastName": "Doe", "xBillCompany": "Acme", "xBillStreet": "123 Any Street", "xBillStreet2": "Apt 4b", "xBillCity": "Anytown", "xBillState": "NY", "xBillZip": "12345", "xBillCountry": "USA", "xBillPhone": "8005551212", "xBillMobile": "8005551111", "xShipFirstName": "John", "xShipMiddleName": "Max", "xShipLastName": "Doe", "xShipCompany": "Acme", "xShipStreet": "123 Any Street", "xShipStreet2": "Apt 4b", "xShipCity": "Anytown", "xShipState": "NY", "xShipZip": "11111", "xShipCountry": "USA", "xShipPhone": "8005551212", "xShipMobile": "8005551111", "x1Description": "Wireless Bluetooth Speaker", "x1Sku": "12345", "x1Qty": "5", "x1UnitPrice": "49.99", "xHotelCheckInDate": "7/1/2024", "xHotelCheckOutDate": "7/10/2024", "xHotelChargeType": "Direct", "xHotelRoomRate": "159.99", "xHotelNoShow": "TRUE", "xAllowPartialAuth": "TRUE", "xAllowNonAuthenticated": "FALSE", "xRxAmount": "1.50", "xDentalAmount": "1.50", "xVisionAmount": "1.50", "xTransitAmount": "1.50", "xCopayAmount": "1.50", "xClinicalAmount": "1.50", "xOrderID": "12356", "xExistingCustomer": "TRUE", "xAllowDuplicate": "TRUE", "xCustReceipt": "TRUE", "xCurrency": "USD", "xTimeoutSeconds": "10", "xVendorId": "12345", "xInstallments": "5" } ``` -------------------------------- ### Add iFields.js Reference (HTML) Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup This snippet shows how to add the iFields.js file to your payment page's HTML, typically placed after the tag, to enable Click-To-Pay functionality. ```html ``` -------------------------------- ### SolaPayments Completed Transaction Status Response Source: https://docs.solapayments.com/products/cloudim-developer-guide Example response for a completed and approved SolaPayments transaction, including session status, gateway reference, and transaction result. ```JSON { "xSessionStatus": "COMPLETED", "xGatewayRefnum": "10204219792", "xGatewayStatus": "Approved", "xTransactionResult": {}, "xRefnum": "cim111008282", "xResult": "S" } ``` -------------------------------- ### Button Options Example Source: https://docs.solapayments.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request Demonstrates how to configure the appearance and behavior of a payment button. This includes specifying the container for the button, its color, and the type of action it represents (e.g., 'buy' or 'donate'). ```javascript buttonOptions: { buttonContainer: "ap-container", buttonColor: APButtonColor.black, buttonType: APButtonType.pay } ``` -------------------------------- ### Deeplink URL for Sola Payments Transaction Response Source: https://docs.solapayments.com/products/tap-to-pay-android Example of a deeplink URL representing a transaction response from Sola Payments, indicating the status and any error messages. ```URL mechant://pos.merchant.com?xResult=D&xStatus=Declined&xError=Invalid%20Chip&xRefNum=102304545&xErrorCode=2034 ``` -------------------------------- ### SwiftUI: Register SDK Initialization in View Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Shows how to register the SDK initialization method within the body of a SwiftUI View using the `.onAppear` modifier. This ensures the SDK is ready when the view appears. ```Swift struct InScopeView : View { var body: { // Using NavigationView as a View example NavigationView{} .onAppear(perform: viewDidAppear) } } ``` -------------------------------- ### Device Schema - Response Example Source: https://docs.solapayments.com/products/cloudim-developer-guide Illustrates the response structure after a device is registered, including its unique ID, serial number, make, friendly name, and connection status. ```json { "xDeviceId": "12345", "xDeviceSerialNumber": "SN987654321", "xDeviceMake": "PAX", "xDeviceFriendlyName": "POS-Terminal-01", "xStatus": "CONNECTED" } ``` -------------------------------- ### Initialize and Manage CardknoxSDKUI (Swift) Source: https://docs.solapayments.com/sdk/ios-sdk This Swift code demonstrates how to initialize and manage the CardknoxSDKUI instance within a SwiftUI view. It sets up the principal key and software information on appear and destroys the UI instance on disappear to manage resources effectively. ```swift import SwiftUI struct MyView: View { @State private var cardknoxUI : CardknoxSDKUI!; var body: some View{ Label(title: {Text("Hello world")}, icon: {}) .onAppear(perform:onAppearFunc) .onDisappear(perform:onDisappear) } func onAppearFunc(){ CardknoxSDK.setPrincipalKey("Your xKey") CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9") cardknoxUI = CardknoxSDKUI.create() as! CardknoxSDKUI; } func onDisappear(){ if(cardknoxUI != nil){ cardknoxUI.destroy(); } cardknoxUI = nil; } } ``` -------------------------------- ### Session Schema - Response Example Source: https://docs.solapayments.com/products/cloudim-developer-guide Shows the response after initiating a session, containing the session ID, device ID, transaction details, status, response code, and reference number. ```json { "xSessionId": "abc123", "xDeviceId": "12345", "xTransactionType": "cc:sale", "xAmount": 100.00, "xStatus": "IN_PROGRESS", "xResponseCode": "00", "xRefNum": "X123456789" } ``` -------------------------------- ### Set Up and Process cc:sale Transaction Parameters Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Demonstrates setting up transaction parameters for a 'cc:sale' command, including amount, invoice number, and billing information. It then creates a request object, validates it, and initiates the transaction if valid. ```Objective C // Define if a 'keyed' screen is available CardknoxSDKUI.EnableKeyedEntry = true; // Define if a 'swipe' screen is available CardknoxSDKUI.EnableDeviceInsertSwipeTap = true; // Define if the UI should auto close CardknoxSDKUI.CloseSDKUIOnProcessedTransaction = true; TransactionParameters *prms = [[TransactionParameters alloc] init]; prms.xCommand = @"cc:sale"; prms.xAmount = 1.23; prms.xInvoice = @"123456"; prms.xBillFirstName = @"Billing first name"; PaymentTransactionRequestUI *request = [cardknoxSDKUI createRequestWithParameters:prms]; if(request.IsValid) { // Show the Cardknox UI [request process]; } else { // Request could not be processed due to these errors NSArray* errors = request.ValidationErrors; } ``` -------------------------------- ### Angular: Get Token from iField Source: https://docs.solapayments.com/products/ifields/ifields-angular Demonstrates how to obtain a token using the `getToken` method of the AngularIfieldsComponent. This involves initializing the component, calling `getToken`, and potentially using other methods like `focusIfield` and `clearIfield`. ```typescript @ViewChild('card') cardIfield?: AngularIfieldsComponent; this.cardIfield.focusIfield(); this.cardIfield.clearIfield(); this.cardIfield.getToken(); ``` -------------------------------- ### Google Pay Test Transaction Setup Source: https://docs.solapayments.com/mobile-wallets/google-pay-hosted-checkout/google-pay-faq Instructions for setting up and running test transactions with Google Pay. This involves configuring the Google Pay wallet with a real card, setting the environment to 'test' during initialization, and coordinating with Sola support. Test transactions use a simulated Visa card and do not charge the user's real card. ```JavaScript googlePayInstance.init({ environment: GPEnvironment.test }); ``` -------------------------------- ### Configure Cardknox SDK in Swift Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Configures the Cardknox SDK with essential details like the xKey, software name, software version, and Cardknox Gateway version. This is a prerequisite for initiating any transactions. ```Swift CardknoxSDK.setPrincipalKey("Your xKey value"); CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9") ``` -------------------------------- ### Enable Magento Sola Plugin Module Source: https://docs.solapayments.com/plugins/magento-plugin Commands to enable the Sola plugin module in Magento, upgrade the setup, compile dependency injection, and deploy static content. These commands are essential for activating the plugin after installation. ```Bash php bin/magento module:enable CardknoxDevelopment_Cardknox --clear-static-content php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy ``` -------------------------------- ### Configure Cardknox SDK with API Key and App Info Source: https://docs.solapayments.com/sdk/ios-sdk/workflow This snippet shows how to initialize the Cardknox SDK with your unique xKey, application name, and version information. This is a prerequisite for making any transaction requests. ```Swift CardknoxSDK.setPrincipalKey("Your xKey value"); CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9") ``` -------------------------------- ### Server-Side Request Example for Sola Payments Source: https://docs.solapayments.com/products/tap-to-pay-android A JSON object representing a server-side request to Sola Payments. It includes essential parameters for processing a transaction, such as API key, amount, and EMV data. ```JSON { "xKey": "dxxxcaxaxfxxfxxxxxxdxxcxcxfaax", "xCommand": "cc:sale", "xVersion": "4.5.9", "xSoftwareVersion": "1.0.12", "xAmount": "1.08", "xSoftwareName": "My Application ", "xEMVdata": "AAABBgAAABgAAAAAAAABHgAAAIYAAAEeAQAAAAH_htzImhOJfEQlhxhrJsYZttThXPsWFZgUTYwxmjxPBLLhkxwPcVZACZGDIntDDasmtAxxBWxxn_eAxlUbNxxAxxWtR", "xSerialNumber": "alN4n4-_92UPrgVI", "xMobileTapType": "TapToPhoneApp" } ``` -------------------------------- ### Deeplink URL for Sola Payments Transaction Source: https://docs.solapayments.com/products/tap-to-pay-android Example of a deeplink URL used to initiate a transaction with Sola Payments. It includes parameters like redirect URL, API key, amount, and command. ```URL cardknox://tap.cardknox.com/transaction?xRedirectURL=mechant://pos.merchant.com/&xKey=XXXXXW23243HHDFJ&xEmail=test@merchant.com&xAmount=12.00&xTip=1.0&xCommand=cc:sale&debug=True&useSTG=True&xAllowPartialAuth=true ``` -------------------------------- ### Create and Manage CardknoxSDKDirect Object (Swift) Source: https://docs.solapayments.com/sdk/ios-sdk Demonstrates how to create an instance of CardknoxSDKDirect, set SDK configurations, and manage its lifecycle using onAppear and onDisappear callbacks in SwiftUI. ```Swift import SwiftUI struct MyView: View { @State private var cardknoxDirect : CardknoxSDKDirect!; var body: some View{ Label(title: {Text("Hello world")}, icon: {}) .onAppear(perform:onAppearFunc) .onDisappear(perform:onDisappear) } func onAppearFunc(){ CardknoxSDK.setPrincipalKey("Your xKey") CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9") cardknoxDirect = CardknoxSDKDirect.create() as! CardknoxSDKDirect; } func onDisappear(){ if(cardknoxDirect != nil){ cardknoxDirect.destroy(); } cardknoxDirect = nil; } } ``` -------------------------------- ### Poll SolaPayments Session Status (GET /v1/Session/{xSessionId}) Source: https://docs.solapayments.com/products/cloudim-developer-guide Polls the SolaPayments API to retrieve the status of an ongoing transaction using the session ID. The response indicates the transaction status, such as COMPLETED or APPROVED. ```JSON GET Authorization: API Key ``` -------------------------------- ### Configure Cardknox SDK with xKey and Software Details Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Configures the Cardknox SDK with essential details including the xKey, application name, application version, and Cardknox Gateway version. This is a prerequisite for initiating any transactions. ```Objective C [CardknoxSDK setPrincipalKey:@"Your xKey"]; [CardknoxSDK setxSoftwareName:@"Your app name" xSoftwareVersion:@"1.0.0" xVersion:@"4.5.9"]; ``` -------------------------------- ### Cloud IM Integration Source: https://docs.solapayments.com/articles/card-present-integration-guide Enables API-driven card present payments with specific PAX devices (A77, A35, A80, A920, A920 Pro). This method requires no installation but supports a limited range of devices and features. ```API // Example API call for Cloud IM // POST /v1/transactions // Headers: {"Authorization": "Bearer YOUR_API_KEY"} // Body: {"device_id": "PAX_A77", "amount": 1000, "currency": "USD"} // Refer to CloudIM Developer Guide for detailed API specifications. ``` -------------------------------- ### Configure Solapayments SDK in Swift Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Configure the Cardknox SDK with your xKey, software name, software version, and the Cardknox Gateway version. This is a prerequisite for making any SDK calls. ```Swift CardknoxSDK.setPrincipalKey("Your xKey value"); CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9"); ``` -------------------------------- ### Integrate Sola iOS SDK (Swift) Source: https://docs.solapayments.com/sdk/ios-sdk Download and integrate the Swift framework for the Sola iOS SDK into your Xcode project. Refer to the technical documentation for detailed integration steps. ```Swift Download Swift SDK framework: https://tstcdn.cardknox.com/dl/mobile/CardknoxPaymentsSDK-Swift.zip Refer to technical documentation for integration: https://docs.cardknox.com/sdk/ios-sdk ``` -------------------------------- ### Verify CloudIM Device Status Source: https://docs.solapayments.com/products/cloudim-developer-guide This snippet shows how to check the connection status of a CloudIM enabled device. It uses a GET request to the /v1/Device/{xDeviceId} endpoint, requiring the device ID and an API key for authentication. The response indicates if the device is CONNECTED or DISCONNECTED. ```json GET Authorization: API Key ``` -------------------------------- ### Attempt to Display Welcome Screen on Verifone Devices Source: https://docs.solapayments.com/sdk/payment-engine-sdk Attempts to display the welcome screen on supported Verifone devices and returns a boolean indicating success. ```C# Device_TryShowWelcomeScreen(); ``` -------------------------------- ### RMH Custom POS Button for Gift Card Balance Source: https://docs.solapayments.com/plugins/rmh-retail-management-hero This snippet details the configuration for a custom POS button in RMH to check the balance of a gift card. It includes the button's style, caption, and the specific internal command to retrieve the gift card balance. ```RMH Configuration Style: Internal Command Caption: Gift Balance Command: CustomActionCommand "giftcardgetbalancee62227dd-ee9b-41b0-8390-161226f95436" ``` -------------------------------- ### Get Transaction Info Callback Example Source: https://docs.solapayments.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-objects-reference-request This JavaScript callback function, `getTransactionInfo`, calculates and returns line items and the total amount for a transaction. It handles tax amounts, shipping methods, and credit card fees, with error handling for robustness. It also includes an `onGetTransactionInfo` wrapper for direct invocation. ```javascript taxAmt: null, shippingMethod: null, creditType: null, getTransactionInfo: function (taxAmt, shippingMethod, creditType) { try { this.shippingMethod = shippingMethod || this.shippingMethod || { "label": "Free Shipping", "amount": "0.00", "type": "final" }; this.taxAmt = roundToNumber(taxAmt, 4) || this.taxAmt || 0.07; this.creditType = creditType || this.creditType; const amt = getAmount(); const lineItems = [ { "label": "Subtotal", "type": "final", "amount": amt }, this.shippingMethod ]; if (this.creditType === "credit") { lineItems.push({ "label": "Credit Card Fee", "amount": roundTo(0.0275*amt, 2), "type": "final" }); } lineItems.push({ "label": "Estimated Tax", "amount": roundTo(this.taxAmt*amt, 2), "type": "final" }); let totalAmt = 0; lineItems.forEach((item) => { totalAmt += parseFloat(item.amount)||0; }); totalAmt = roundTo(totalAmt, 2); return { 'lineItems': lineItems, total: { type: 'final', label: 'Total', amount: totalAmt, } }; } catch (err) { console.error("getTransactionInfo error ", exMsg(err)); if (isDebugEnv) { alert("getTransactionInfo error: "+exMsg(err)); } } }, onGetTransactionInfo: function () { try { return this.getTransactionInfo(); } catch (err) { console.error("onGetTransactionInfo error ", exMsg(err)); if (isDebugEnv) { alert("onGetTransactionInfo error: "+exMsg(err)); } } } ``` -------------------------------- ### HTML Container for Apple Pay Button Source: https://docs.solapayments.com/mobile-wallets/apple-pay-hosted-checkout/apple-pay-hosted-checkout-initial-setup This snippet provides the HTML structure required to host the Apple Pay button. It includes a simple div element with a specific ID that will be targeted by JavaScript to render the button. ```html
``` -------------------------------- ### RMH Custom POS Button for Settings Source: https://docs.solapayments.com/plugins/rmh-retail-management-hero This snippet defines how to create a custom button within RMH's POS Manager for accessing settings management. It specifies the button's style, caption, and the internal command to execute, which is used to change the stored xKey or modify settings. ```RMH Configuration Style : Internal Command Caption : Settings Command: CustomActionCommand "paymentenginemanager65b4fe30-6fa4-4e71-af5b-71c9c1a07802" ``` -------------------------------- ### Display Welcome Screen on Verifone Devices Source: https://docs.solapayments.com/sdk/payment-engine-sdk Displays the welcome screen on supported Verifone devices. An exception is thrown if the device does not support this feature. ```C# Device_ShowWelcomeScreen(); ``` -------------------------------- ### Invoke Deep Link URL for Tap to Pay (Android Java) Source: https://docs.solapayments.com/products/tap-to-pay-android This code snippet demonstrates how to invoke the Tap to Pay Helper application using a Deep Link URL in Android. It shows how to parse the URL, create an ACTION_VIEW Intent, set the data, and start the activity. Ensure 'deepLinkUrl' is a string variable containing the complete deep link. ```java Uri myAction = Uri.parse(deepLinkUrl); // deepLinkUrl must be a string variable holding the deep link URL with all required parameters. Intent intent = new Intent (Intent.ACTION_VIEW); intent.setData (myAction); startActivity(intent); ``` -------------------------------- ### Initialize CardknoxSDKDirect Source: https://docs.solapayments.com/sdk/android-sdk Shows the basic initialization of the CardknoxSDKDirect object, which is the entry point for processing payments directly. ```Java CardknoxSDKDirect cardknoxSDKDirect = CardknoxSDKDirect.create(); ``` -------------------------------- ### Payment Engine .NET SDK Integration Source: https://docs.solapayments.com/articles/card-present-integration-guide Integrates card present payments using the Payment Engine .NET SDK with Sola-supported devices. This method is compatible only with Windows operating systems. ```.NET // Example usage of Payment Engine .NET SDK // Requires Cardknox Payment Engine library // Refer to Cardknox documentation for specific implementation details. ``` -------------------------------- ### Start Bluetooth Scanning (Swift) Source: https://docs.solapayments.com/sdk/ios-sdk Starts the process of scanning for nearby Bluetooth devices. The scanning can be configured to never time out by setting the timeout value to 0 or a negative number. A card reader event will be raised upon starting the scan, indicating that the user may need to physically interact with the device. ```Swift customUI.startScanning(withTimeout: 0); ``` -------------------------------- ### Cancel Transaction Source: https://docs.solapayments.com/sdk/ios-sdk Attempts to cancel an already started transaction between the application and the card reader. If no transactions are started when this function is called, the function does not perform any action. ```Objective-C [customUI cancelTransaction]; ``` -------------------------------- ### JavaScript AJAX Call for Payment Success Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-initial-setup This JavaScript code demonstrates how to make an AJAX POST request to your server when a Click-To-Pay payment is successful. It sends the payment payload to a specified endpoint and handles the response or errors. ```javascript onPaymentSuccess: function(clickToPayResponse) { return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest(); xhr.open("POST", "https:///"); xhr.onload = function () { if (this.status >= 200 && this.status < 300) { resolve(xhr.response); } else { reject({ status: this.status, statusText: xhr.statusText }); } }; xhr.onerror = function () { reject({ status: this.status, statusText: xhr.statusText }); }; xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(JSON.stringify(clickToPayResponse)); }); } ``` -------------------------------- ### Configure Cardknox SDK Source: https://docs.solapayments.com/sdk/ios-sdk/workflow Configure the Cardknox SDK with your xKey, software name, software version, and Cardknox Gateway version. This is a prerequisite for using the SDK's functionalities. ```Swift CardknoxSDK.setPrincipalKey("Your xKey value"); CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "1.0.0", xVersion: "4.5.9"); ``` -------------------------------- ### Cancel Transaction Source: https://docs.solapayments.com/sdk/ios-sdk Attempts to cancel an already started transaction between the application and the card reader. If no transactions are started when this function is called, the function does not perform any action. ```Swift customUI.cancelTransaction(); ``` -------------------------------- ### Integrate Sola iOS SDK (Objective C) Source: https://docs.solapayments.com/sdk/ios-sdk Download and integrate the Objective C framework for the Sola iOS SDK into your Xcode project. Refer to the technical documentation for detailed integration steps. ```Objective C Download Objective C SDK framework: https://tstcdn.cardknox.com/dl/mobile/CardknoxPaymentsSDK-Objc.zip Refer to technical documentation for integration: https://docs.cardknox.com/sdk/ios-sdk ``` -------------------------------- ### Set Software Name and Versions (Swift) Source: https://docs.solapayments.com/sdk/ios-sdk Configures the SDK with the software name, software version, and gateway version. This function is essential for identifying your application and its integration with the gateway. ```Swift CardknoxSDK.setxSoftwareName("Your app name", xSoftwareVersion: "Your app version, such as 1.0.0", xVersion: "4.5.9") ``` -------------------------------- ### Download VeriFone Unified Driver Source: https://docs.solapayments.com/plugins/rms Provides download links for the VeriFone unified driver installers for both 32-bit and 64-bit systems, necessary for connecting VeriFone Mx devices. ```URL https://cdn.cardknox.com/pe/drivers/verifone/verifone_unified_driver_installer_32.msi ``` ```URL https://cdn.cardknox.com/pe/drivers/verifone/verifone_unified_driver_installer_64.msi ``` -------------------------------- ### onPaymentPrefill Callback Example Source: https://docs.solapayments.com/mobile-wallets/click-to-pay-hosted-checkout/click-to-pay-objects-reference-request This callback function is used to prefill payment details for a transaction. It returns an object containing merchant-defined information such as currency, description, order ID, and amounts. It includes a method `setTotal` to calculate the final transaction total. ```javascript onPaymentPrefill: function(){ const result = { merchantRequestId: "Merchant defined request ID", currencyCode: "USD", description: "...corp Product", orderId: "Merchant defined order ID", promoCode: "Merchant defined promo code", subtotal: roundTo(getAmount(), 2), shippingHandling: "2.00", tax: "2.00", discount: "1.00", giftWrap: "2.00", misc: "1.00", setTotal: function() { this.total = roundTo( roundToNumber(this.subtotal, 2) + roundToNumber(this.shippingHandling, 2) + roundToNumber(this.tax, 2) + roundToNumber(this.giftWrap, 2) + roundToNumber(this.misc, 2) - roundToNumber(this.discount, 2) , 2); delete this.setTotal; return this; } }.setTotal(); return result; } ```