Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 806951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:19:34+00:00 2026-05-15T00:19:34+00:00

I am currently implementing a credit card processing script, most as provided by the

  • 0

I am currently implementing a credit card processing script, most as provided by the merchant gateway. The code calls functions within a class and returns a string based on the response. The end php code I am using (details removed of course) with example information is:

<?php
$gw = new gwapi;
$gw->setLogin("username", "password");
$gw->setBilling("John","Smith","Acme, Inc.","888","Suite 200", "Beverly Hills",
        "CA","77777","US","555-555-5555","555-555-5556","support@example.com",
        "www.example.com");
//        "CA","90210","US","support@example.com");
$gw->setOrder("1234","Big Order",1, 2, "PO1234","65.192.14.10");

$r = $gw->doSale("1.00","4111111111111111","1010");
print $gw->responses['responsetext'];

?>

where setlogin allows me to login, setbilling takes the sample consumer information, set order takes the order id and description, dosale takes the amount charged, cc number and exp date.

when all the variables are sent validated then sent off for processing, a string is returned in the following format:

response=1&responsetext=SUCCESS&authcode=123456&transactionid=23456&avsresponse=M&orderid=&type=sale&response_code=100

where:

  • response = transaction approved or
    declined
  • response text = textual response
  • authcode = transaction authorization
    code
  • transactionid = payment gateway tran
    id
  • avsresponse = avs response code
  • orderid = original order id passed in
    tran request
  • response_code = numeric mapping of
    processor response

I am trying to solve for the following:

  1. How do I take the data which is
    passed back and display it
    appropriately on the page – If the
    transaction failed or AVS code
    doesnt match my liking or something
    is wrong, an error is displayed to
    the consumer; if the transaction
    processed, they are taken to a
    completion page and the transaction
    id is sent in SESSION as output to
    the consumer
  2. If the response_code value matches a
    table of values, certain actions are
    taken, i.e. if code =100, take to
    success page, if code = 300 print
    specific error on original page to
    customer, etc.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:19:34+00:00Added an answer on May 15, 2026 at 12:19 am

    Use parse_str() with the array argument (never use without) to get an array with key/value pairs out of the string. You can then easily access the separate values and implement your logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 392k
  • Answers 392k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://jqueryui.com/ - their dialog is quite flexible :) as for… May 15, 2026 at 1:39 am
  • Editorial Team
    Editorial Team added an answer The second property implementation is an explicit interface implementation. It… May 15, 2026 at 1:39 am
  • Editorial Team
    Editorial Team added an answer I 've found that the problem was with passing this… May 15, 2026 at 1:39 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.