Search the Aria Knowledgebase for
User Documentation, APIs, SDKs, and more!

 

Home > User Documentation > Direct Post Payment Handler > Parsing Samples from the Direct Post Handler

Parsing Samples from the Direct Post Handler

Overview

The sample parsings in this article are intended for informational purposes only.

Sample Parsing of Returned Key-Value Pairs from PHP Query Strings

The following PHP snippet fully parses the returned key-value pairs from Direct Post Handler query string and assigns it to an array  called $output.  Note that the $_REQUEST super global variable is not used in favor of directly parsing  $_SERVER[QUERY_STRING] since $_REQUEST may contain extraneous information that is not needed.

<?php
parse_str( $_SERVER[QUERY_STRING], $output );
?>  

Sample Parsing of Output with No Errors Returned

Below is a sample array structure of the parse where there were no API or form validation errors, and an invoice was created.

 Array
(
    [inSessionID] => Q7CWTT9WRNYT5FTFYPAY
    [invoice_no] => 2324428
    [errors] => 0
)

Sample Parsing of Output with Errors Returned

Below is a sample array structure of the parse where errors were returned. In this particular case, the end-user selected credit card as form of payment, but failed to fill out the credit card fields.

Array
(
    [inSessionID] => E6EEMVG6NRWN5QQE76TJ
    [error_messages] => Array
        (
            [0] => Array
                (
                    [error_key] => serveryoumustenterccnumber
                    [error_code] => 1010
                    [error_field] => cc_no
                )
            [1] => Array
                (
                    [error_key] => servercvvmissing
                    [error_code] => 1010
                    [error_field] => cvv
                )
            [2] => Array
                (
                    [error_key] => serverexpirationmonthmissing
                    [error_code] => 1010
                    [error_field] => cc_exp_mm
                )
            [3] => Array
                (
                    [error_key] => serverexpirationyearmissing
                    [error_code] => 1010
                    [error_field] => cc_exp_yyyy
                )
        )
    [errors] => 4
)
You must to post a comment.
Last modified
09:16, 21 Oct 2015

Tags

Classifications

This page has no classifications.