uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Tech Support
       Support Policy
       Knowledge Base
       Reference Sites
       Software Piracy
       Legal Notices
       Privacy Policy
       Reseller Info
       Contact Us
       Site Map
Payment by Dankort ;)

Knowledge Base Lobby : uShop Support Conference : General Questions
Oct-23-17 02:57 PM EST
Original Message
Payment by Dankort ;)
Author Thomas Huulbaek Andersen on 01-10-2001 at 10:32 (EST)
I'm about to configure my uShop 3.0 for payment with the "local" Danish "credit card" Dankort. It's rather simple, really, all I need to to is pass ordernumber, cardnumber and amount*100 to a secure server script located somewhere else.

I imagine I can use the custom payment for this? How would I make sure that in case the card is invalid for some reason that the order does not go through? I would also need for the user to input his/her card number - would I need to write something in or ushop to do all this? CGI isn't my strongest side! ;)

Anyway, I hope you can give me some hint in the right direction!


Thomas Huulbaek Andersen

Table Of Contents
  RE: Payment by Dankort ;) Bill Weiner, 2001-01-11 06:23:42 (1)
            [...] Thomas Huulbaek Andersen, 2001-01-12 08:46:20 (2)
            The Dankort Thomas Huulbaek Andersen, 2001-01-16 05:02:08 (3)
                 RE: The Dankort Bill Weiner, 2001-01-16 06:28:46 (4)
                      ;) Thomas Huulbaek Andersen, 2001-01-18 05:29:21 (5)
                           RE: ;) Bill Weiner, 2001-01-18 06:08:17 (6)
                                ;) Thomas Huulbaek Andersen, 2001-01-18 10:34:11 (7)
                                     Wooops Thomas Huulbaek Andersen, 2001-01-18 10:35:04 (8)
                                          RE: Wooops Bill Weiner, 2001-01-18 15:51:59 (9)
                                               Conecting to a different merchant account andre, 2001-03-17 14:12:03 (10)
                                                    RE: Conecting to a different merchant account Bill Weiner, 2001-03-18 22:28:01 (11)

Messages In This Discussion
         1. RE: Payment by Dankort ;)
        Author Bill Weiner on 01-11-2001 at 06:23 (EST)
In regard to passing the data your payment processing system.... normally, yes, you would just make the changes to the "get_custom_payment_button_html" subroutine of the "" file. That subroutine is commented and documented in order to help access the variables that most payment processing systems need.

In your case, however, since you need to pass the credit card information too, that makes things a little more difficult. Instead of making changes to the "get_custom_payment_button_html" subroutine of the "" file... you would need to modify the "display_credit_card_form" subroutine and probably the field names on the "creditcard_template.html" file in order to make the names of the parameters match the names that your payment processing system expects.

As for determining if the transaction was actually approved or declined, that would involve receiving/interpretting a response back from your payment processing system. Typically, payment processing systems will provide a means by which you can specify a "return_url"... to which it will POST the response. There you would specify the URL of your "" script (so that it POSTs the reponse back to your script).... Then in the "" script you would add logic to recognize certain variables in the response and perform the necessary functions within the "complete_order" subroutine.

I hope this information helps. If you need some more help, send us a support request with more of your interface details and I may be able to assist.
                 2. [...]
                Author Thomas Huulbaek Andersen on 01-12-2001 at 08:46 (EST)
Ok, thanks Bill. I'll go through the support request thingy then!


                 3. The Dankort
                Author Thomas Huulbaek Andersen on 01-16-2001 at 05:02 (EST)
Well, I went ahead and made it myself and it seems to be working flawlessly ;)

Now I only need one last thing done and I feel confident you can help me:

1. In case of a rejected card I want to pass an argument (via html, a form preferably) to the ushop script telling it to go back to the creditcard_template.html and try again. Ie., start the payment routine again.

2. In case of approved card I want to pass the argument and tell the script to go ahead and complete the order, send the email etc. etc.

I think it's something to do with COMMAND in a hidden input form or something...

Can you help?

Thanks in advance,

Thomas Huulbaek Andersen,
Direct Computer Supplies
                         4. RE: The Dankort
                        Author Bill Weiner on 01-16-2001 at 06:28 (EST)
Nice Job!

Now as for handling the response, there are a couple different ways that it can be handled - based on the information that the Dankort payment processing system includes in the APPROVE/DECLINE response:

1) Does the Dankort payment processing system allow you to configure two separate "return" URLs via hidden parameters that get passed to Dankort? That is, some payment processing systems allow you to specify a special "success_url" parameter and a special "fail_url" parameter by which "APPROVED" transactions will be transferred to the "success_url" and "DECLINED" transactions will be transferred to the "fail_url". If that is the case, then you can specify the return URLs in the "get_custom_payment_button_html" subroutine such that they include the "command" and the "order number".... perhaps something like this:

$success_url = "$order_number";

$fail_url = "$order_number";

(Note that the $order_number is needed so that the customer's data can be maintained.)

You could then add additional "if" statements at the top of the script in order to handle the ($command eq "success") or ($command eq "fail"). Typically this would involve calling the "complete_order()" subroutine... similar to how the ($command eq "authorize_net_payment") is handled.

2) Or better yet, instead of specifying two separate "return" URLs for APPROVED/DECLINED transactions, does Dankort always return to one URL .... and also pass some response parameters? That is, some payment processing systems allow you to configure the return URL to be the URL of your shopping cart script (the script in your case)... and then POST a series of response parameters back to that URL. If that is the case, then you can specify the return URL as something like:

or if you need a special variable for identifying the "command", possibly:

You could then add an additional "if" statement at the top of the script in order to handle the ($command eq "dankort") or whatever variable you want to key off of to identify Dankort responses. Upon identifying the Dankort response, you probably want to call the "complete_order()" subroutine... similar to how the ($command eq "authorize_net_payment") is handled. As an example, you may want to take note in the "authorize_net_payment" portion of the script on how the additional reponse variables are attained and the data files/emails are handled.
                                 5. ;)
                                Author Thomas Huulbaek Andersen on 01-18-2001 at 05:29 (EST)
Thanks, it worked out marvelous!

Anyway, Bill, do you think you could email me the changes that would need to be made if I want the tax included (but still calculated and displayed) in my orders? (including shipping etc.)

I think I remember reading a question about it somewhere.

Regards and a whole lot of thank you's

                                         6. RE: ;)
                                        Author Bill Weiner on 01-18-2001 at 06:08 (EST)
Great! Glad to hear it worked out!

As for the mods to let tax be included in the price of the product...but still show the tax total at the end... I'll email you the mods a little later today.
                                                 7. ;)
                                                Author Thomas Huulbaek Andersen on 01-18-2001 at 10:34 (EST)
Thanks ;)

... there's just one last little item I need to bug you with...:

When the payment has been accepted I return to the with (among other variables) &transact=xxxxx&payment_method=credit_card_payment because the email sent to the customer need to contain the transactionnumber. But it seems I can't get it in there! I write (in the get_receipt_text subroutine):

$text .= "Transaktionsnummer : $transactn";

but it just returns Transaktionsnummer.

I also tried writing the variables into the order file with:

print ORDER_FILE $payment_method . "n";
print ORDER_FILE $cart_data . "n";

and read it with

$transact = $lines[130];
$payment_method = $lines[131];

What the h... am I doing wrong?

(once again thanks for the super fantastic support!)



                                                         8. Wooops
                                                        Author Thomas Huulbaek Andersen on 01-18-2001 at 10:35 (EST)
I did of course mean transact and not cartdata.....

                                                                 9. RE: Wooops
                                                                Author Bill Weiner on 01-18-2001 at 15:51 (EST)
Hmmmm... so the "transact" response is basically showing up empty?

I would suggest double-checking the line used to get the value of that "transact" variable. It should be something like this:

$transact = $form_text{'transact'};

Or what may be the problem is the "scope" of the variable. That is, if you set that variable in the "complete_order" subroutine... then the other subroutines (like the write_data subroutine) may not have access to that variable. As a quick fix, therefore, you could try putting that line:

$transact = $form_text{'transact'};

... near the top of the script (near the $command variable)... so that it is a global variable and can be accessed from any of your subroutines.
                                                                         10. Conecting to a different merchant account
                                                                        Author andre on 03-17-2001 at 14:12 (EST)
Is the entire scenario explained above also doable with uShopKeeper?

                                                                                 11. RE: Conecting to a different merchant account
                                                                                Author Bill Weiner on 03-18-2001 at 22:28 (EST)
Unfortunately no... at this time only uShop has a "custom_payment" method that helps to simplify the development of custom payment processing interfaces.

© 2003 Microburst Technologies, Inc.