A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 59

Thread: Problems sending variable to XML Message

  1. #21
    Offline
    Join Date
    Nov 2007
    Posts
    116
    that was quick! thanks
    i'm going to give it a try and see how it goes, hopefully works like a charm.

    i'll post an update shortly

  2. #22
    Offline
    Join Date
    Nov 2007
    Posts
    116
    first problem i've run into...

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/........./payment.php on line 37

    Line 37 is:

    _expiry", "card_cvv", "customer_name", "customer_address"


    also is this ok for actionscript just for now as a test...

    Code:
    on(release){
    lv = new LoadVars();
    lv.payment_amount = total_price.text;
    lv.card_number = "";
    lv.card_expiry = "";
    lv.card_cvv = "";
    lv.customer_name = "no customer var specified";
    lv.customer_address = "no address var specified";
    lv.customer_city = "sydney";
    lv.send('http://www.artisticcreations.com.au/payment.php', '_blank', 'POST');
    }
    Last edited by supraicer69; 12-22-2007 at 03:35 AM.

  3. #23
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Hey musicman, are you able to send across your working .fla and php, I can't figure out what's wrong when i copy+paste your php script in your last post.
    Thanks

  4. #24
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    that line 37 simply should not be there
    It seems that piece-wise copy/paste to the browser window (when posting) sometimes results in that sort of things

    Musicman

  5. #25
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Musicman,

    Firstly let me just say welcome back...i can't tell you how happy I am you are back on the forums i'm guessing you had a nice holiday break?

    Secondly happy new year champ!

    and thirdly, thanks for the update i'll give it a shot in 10mins just finishing a quick virus scan. thanks

    i'll post results shortly

  6. #26
    Offline
    Join Date
    Nov 2007
    Posts
    116
    ran a test and ran into this error...

    &status=no&message=missing data&

    My php is attached

    Is this error because I have not yet set the Merchant ID and Password in the php script?
    I thought maybe it was the undefined data in the card details so this is my actionscript now yet the same error occurs..

    Code:
    on(release){
    lv = new LoadVars();
    lv.payment_amount = total_pricet.text;
    lv.card_number = "4000000000000000";
    lv.card_expiry = "0909";
    lv.card_cvv = "001";
    lv.customer_name = "no customer specified";
    lv.customer_address = "no address specified";
    lv.customer_city = "sydney";
    lv.send('http://www.artistic************.com.au/payment.php', '_blank', 'POST');
    }
    Attached Files Attached Files
    Last edited by supraicer69; 01-01-2008 at 09:52 AM.

  7. #27
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    it works better when you specify the expiry as 09/09 rather than 0909.
    Now, another problem surfaces, however: the script - which is derived from your sample, assumes that ssl:// is supported. This works on my machine but not on yours.
    You should upload a phpinfo file to your server and see whether the output mentions anything possibly capable of ssl (e.g. the curl package)

    Musicman

  8. #28
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Hey musicman, thanks again.

    Worked perfectly, it was the "/" that was preventing it from going through

    SSL is supported on the server so that's no problem. (i've asked the hosting provider)

    but i get this error...

    Code:
    Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (-1208974128)
    
    Fatal error: Maximum execution time of 180 seconds exceeded in /home/artistic/public_html/payment.php on line 170

  9. #29
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    the ssl problem is here:
    fsockopen("ssl://$host", 443, $errno, $errstr);
    It is a php feature that is probably not available on your server

    Musicman

  10. #30
    Offline
    Join Date
    Nov 2007
    Posts
    116
    thanks musicman

    i've emailed the client's hosting provider to enable ssl on the server if it is available and if it's not available then I would recommend my client to switch providers.

    i'll give you an update tomorrow. thanks again!

  11. #31
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Musicman,

    Just got off the phone to the payment gateway provider.
    They explained I do not need an SSL certificate from the hosting provider as the payment gateway (securepay) has the certificate installed.

    They've told me to speak with the hosting provider to;

    1) Re-configure the server's firewall to allow the following url's:

    Test server: www.securepay.com.au/test/payment
    Live server: www.securepay.com.au/xmlapi/payment

    2) To check the Name Resolution is working to the above url's through the server

    Do you think anything else could be holding it back or what else it may be? Thanks again! Hopefully everything will be working shortly!

  12. #32
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Securepay now sent me this email...maybe you understand more clearly?


    Just going by the error message : check that you have configured support for ssl and sockets in your php. Run ./configure --help for the options. You may need openssl installed on your machine (if it isn't already).


    Thanks again

  13. #33
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    remember that funny php error message:
    Unable to find the socket transport "ssl" - did you forget to enable it
    It is something the hosting provider could fix by installing a php addon or by reinstalling a different version of php.
    Have a look ... as I suggested before ... whether they support the curl php extension instead

    Musicman

  14. #34
    Offline
    Join Date
    Nov 2007
    Posts
    116
    had no idea what you meant when you said curling in an earlier post
    i'll email them now and get back to you with an update
    thanks

  15. #35
    Offline
    Join Date
    Nov 2007
    Posts
    116
    i'm going round in circles

    here's the hosting providers email...


    ---> Could you fix the error by installing a php addon or by reinstalling a different version of php?
    No. PHP is a major service and it works for everyone as it is. We can'tmake any major changes to such a service just because one third partyscript doesn't work - besides we don't even know what the issue is.

    ---> Or do you guys support the curl php extension instead?
    Yes we do - cURL with SSL support is installed on your server and isused by other customers also.

    ---> Just double check in regards to my other email if there is a firewall preventing the openssl socket for the url's TEST and LIVE of securepay? Tested and everything seemed to work fine ie. there's no firewallblocking outgoing https access and both urls you provided are accessible.


    Now what?
    thanks

  16. #36
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    rewriting part of the script to use curl ....

    see you later

    Musicman

  17. #37
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Thanks musicman, I can't wait!

    I'm sure you just want to have the satisfaction of closing this thread as resolved already hehe talk soon thanks again!

  18. #38
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    it will probably work when you replace that one function in your php ... in testing it says "invalid password", of course.
    Code:
    function openSocket($host,$query){
            // Break the URL into usable parts
            $path = explode('/',$host);
            $host = $path[0];
            unset($path[0]);
            $path = '/'.(implode('/',$path));
    
                    $ch = curl_init();
                    $header = array();
                    $header[] = "Content-type: text/xml";
                    curl_setopt($ch, CURLOPT_URL, "https://$host$path");
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
                    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);  
                    curl_setopt($ch, CURLOPT_POST, 1); 
                    curl_setopt($ch, CURLOPT_POSTFIELDS, $query);           
    
                    $body = curl_exec($ch);
    
            // Close the socket
            curl_close($ch);
    
            // Return the body of the response
            return $body;
    }
    Musicman

  19. #39
    Offline
    Join Date
    Nov 2007
    Posts
    116
    Musicman, you are a bloody genious!!! thank you so much!
    Goes through now...

    I've commented out the LIVE server, just using the TEST server in the php for now.

    When putting in my own credit card, it shows the following:

    &status=ok&approved=No&code=101&text1=Normal&text2 =Invalid Credit Card Number&

    My card number is valid though?

    Thanks

  20. #40
    Offline
    Join Date
    Nov 2007
    Posts
    116
    My mistake...my credit card hasn't yet been activated which is why it is invalid.
    Looking at the screenshot below from the merchant account does everything look ok?

    I may need you just for a few questions in the next few days if that's ok with you, but all seems to be good
    Thanks again for everything!
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center