Skip to content

createCustomerProfileTransaction request #7

Open
@sean-hill

Description

@sean-hill

Hey there, I was wondering how to parse the response from the createCustomerProfileTransaction request. The response I'm getting is

{   
    '$': {
        'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
        'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
        xmlns: 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' 
    },
    messages: { 
        resultCode: 'Ok',
        message: { 
            code: 'I00001', 
            text: 'Successful.' 
        } 
    },
    directResponse: '1,1,1,This transaction has been approved.,RS7XSG,Y,2226525593,,,20.25,CC,auth_only,,Sean,Hill,,THE ADDRESS,THE PHONE NUMBER,,[email protected],,,,,,,,,,,,,,7387E8D182EE544B82A4AC96334F4D63,,2,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,' 
}

I would like the transaction id out of this, which I believe is 2226525593. Do I just need to run some crazy regex like

directResponse.match(/\d\d\d\d\d\d\d\d\d\d/)

?

Thanks for any help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions