Return URL

EricChungCH
Contributor
Contributor

I have just developed a website with interface with PayPal for payment. The interface works fine. Cancel payment is able to return to my URL as specified in the parameter ‘cancel_return’. Successful payment by Credit Card without sign-in to PayPal account is also able to return to my URL as specified in the parameter ‘return’ once the customer pressed the ‘Return to Merchant’. However, further testing revealed that this ‘return’ did not work for those cases paid via PayPal account. Just hang in the page after pressed ‘Return to Merchant’!

 

I have searched through similar topics and found the ‘auto return’ feature. I have followed to turn on and provided the URL in ‘Selling Preference’. Yet it still does not work. Just wonder whether this setting is only valid for Production and not SandBox. If so, how can I test that key feature under Sandbox account. There is no such ‘Selling Preference’ in the Sandbox account.

 

Below is the codes:

$pp_info = array();
$pp_info['cmd'] = '_xclick';
$pp_info['business'] = $paypalaccount;
$pp_info['item_name'] = "Vet Booking";
$pp_info['item_number'] = $itemnumber;
$pp_info['amount'] = $depositamt;
$pp_info['currency_code'] = 'HKD';
$pp_info['return'] = 'http://www.petshealthshare.org/index.php/App/Vet/PayPalFinish?itemnumber='.$itemnumber;
$pp_info['charset'] = 'utf-8';
$pp_info['no_shipping'] = '1';
$pp_info['cancel_return'] = 'http://www.petshealthshare.org/index.php/App/Vet/PayPalCancel?itemnumber='.$itemnumber;
$pp_info['rm'] = '2';

$paypal_payment_url = $this->gateway.http_build_query($pp_info);

exit(header("Location: {$paypal_payment_url}"));

 

Login to Me Too
2 REPLIES 2

EricChungCH
Contributor
Contributor

I have further tested and changed the option 'RM' to '1', all work fine!!!

Login to Me Too

EricChungCH
Contributor
Contributor

I just have encountered problem again in Return_URL. Since I changed the RM option to 1, it works fine in production. But there were two incidents, should be 2 out of 15, with problem. 

 

The problem is that my system did have received a return response, in here I presumed the client has pressed "Return to Merchant".  But absolutely with no idea why the response had not triggered the expected processing. This flow works fine for other cases and just two cases have such problem.

 

Have looked into the codes and logs, still could not have any hints. Anyone have similar experience could share is much appreciated. Program language is PHP (ThinkPHP) and below is the processing after return. First one is the success one and second is the problem one - just received the response but then not further processing!

 

First one - successful

[ 2018-08-30T17:04:16+08:00 ] 210.3.196.182 /index.php/App/Vet/PayPalFinish?itemnumber=XXXX802257XXXX
INFO: [ app_init ] --START--
INFO: Run Behavior\BuildLiteBehavior [ RunTime:0.000010s ]
INFO: [ app_init ] --END-- [ RunTime:0.000082s ]
INFO: [ app_begin ] --START--
INFO: Run Behavior\ReadHtmlCacheBehavior [ RunTime:0.000036s ]
INFO: Run Behavior\CheckLangBehavior [ RunTime:0.000090s ]
INFO: [ app_begin ] --END-- [ RunTime:0.000155s ]
SQL: SHOW COLUMNS FROM `tbvetbusy` [ RunTime:0.0009s ]
SQL: SELECT * FROM `tbvetbusy` WHERE `sItemNumber` = 'xxxx802257xxxx' [ RunTime:0.0004s ]
SQL: UPDATE `tbvetbusy` SET `iStatus`='60',`dLastUpdateTime`='2018-08-30 17:04:16' WHERE `sItemNumber` = 'xxxx802257xxxx' [ RunTime:0.0003s ]
SQL: SHOW COLUMNS FROM `tbvetmaster` [ RunTime:0.0006s ]
SQL: SELECT * FROM `tbvetmaster` WHERE `iVetMasterID` = 802 [ RunTime:0.0001s ]
INFO: [ view_parse ] --START--
INFO: [ template_filter ] --START--
INFO: Run Behavior\ContentReplaceBehavior [ RunTime:0.000078s ]
INFO: [ template_filter ] --END-- [ RunTime:0.000097s ]
INFO: Run Behavior\ParseTemplateBehavior [ RunTime:0.027158s ]
INFO: [ view_parse ] --END-- [ RunTime:0.027174s ]
INFO: [ view_filter ] --START--
INFO: Run Behavior\WriteHtmlCacheBehavior [ RunTime:0.000038s ]
INFO: [ view_filter ] --END-- [ RunTime:0.000051s ]
INFO: [ app_end ] --START--
INFO: Run Behavior\ShowPageTraceBehavior [ RunTime:0.000037s ]
INFO: [ app_end ] --END-- [ RunTime:0.000054s ]

 

 

 

Second one - problem one without any processing

[ 2018-08-30T09:56:08+08:00 ] 210.3.191.22 /index.php/App/Vet/PayPalFinish?itemnumber=XXXX802252XXXX
INFO: [ app_init ] --START--
INFO: Run Behavior\BuildLiteBehavior [ RunTime:0.000009s ]
INFO: [ app_init ] --END-- [ RunTime:0.000072s ]
INFO: [ app_begin ] --START--
INFO: Run Behavior\ReadHtmlCacheBehavior [ RunTime:0.000026s ]
INFO: Run Behavior\CheckLangBehavior [ RunTime:0.000056s ]
INFO: [ app_begin ] --END-- [ RunTime:0.000108s ]
INFO: [ view_parse ] --START--
INFO: [ template_filter ] --START--
INFO: Run Behavior\ContentReplaceBehavior [ RunTime:0.000022s ]
INFO: [ template_filter ] --END-- [ RunTime:0.000038s ]
INFO: Run Behavior\ParseTemplateBehavior [ RunTime:0.000966s ]
INFO: [ view_parse ] --END-- [ RunTime:0.000984s ]
INFO: [ view_filter ] --START--
INFO: Run Behavior\WriteHtmlCacheBehavior [ RunTime:0.000027s ]
INFO: [ view_filter ] --END-- [ RunTime:0.000039s ]

 

 

 

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.