Welcome Guest, Not a member yet? Register   Sign In
Processing Credit Card
#1

[eluser]alejandra[/eluser]
Hi Everybody,

I'm looking for a way to display a wait messege while credit card is being process in a custom made shopping cart build in codeigniter, can some one give me a lead on how to do this?
#2

[eluser]Popcorn[/eluser]
You'd can do this thing via AJAX or though I'd decide against it. I've not had much experience with payment processing so someone tell me if I'm wrong, but don't they usually send a POST request back to your website to tell you the process result.

So ideally your flow would be like this

Purchase -> Input Payment Details -> Send to processing -> Send to "Processing" page. -> Result comes back from processor -> React based on result.
#3

[eluser]MikeHibbert[/eluser]
Yeah popcorn they do send a return post message to your site.

You could check with ajax every so often if the table that contains the payment transaction has been updated to 'successful'

The POST will be usually sent to a url you specify in your initial request to the service.

this is how it happens with Paypal, you might like to check out Payapal_Lib for CI to see code that explains it.

Mike
#4

[eluser]alejandra[/eluser]
Right know I'm using paypal as our gateway and I'm calling a function that uses curl_exec() to post data to paypal I will like to display a message while this is happening I don't know if with my current configuration (I have a library called paypal and there I have a method that I call from my controller) I could use ajax, I have not use ajax that much???? and I don't have an idea of how to do it in this case.
#5

[eluser]MikeHibbert[/eluser]
Well theres always the option of NOT using ajax but instead checking when the page is changed or refreshed.

Thats not so bad if you imagine the user going from page to page o even from the current page to the checkout.

The CURL method is fine and you should be ok, its just another way of doing the same thing and you can set the confirmation URL and get the confirm URL to update the status in the database. Then when you refresh or change page you can see the status of the transaction then, you might even send a confirmation email if you think its worth it.

Mike
#6

[eluser]alejandra[/eluser]
Thanks for the input I will look into both the ajax solution and the db one. If there is some sample code or link to samples I will greatly appreciated : )
#7

[eluser]kevinprince[/eluser]
One option is to push user to

pendingpayment/transid

the page should refresh every 10 secs to check if the post has come back

I know its old skool but it works.
#8

[eluser]alejandra[/eluser]
I have never herd of this before how does it work?
#9

[eluser]The Wizard[/eluser]
hello friends,
there is a paypal lib for CI and its working flawlessly.

1 point that is not working so good is, the paypal api itself.
I was unable to test certain things of my system, so its on hold right
now.
#10

[eluser]alejandra[/eluser]
I have my own little class to manage doDirect Payments and Express Checkout and it works fine with the PayPal NVP API. For my original reply I found a simple way that work with JQuery.

Code:
$(document).ready(function(){
    $('#wait_screen').hide();
    $('#confirmation_button').click(function()
     {
        $('#confirmation').hide();
        $('#wait_screen').html('<center><br /><br /><br /><br /><br /><strong>This might take several minutes. Please don\'t refresh your screen. Refreshing your screen might cause your credit card to be charged more than once.</strong><br /><br /><br /><br /><br /></center>');
        $('#wait_screen').show();
    });
});

The wait_screen is div that is hidden once the person clicks on submit I hide the confirmation div then write the message in the wait_screen and then it show it, this works is simple and it works.




Theme © iAndrew 2016 - Forum software by © MyBB