Jump to content
  • 0

Transaction Gateway Not Recorded


activa

Question

Hello

 

we have a custom gateway , the payment is accepted and all the data are well received by the return_url with the success() function .

        return array(
            'client_id' => $this->ifSet($get['client_id']),
            'amount' =>  ($this->ifSet($response['amount']) * 100) ,
            'currency' => $this->ifSet($response['currency']),
            //Serialized invoice numbers
            'invoices' => $this->deserializeInvoices($this->ifSet($response['ctrlCustomData'])),
            'reference_id' => $this->ifSet($response['orderID']),
            'status' => $this->ifSet($status),
            'transaction_id' => $this->ifSet($response['transactionID']),
            'parent_transaction_id' => null
        );

but is not recorder in the transaction list or the log .

 

is there any missing thing i have missed ?

 

 

 

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

i have fronted this in the past in a custom gateway , and i was enable to resolve this . from what i hav see , the probleme come from processReceived() .

 

this function is not storing any transaction , is just returning a array of data , this data is used just to display a payment confirmation .

 

instead the processNotification() function, is storing the transaction when it get a notification in the callback url .

 

the real problem here , some gateway didn't use the notification system , they only send a returned response when the payment is done .

 

the question here is how we can store the transaction and apply the payment to the invoice(s) ?

 

we chould the notification url as return back url ?

Link to comment
Share on other sites

  • 0

Hello

 

we have a custom gateway , the payment is accepted and all the data are well received by the return_url with the success() function .

        return array(
            'client_id' => $this->ifSet($get['client_id']),
            'amount' =>  ($this->ifSet($response['amount']) * 100) ,
            'currency' => $this->ifSet($response['currency']),
            //Serialized invoice numbers
            'invoices' => $this->deserializeInvoices($this->ifSet($response['ctrlCustomData'])),
            'reference_id' => $this->ifSet($response['orderID']),
            'status' => $this->ifSet($status),
            'transaction_id' => $this->ifSet($response['transactionID']),
            'parent_transaction_id' => null
        );

but is not recorder in the transaction list or the log .

 

is there any missing thing i have missed ?

 

 

i have recheck that old module, what i have do is used the callbackurl as the returned url .

 

This is what you should do.

Link to comment
Share on other sites

  • 0

 

i have used as najahost say . and it work .

 

but the return_url and the callback_url was confusing for me .

 

i have thinked the callback_url is was used just for notification's gateways .

 

also the success()  method is not storing any data as naja7host mentioned by the processReceived() , and i ask  why it return all the transaction data if not stoed or showed to the client .

 

so i think it should be at least in the thank_you message display a something like

 

Thank you for your orders .....

Transaction ID  ; XXXXXX

Amount Paid  ; 0000USD

Invoice PAID N ; 1451 ,  1452 ; 1453 ;

 

What do you think Tyson ?

Link to comment
Share on other sites

  • 0

Good reaquest activa . simply and usefull addiotion to the thank you message .

 

 

Something like that could be shown to the client on the success page. I believe the data is available to the success page template, so it could be included.

 

so we can say this in the next release ? personnaly i'm not a fan of core hacking files .

Link to comment
Share on other sites

  • 0

I wouldn't say it'd be in the next release. An addition to the success page has not been a consideration for us yet as we have more pressing additions to get through to get to version 4.

 

is clear !!!

 

i have asked because i don't see any code change in the php  file ; is just a text addtion to the PDT file, and it can be done in less than 2 minutes at least for me ; for a good developper like you it take 1 min :) 

Link to comment
Share on other sites

  • 0

regardiong the thread subject again .

 

the gateway has no notification function . only return_url .

 

i have used callbacl url as the redirecturl for the gateway , but we have a probleme here .

 

when the client redirect to the callback url , the transaction well recorded in the client dashboad , but we have a probleme in the client received page , as it return no response or message to the client .

if we use the return_url as the callback url , the received page show the order is proccessing message, but no transaction are stored in the client side .

 

we have search a multiple solution but no one has what we need .

 

we have tested this code , whith redirecturl set to return_url .

    public function success(array $get, array $post) {
        return $this->validate($get, $post); 
    }

the paiment validation is done via validate() function , and is well returning the data response, but is not storing any transaction in database .

 

what we need is to store the transaction in database , and set the output transaction as response .

 

we have set callbackurl , but the callback url is redireting to the recieved page and the recieved page call the success function , and no data are set via get or post .

 

i hope if someone has well understand this situation and give me some idea or tips to do .

Link to comment
Share on other sites

  • 0

i have describe this in my post #3 .

 

the resume of the problem .

 

validate function = transaction are stored in database , no response to the view , it return no data to the (received view ).

success function = transaction not stored in database , it send the response to the view (received view )

 

Solution .

 

return_url (received view ) should also store transaction response in database .

 

is really strange why blesta is not implemented this .

 

a sample case to reflex with it , let say paypal gateway. when the client make the payment with paypal gateway and is something prevent the payment from be accepted , the client will not know it immediately , as blesta will always show just a processing message . and not handling the response status is success or declined . all the other software specially e-commerce is doing this by native .

 

blesta should accept that

 

- Not all the gateway has a notification system .

- The client should see the result of the transaction he made in the blesta system also .

- We should provide to the client a transaction id to store it for later use ( claims , late in processing order ...ect ) when the payment has been done (no matter for the status is it) . smething like what activa suggest in post #6 .

 

the only solution for all this case is to make the processReceived() work as processNotification() .

Link to comment
Share on other sites

  • 0
when the client redirect to the callback url , the transaction well recorded in the client dashboad

...

the paiment validation is done via validate() function , and is well returning the data response, but is not storing any transaction in database .

 

what we need is to store the transaction in database , and set the output transaction as response .

 

You mentioned that while using the callback URL a transaction was created. Then you mention that the transaction is not stored in the database. Can you elaborate? A transaction cannot both exist and not exist at the same time (unless it's a Schrödinger's transaction?).

 

When Blesta receives a response at the callback URL, it will process the transaction assuming your gateway's validate() method returns the expected information from which to create one. The client will then be redirected to the payment received page. No transaction information is currently available here, so you wouldn't be able to show anything more informational to the client.

 

 

 

i have describe this in my post #3 .

 

the resume of the problem .

 

validate function = transaction are stored in database , no response to the view , it return no data to the (received view ).

success function = transaction not stored in database , it send the response to the view (received view )

 

Solution .

 

return_url (received view ) should also store transaction response in database .

 

is really strange why blesta is not implemented this .

 

The problem with this is it can lead to duplicate transactions for the same payment. The return URL doesn't need to store transaction information, as the gateway should be using the callback URL instead, which does this already and then redirects the customer to the return URL.

 

 

blesta should accept that

 

- Not all the gateway has a notification system .

Blesta already accepts that some gateways do not have a notification system, which is why the callback URL should be used.

 

 

- The client should see the result of the transaction he made in the blesta system also .

This may be a good addition, yes.

 

 

- We should provide to the client a transaction id to store it for later use ( claims , late in processing order ...ect ) when the payment has been done (no matter for the status is it) . smething like what activa suggest in post #6 .

Showing the transaction ID would be apart of showing the result of the transaction as you mentioned above.

 

 

the only solution for all this case is to make the processReceived() work as processNotification() .

There are almost always multiple solutions. In this case, it would not be recommended to have both methods record transactions as they are intended for different work flows, and as mentioned, you could end up with duplicate transactions. Instead, passing the transaction that was created in the callback to the return URL would make it available for display to the customer.

Link to comment
Share on other sites

  • 0

You mentioned that while using the callback URL a transaction was created. Then you mention that the transaction is not stored in the database. Can you elaborate? A transaction cannot both exist and not exist at the same time (unless it's a Schrödinger's transaction?).

 

When Blesta receives a response at the callback URL, it will process the transaction assuming your gateway's validate() method returns the expected information from which to create one. The client will then be redirected to the payment received page. No transaction information is currently available here, so you wouldn't be able to show anything more informational to the client.

 

 

 

 

The problem with this is it can lead to duplicate transactions for the same payment. The return URL doesn't need to store transaction information, as the gateway should be using the callback URL instead, which does this already and then redirects the customer to the return URL.

 

 

Blesta already accepts that some gateways do not have a notification system, which is why the callback URL should be used.

 

 

This may be a good addition, yes.

 

 

Showing the transaction ID would be apart of showing the result of the transaction as you mentioned above.

 

 

There are almost always multiple solutions. In this case, it would not be recommended to have both methods record transactions as they are intended for different work flows, and as mentioned, you could end up with duplicate transactions. Instead, passing the transaction that was created in the callback to the return URL would make it available for display to the customer.

 

From the code exit in the no marchent gateway php file  se that is in first , before ading any transaction , it search if the the transaction ID exist already .  so duplicated transaction is not stored . like paypal send some notification more than  twice .

 

the solution that you have posted is also accepted ,"passing the transaction that was created in the callback to the return URL"  is another approuch .i love to see those added as soon as possible .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...