Authorize.net

Discuss everything related to PHP Hotel Site. All versions. Any questions related to the PHP Hotel Site developing or using should be posted to this forum.

Moderator: alexandrleonenko

zalim
Junior
Junior
Posts: 16
Joined: Dec 18th, '11, 23:13

Authorize.net

Postby zalim » Jan 19th, '16, 09:15

I finally finished all modifications and ready to roll but having issues with authorize.net integration. I've got an account and set api information per instruction.
Whenever I'm making booking (as a customer) I'm getting to authorize.net secured page properly, but after I'm entering credit card info it redirects me back to my site and says page is not found. Booking gets status pre-book. Room is still available and Crediy Card getting charged properly. Seems like my website doesn't receive response from authorize.net correctly, to make internal adjustments in database and tell the customer that booking has been confirmed. I've tried all I can and still having this issue. Please help!

zalim
Junior
Junior
Posts: 16
Joined: Dec 18th, '11, 23:13

Re: Authorize.net

Postby zalim » Jan 19th, '16, 09:16

I'm with uhotelbooking by the way, but seems like it's just modification of hotel site.

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Authorize.net

Postby ne_moj » Jan 19th, '16, 10:46

zalim wrote:I finally finished all modifications and ready to roll but having issues with authorize.net integration. I've got an account and set api information per instruction.
Whenever I'm making booking (as a customer) I'm getting to authorize.net secured page properly, but after I'm entering credit card info it redirects me back to my site and says page is not found. Booking gets status pre-book. Room is still available and Crediy Card getting charged properly. Seems like my website doesn't receive response from authorize.net correctly, to make internal adjustments in database and tell the customer that booking has been confirmed. I've tried all I can and still having this issue. Please help!


Please provide us access to your site, so we could test this issue

Please send me me access parameters to PM

francois
Newbie
Newbie
Posts: 6
Joined: Apr 1st, '16, 20:12

Re: Authorize.net

Postby francois » Apr 1st, '16, 20:22

Hello,

I am trying to configure " authorized" paiement.

But i still have an error with return.


At Authorized.net after a paiement :

an error occurred while trying to report this transaction to the merchant.


I saw in the source code for the button "buy now " on apphpnhotel api :
that there were a value called x_relay_url with value "http://xxxxxxxx.xx/index.php?page_booking_notify_autorize_net"



I have tried to but this value in the get url :

http://xxxxxxx.xx/index.php?page=bookin ... torize_net
but i still have a blank response.

How did you resolved your problem wich seem to be look like ?

Thanks

Francois

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Authorize.net

Postby ne_moj » Apr 2nd, '16, 07:55

Hello Francois

Change in file "page/handlers/handler_booking_notify_autorize_net" the value of the constants "LOG_MODE" and "LOG_TO_FILE" to "true".
Make sure that exist and is writable file "tmp/logs/payment_authorize_net.log"
Then try again to carry out a test payment and show the contents of the file "payment_authorize_net.log"


Regards, Sergey

francois
Newbie
Newbie
Posts: 6
Joined: Apr 1st, '16, 20:12

Re: Authorize.net

Postby francois » Apr 3rd, '16, 08:09

ok, always the same error message (an error occurred while trying to report this transaction to the merchant. ...) and here is the log content

=== [2016-04-03 07:58:54] ===================
---------------
POST
x_response_code=1
x_response_reason_code=1
x_response_reason_text=This transaction has been approved.
x_avs_code=P
x_auth_code=Approv
x_trans_id=8128960964
x_method=CC
x_card_type=Visa
x_account_number=XXXX8628
x_first_name=######
x_last_name=######
x_company=
x_address=######
x_city=######
x_state=
x_zip=######
x_country=FRA
x_phone=0000000000
x_fax=
x_email=######@######
x_invoice_num=20160403075740
x_description=Rooms Reservation
x_type=auth_capture
x_cust_id=
x_ship_to_first_name=######
x_ship_to_last_name=######
x_ship_to_company=
x_ship_to_address=######
x_ship_to_city=######
x_ship_to_state=
x_ship_to_zip=######
x_ship_to_country=FRA
x_amount=1.00
x_tax=0.00
x_duty=0.00
x_freight=0.00
x_tax_exempt=FALSE
x_po_num=
x_MD5_Hash=##############################
x_cvv2_resp_code=P
x_cavv_response=X
x_test_request=false
custom=W6YXTTC######
btnSubmit_x=82
btnSubmit_y=9
---------------
GET
page=booking_notify_autorize_net

SELECT id, booking_number, booking_description, order_price, vat_fee, payment_sum, currency, rooms_amount, customer_id, is_admin_reservation
FROM a_hpdvbookings
WHERE booking_number = 'W6YXTTC######' AND status = 0
From IP: 198.241.162.######
Status: 1
Possible Attempt of Hack Attack?
Please check this order:
Order Price: 1.00
Payment Processing Gross Price: 1.00



here is receipt/response url at authorize.net

http://#########.##/index.php?page=booking_notify_autorize_net Default Receipt URL Edit
http://#########.##/index.php Default Relay Response URL Edit


thanks

François

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Authorize.net

Postby ne_moj » Apr 4th, '16, 08:13

Hello François.

The problem is that you spend a deal amount of $1. Correct the file "page/handlers/handler_booking_notify_autorize_net.php" the following line (I have this line 87):

if(($result[0]['currency'] == 'USD' && abs($total - $result[0]['payment_sum']) > 1) || $total <= 1){

On the following:
if(($result[0]['currency'] == 'USD' && abs($total - $result[0]['payment_sum']) > 1) || $total == 0){

francois
Newbie
Newbie
Posts: 6
Joined: Apr 1st, '16, 20:12

Re: Authorize.net

Postby francois » Apr 4th, '16, 14:50

Hello

Thank for the answer. It is better. The reservation is ok.


"
....
x_MD5_Hash=B1E77D83459989CA18A160191DF877C8
x_cvv2_resp_code=P
x_cavv_response=X
x_test_request=false
custom=W6YXTTC###
btnSubmit_x=55
btnSubmit_y=14


GET
page=booking_notify_autorize_net

SELECT id, booking_number, booking_description, order_price, vat_fee, payment_sum, currency, rooms_amount, customer_id, is_admin_reservation
FROM a_hpdvbookings
WHERE booking_number = 'W6YXTTC###' AND status = 0
UPDATE a_hpdvcustomers SET
orders_count = orders_count + 1,
rooms_count = rooms_count + 1
WHERE id = 12
UPDATE a_hpdvbookings SET
status = 3,
transaction_number = '8131723527',
payment_date = '2016-04-04 14:26:29',
payment_type = 4,
payment_method = 1
WHERE booking_number = 'W6YXTTC###'
Thank you! The order has been placed in our system and will be processed shortly. Your booking number is: _BOOKING_NUMBER_.


"



But i still have a problem of redirection.

I'am still setted on the authorize.net's page with following message even after authorisation has been posted and getted with post and get method by authorize.net :

https://secure.authorize.net/gateway/transact.dll

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been approved.

It is advisable for you to contact the merchant to verify that you will receive the product or service.


Could you tell me wich variable to put at authorize for a correct redirection ?

Here is the last try wich doesn't relay foward to my website anymore :

"Response/Receipt URLs Help
The Payment Gateway verifies the URL specified in the post string against the URLs in this list. If the URL provided does not match one of the values on this list, the transaction will be rejected. If no URL is provided, the Default URL value will be used.

http://xxx.xx/index.php?page=booking_no ... torize_net Default Receipt URL Edit
http://xxx.xx/index.php?customer=my_bookings Default Relay Response URL Edit
http://xxx.xx/index.php Delete

"


Thanks

Francois

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: Authorize.net

Postby ne_moj » Apr 5th, '16, 05:17

Hello François.

To make Authorize.Net processing system works on your site you have to perform the following steps:
1. Create an account on Authorize.Net: http://www.authorize.net
2. After account is created, log into and obtain API Login ID and Transaction Key. Find here how to do this: Authorize.Net FAQ
3. Then go back to Administrator Panel -> Modules -> Booking Settings,
where activate Authorize.Net payment type, enter API Login ID and Transaction Key.

You set the desired values ("Authorize.Net Transaction Key" and "Authorize.Net Login ID") in page http://xxx.xx/index.php?admin=mod_booking_settings

francois
Newbie
Newbie
Posts: 6
Joined: Apr 1st, '16, 20:12

Re: Authorize.net

Postby francois » Apr 5th, '16, 10:18

This is what i did !!!!!!!!!!!!!!

On the oppositive it couldn't have been able to receive post transactions above mentioned .

After code analyse yesterday, it seems your post form isn't correct with actual authorize.net basics setting (SIM) :

x_relay_response shouldn't work alone.

So I found a working setting as follow :

<form action="https://secure.authorize.net/gateway/transact.dll" method="post">
.....
<input type="hidden" value="FALSE" name="x_relay_response">
<input type="hidden" value="Retour ############" name="x_receipt_link_text">
<input type="hidden" value="http://#########.##/index.php?customer=my_bookings" name="x_receipt_link_url">
<input type="hidden" value="LINK" name="x_receipt_link_method">
<input type="hidden" value="http://#########.##/index.php?page=booking_notify_autorize_net" name="x_relay_url">

With Authorize.net 's web-based interface , put

in "silent post url" section :http::/#########.##/index.php?page=booking_notify_autorize_net to make able data transfert for booking lock.
in receipt section : http://#########.##/index.php?customer=my_bookings
LINK to make customer web url return possible


Are you agree with that ?

Thanks

François


Return to “ApPHP HotelSite / uHotelBooking Talk {developers/users}”