Step 4: Test Your Integration: Tokenize a Card Using Flex Microform

Before you begin:
  • If you use the PHP sample application code, use version 5.6 or greater.
  • Install the cURL, JSON, and APCU extensions.
  • Create your test account (see
    Step 1: Create a Sandbox Account
    ).
  • Generate your API keys (see
    Step 2: Log In to the Smartpay Fuse Portal
    and
    Step 3: Create Flex Microform API Key
    .)
Successfully processing a test transaction confirms that your credentials are valid and your Flex Microform implementation is correct. You can use sample application code to test basic transactions. Sample application code is available in these languages:
These samples use the Cybersource brand because Smartpay Fuse was created in partnership with Cybersource.
Each repository above will have README content associated, with instructions on how to deploy, configure, and run the examples.
Use the Microform sample code when implementing Hosted Fields. The sample code uses flexjs, which is a different integration approach. If you are interested in using the flexjs integration approach, please contact us.
  1. Download the sample application code from GitHub.
  2. Unpack the example code and check all file permissions.
  3. Edit the file ExternalConfiguration.php and replace the apiKeyId, secretKey and merchantID default values with the values that are generated when you created your credentials in
    Step 3: Create Flex Microform API Keys
    .

    ADDITIONAL INFORMATION

    $this --> merchantID = "<REPLACE WITH YOUR MERCHANT ID>" $this --> apiKeyID = "<REPLACE WITH YOUR REST API KEY ID>" $this --> secretKey = "<REPLACE WITH YOUR REST API SECRET>"
  4. Update the currency value to the value you will use to make a payment:
    1. Edit php-microform/paymentWithFlexTransientToken.php.
    2. Change the currency value to "GBP".
  5. Upload the updated PHP sample code to your web server or run the code on localhost.

    ADDITIONAL INFORMATION

    If you plan to deploy the code somewhere other than http://localhost, set the value of the targetOrigins field to that location when you create the server side content.
  6. Use composer to ensure dependencies are up to date (see README.md).
  7. Deploy to your web server or run standalone (see README.md).
  8. Navigate to the URL hosting the application to see the sample web page that includes the microform fields. For example, if you run the application on localhost, navigate to this URL: checkout.php.
  9. Use a test card number and associated information provided in our Testing Guides (testing-guide.html) to process a test transaction. Enter the information in the Checkout page and click
    Pay
    to process the transaction.

    ADDITIONAL INFORMATION

    ADDITIONAL INFORMATION

    The sensitive card details are sent to Smartpay Fuse. Smartpay Fuse creates the token to safely pass through your system.
    For this test, the token is returned and displays on the response page. You can proceed to
    Step 5: Test Integration Using a Tokenized Payment Card
    to use the token to perform a transaction, or choose the
    Make a Payment with Transient Token
    button to process a transaction.
    In a live system, you will capture this token in the browser, return it to your back-office system, and continue the payment process using our REST API.

AFTER COMPLETING THE TASK

Continue with
Step 5: Test Integration Using a Tokenized Payment Card
.