Hello,


I've set a paypal sandbox test users to check the payment plugin. After a successful payment the original site does not move further, but only shows the following message:

"We are processing your payment, if it did not finish in a few seconds, please contact us"

and stays as it is.

At the same time I receive a debug mail :

Code: [Select]
array (
 'extra' => 'user,21|itemid,3|email,123@123|amount,3|random,770',
 'mc_gross' => '3.00',
 'protection_eligibility' => 'Ineligible',
 'address_status' => 'confirmed',
 'payer_id' => 'GRAC9Q3XQ78XA',
 'address_street' => 'ESpachstr. 1',
 'payment_date' => '10:13:23 Feb 11, 2018 PST',
 'payment_status' => 'Pending',
 'charset' => 'windows-1252',
 'address_zip' => '79111',
 'first_name' => 'Lyubo',
 'address_country_code' => 'DE',
 'address_name' => 'Lyubo Minchev',
 'notify_version' => '3.8',
 'custom' => 'user,21|itemid,3|email,123@123|amount,3|random,770',
 'payer_status' => 'unverified',
 'address_country' => 'Germany',
 'address_city' => 'Freiburg',
 'quantity' => '1',
 'verify_sign' => 'ALxGJYdzDSvPgFHgC84ph2vBgxZUAwn9.eMqWp-N8gz-7.k75FwuYAIU',
 'payer_email' => '[email protected]',
 'txn_id' => '7P5784144H8732827',
 'payment_type' => 'instant',
 'last_name' => 'Minchev',
 'address_state' => 'Empty',
 'receiver_email' => '123@123',
 'pending_reason' => 'unilateral',
 'txn_type' => 'web_accept',
 'item_name' => 'Pay fee 3.00EUR for item 3',
 'mc_currency' => 'EUR',
 'item_number' => '901x2x3',
 'residence_country' => 'DE',
 'test_ipn' => '1',
 'transaction_subject' => '',
 'payment_gross' => '',
 'ipn_track_id' => '904ce17ce7',
)\n\n ---------------- \n\ncmd=_notify-validate&mc_gross=3.00&protection_eligibility=Ineligible&address_status=confirmed&payer_id=GRAC9Q3XQ78XA&address_street=ESpachstr.+1&payment_date=10%3A13%3A23+Feb+11%2C+2018+PST&payment_status=Pending&charset=windows-1252&address_zip=79111&first_name=Lyubo&address_country_code=DE&address_name=Lyubo+Minchev&notify_version=3.8&custom=user%2C21%7Citemid%2C3%7Cemail%2Clyubomir%40minchev.bg%7Camount%2C3%7Crandom%2C770&payer_status=unverified&address_country=Germany&address_city=Freiburg&quantity=1&verify_sign=ALxGJYdzDSvPgFHgC84ph2vBgxZUAwn9.eMqWp-N8gz-7.k75FwuYAIU&payer_email=test2%40muzikalnik.com&txn_id=7P5784144H8732827&payment_type=instant&last_name=Minchev&address_state=Empty&receiver_email=123%40123&pending_reason=unilateral&txn_type=web_accept&item_name=Pay+fee+3.00EUR+for+item+3&mc_currency=EUR&item_number=901x2x3&residence_country=DE&test_ipn=1&transaction_subject=&payment_gross=&ipn_track_id=904ce17ce7

I'v set a German account to test the Euro currency. That is the reason paypal site is dispayed in German language. Unfortunately paypal does not support BGN at all...

Any idea what could be the issue ?
« Last Edit: February 25, 2018, 11:31:18 PM by Lyubomir Minchev »

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #1 on: February 11, 2018, 08:52:50 PM »
Why you paid 3€ if your cart is 1.8€?
Can you see some error in your error log?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: paypal standbox test payment does not mark the listing as premium
« Reply #2 on: February 11, 2018, 09:05:16 PM »
Why you paid 3€ if your cart is 1.8€?
>> I 've made around 10 tests today and these 2 screenshots must have been from two different tests

I can do a new one to clear it up.

In error.log I can see just a single warning message logged:

[Sun Feb 11 19:46:07.213725 2018] [:error] [pid 23023] [client 80.72.82.97:54577] PHP Warning:  explode() expects parameter 2 to be string, array given in /var/www/html/muzikalnik/oc-content/plugins/osclass_pay/functions.php on line 1759, referer: https://xn--80andbicfdo8c.xn--90ae/osclasspay/item


function osp_cart_update($user_id, $content) {
....
..
   foreach($cart as $c) {
            $c = explode('x', $c);  <--- 1759 line


But nothing seem to be logging while performing the test payment, just the array being sent to the mail.
« Last Edit: February 11, 2018, 10:58:08 PM by Lyubomir Minchev »

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #3 on: February 11, 2018, 09:16:07 PM »
@Lyubomir
It would be nice to see what is array is in $c variable, as there should be none.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: paypal standbox test payment does not mark the listing as premium
« Reply #4 on: February 11, 2018, 09:27:34 PM »
I've just performed another test with another paypal account. I am attaching screenshots


Debug mail:

Code: [Select]
array (
 'extra' => 'user,21|itemid,4|email,123@123|amount,3.28|random,685',
 'mc_gross' => '3.28',
 'protection_eligibility' => 'Ineligible',
 'address_status' => 'confirmed',
 'payer_id' => 'WFJWZLSNYBX9Y',
 'address_street' => '1 Main St',
 'payment_date' => '12:17:20 Feb 11, 2018 PST',
 'payment_status' => 'Pending',
 'charset' => 'windows-1252',
 'address_zip' => '95131',
 'first_name' => 'test',
 'address_country_code' => 'US',
 'address_name' => 'test buyer',
 'notify_version' => '3.8',
 'custom' => 'user,21|itemid,4|email,123@123|amount,3.28|random,685',
 'payer_status' => 'verified',
 'address_country' => 'United States',
 'address_city' => 'San Jose',
 'quantity' => '1',
 'verify_sign' => 'AHp9oiqluE95fA8uzGJk82F5I2lNAG8BhlUd8vRqd34U4j.tKP5mkLzD',
 'payer_email' => [email protected]',
 'txn_id' => '7NJ90892A5651642K',
 'payment_type' => 'instant',
 'last_name' => 'buyer',
 'address_state' => 'CA',
 'receiver_email' => '123@123',
 'pending_reason' => 'unilateral',
 'txn_type' => 'web_accept',
 'item_name' => 'Pay fee 3.28EUR for item 4',
 'mc_currency' => 'EUR',
 'item_number' => '901x2x4',
 'residence_country' => 'US',
 'test_ipn' => '1',
 'transaction_subject' => '',
 'payment_gross' => '',
 'ipn_track_id' => '722939909ca44',
)\n\n ---------------- \n\ncmd=_notify-validate&mc_gross=3.28&protection_eligibility=Ineligible&address_status=confirmed&payer_id=WFJWZLSNYBX9Y&address_street=1+Main+St&payment_date=12%3A17%3A20+Feb+11%2C+2018+PST&payment_status=Pending&charset=windows-1252&address_zip=95131&first_name=test&address_country_code=US&address_name=test+buyer&notify_version=3.8&custom=user%2C21%7Citemid%2C4%7Cemail%2Clyubomir%40minchev.bg%7Camount%2C3.28%7Crandom%2C685&payer_status=verified&address_country=United+States&address_city=San+Jose&quantity=1&verify_sign=AHp9oiqluE95fA8uzGJk82F5I2lNAG8BhlUd8vRqd34U4j.tKP5mkLzD&payer_email=123-buyer%40gmail.com&txn_id=7NJ90892A5651642K&payment_type=instant&last_name=buyer&address_state=CA&receiver_email=123%40123&pending_reason=unilateral&txn_type=web_accept&item_name=Pay+fee+3.28EUR+for+item+4&mc_currency=EUR&item_number=901x2x4&residence_country=US&test_ipn=1&transaction_subject=&payment_gross=&ipn_track_id=722939909ca44


Around the warning message timestamp I've tried performing a payment with a real user and there was a misleading error at Paypal side....


Let me see if I will manage to print the $c variable and will write back.
« Last Edit: February 25, 2018, 11:32:02 PM by Lyubomir Minchev »

Re: paypal standbox test payment does not mark the listing as premium
« Reply #5 on: February 11, 2018, 10:45:10 PM »
I have finally managed to print the $c variable.

I've added:

Code: [Select]
error_log("c array is: " .  $c);
at 3 times in the functions.php , one at the end of the script.

Here is what is logged in error.log:


Code: [Select]
[Sun Feb 11 23:31:55.549978 2018] [:error] [pid 25116] [client 80.72.82.97:57029] c array is: , referer: https://xn--80andbicfdo8c.xn--90ae/user/items
[Sun Feb 11 23:31:58.440651 2018] [:error] [pid 25116] [client 80.72.82.97:57029] c array is: , referer: https://xn--80andbicfdo8c.xn--90ae/%d0%a3%d0%b4%d0%b0%d1%80%d0%bd%d0%b8/%d0%90%d0%ba%d1%83%d1%81%d1%82%d0%b8%d1%87%d0%bd%d0%b8-%d0%b1%d0%b0%d1%80%d0%b0%d0%b1%d0%b0%d0%bd%d0%b8/%d0%a4%d0%b5%d0%b9%d0%b7%d1%8a%d1%80_i4
[Sun Feb 11 23:31:58.480630 2018] [:error] [pid 25116] [client 80.72.82.97:57029] c array is: , referer: https://xn--80andbicfdo8c.xn--90ae/%d0%a3%d0%b4%d0%b0%d1%80%d0%bd%d0%b8/%d0%90%d0%ba%d1%83%d1%81%d1%82%d0%b8%d1%87%d0%bd%d0%b8-%d0%b1%d0%b0%d1%80%d0%b0%d0%b1%d0%b0%d0%bd%d0%b8/%d0%a4%d0%b5%d0%b9%d0%b7%d1%8a%d1%80_i4
[Sun Feb 11 23:32:38.353008 2018] [:error] [pid 25219] [client 173.0.82.126:39465] c array is:
[Sun Feb 11 23:33:00.613193 2018] [:error] [pid 25114] [client 80.72.82.97:57068] c array is: , referer: https://www.sandbox.paypal.com/webapps/hermes?token=9NS91094HT396620B&useraction=commit&rm=2&mfid=1518384721734_9c2fe59c8f7d0
[Sun Feb 11 23:33:00.802165 2018] [:error] [pid 25114] [client 80.72.82.97:57068] c array is: , referer: https://xn--80andbicfdo8c.xn--90ae/oc-content/plugins/osclass_pay/payments/paypl/return.php?extra=user,21|itemid,4|email,[email protected]|amount,3.28|random,152

So, it seems like right after the successfull payment it gets no value ( no output in the log ).
The last 2 lines from the log are logged after clicking the button, which returns to the original page.
« Last Edit: February 11, 2018, 10:55:07 PM by Lyubomir Minchev »

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #6 on: February 12, 2018, 01:08:21 PM »
On your site if you open this link:
oc-content/plugins/osclass_pay/payments/paypl/return.php?extra=user,21|itemid,4|email,[email protected]|amount,3.28|random,152

Do you get any error?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: paypal standbox test payment does not mark the listing as premium
« Reply #7 on: February 12, 2018, 01:13:09 PM »
It says: "We are processing your payment, if it did not finish in a few seconds, please contact us"
The same flash message in green, but displayed at the main page.
Site is still accessible on https://xn--80andbicfdo8c.xn--90ae
( I've migrated it to IDN domain in the last few days. )

Here is the link to reproduce:

Code: [Select]
https://xn--80andbicfdo8c.xn--90ae/oc-content/plugins/osclass_pay/payments/paypl/return.php?extra=user,21|itemid,4|email,[email protected]|amount,3.28|random,152
« Last Edit: February 12, 2018, 01:15:13 PM by Lyubomir Minchev »

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #8 on: February 12, 2018, 01:15:59 PM »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: paypal standbox test payment does not mark the listing as premium
« Reply #9 on: February 13, 2018, 07:38:43 PM »
I am really happy to share that I have found out a workaround !

If I switch off the button:

"Use "Standard Payments" if "Digital Goods" is not available in your country"

then a small paypal window is popping up and after filling in the credentials I get a successfull payment:

"Payment processed correctly"


Before I was redirected to a paypal site at the same browser tab. No small popup windows. It seems like it falls back to a standard payment, which can not proceed it further.


I suspect all this should come from the block below:


Code: [Select]
if(osp_param('paypal_standard') == 1) {
 20     $product_type = explode('x', Params::getParam('item_number'));
 21     $tx = Params::getParam('txn_id') <> '' ? Params::getParam('txn_id') : Params::getParam('tx');
 22     $payment = ModelOSP::newInstance()->getPaymentByCode($tx, 'PAYPAL');
 23     
 24     if (isset($payment['pk_i_id'])) {
 25       osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'osclass_pay'), $tx));
 26     } else {
 27       osc_add_flash_info_message(sprintf(__('We are processing your payment, if it did not finish in a few seconds, please contact us', 'osclass_pay'), $tx));
 28     }

The same behaviour when buying packs.

Cheers!
Lyubo
« Last Edit: February 13, 2018, 07:44:25 PM by Lyubomir Minchev »

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #10 on: February 14, 2018, 01:02:53 PM »
@Lyubomir
If I understand correctly, it works for standard payment and does not work for digital goods?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: paypal standbox test payment does not mark the listing as premium
« Reply #11 on: February 14, 2018, 03:38:29 PM »
Right opposite.

It works with digital goods, but it does not with the standard, when the standard payment is enabled in admin panel.

I am not very familiar what is the actual difference. I find Paypal documentation and all their sites confusing and not well summarized.
If I understand correctly API credentials are being used for Digital Goods or express payment/micro-payments.

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #12 on: February 14, 2018, 08:12:09 PM »
@Lyubomir
Digital goods should be used just for very small amount and are not enabled in each country.
I am using standard payments and never got such issue.

Mail me login to your FTP and we can try to investigate it bit more.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: paypal standbox test payment does not mark the listing as premium
« Reply #13 on: February 25, 2018, 03:23:04 PM »
Today I did a real payment from my personal credit card and found out this behavior is the same.
I have also tried changing from


Code: [Select]
if(osp_param('paypal_standard') == 1) {
    $product_type = explode('x', Params::getParam('item_number'));
    $tx = Params::getParam('txn_id') <> '' ? Params::getParam('txn_id') : Params::getParam('tx');
    $payment = ModelOSP::newInstance()->getPaymentByCode($tx, 'PAYPAL');
    error_log(print_r($tx));   
    error_log(gettype($tx));   
    if (isset($payment['pk_i_id'])) {
      osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'osclass_pay'), $tx));
    } else {
      osc_add_flash_info_message(sprintf(__('We are processing your payment, if it did not finish in a few seconds, please contact us', 'osclass_pay'), $tx));
    }

    $status = PaypalPayment::processPayment();
    osp_js_redirect_to(osp_pay_url_redirect($product_type));

to

Code: [Select]
if(osp_param('paypal_standard') == 1) {
    $status = PaypalPayment::processPayment();
    $product_type = explode('x', Params::getParam('item_number'));
    $tx = Params::getParam('txn_id') <> '' ? Params::getParam('txn_id') : Params::getParam('tx');
    $payment = ModelOSP::newInstance()->getPaymentByCode($tx, 'PAYPAL');
    error_log(print_r($tx));   
    error_log(gettype($tx));   
    if (isset($payment['pk_i_id'])) {
      osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'osclass_pay'), $tx));
    } else {
      osc_add_flash_info_message(sprintf(__('We are processing your payment, if it did not finish in a few seconds, please contact us', 'osclass_pay'), $tx));
    }

    osp_js_redirect_to(osp_pay_url_redirect($product_type));

with no results.

I can not believe I am the only one who does not have the paypal standard working.
Is it working for you guys ?


Thanks
« Last Edit: February 25, 2018, 03:30:00 PM by Lyubomir Minchev »

*

MB Themes

Re: paypal standbox test payment does not mark the listing as premium
« Reply #14 on: February 25, 2018, 08:01:10 PM »
@Lyubomir
We use it at osclasspoint.com and everything works allright, but it does not mean something is wrong there.
Do please one more test and before that, do this modification.

Above line osp_js_redirect_to put following:
Code: [Select]
      $emailtext = "status => " . $status . "\r\n";
      $emailtext .= osp_array_to_string($product_type). "\r\n";
      $emailtext .= osp_array_to_string($tx). "\r\n";
      $emailtext .= osp_array_to_string(Params::getParamsAsArray());
      mail(osc_contact_email() , 'OSCLASS PAY - PAYPAL DEBUG RESPONSE (RETURN TEST)', $emailtext);

This will mail you parameters of payment, please put it there (take care if there are no personal data inside ;) )
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots