Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createCustomerProfileTransaction request #7

Open
sean-hill opened this issue Jan 5, 2015 · 2 comments
Open

createCustomerProfileTransaction request #7

sean-hill opened this issue Jan 5, 2015 · 2 comments

Comments

@sean-hill
Copy link
Contributor

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,,dary@drayl.colm,,,,,,,,,,,,,,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

@durango
Copy link
Owner

durango commented Jan 13, 2015

I would personally just split it by , I'll look into what the fields look like hopefully soon thanks 👍

@durango
Copy link
Owner

durango commented Jan 13, 2015

And sorry for the late reply, github just sent me an email today :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants