Problems, need help? Have a tip or advice? Post it here.
17 posts Page 2 of 2
Hi KK,

Thank you for posting this code and helping me. It's not worked when i've checked out and brought a product. its set as 1 however wont edit when paypal success.

I used the code and made alterations ie.

the file is located in selling/p_index.php

used this code

Code: Select all
<cms:paypal_processor>
    <cms:if k_paypal_success>
        <cms:pages masterpage='selling/p_index.php' id=pp_item_number>
            <cms:db_persist
                 _masterpage=k_template_name
                 _mode='edit'
                 _page_id=k_page_id
                 
                 amount_c = "<cms:sub amount_c '1' />"
            >
           
                <cms:if k_error >
                    <cms:set msg="ERROR db_persist: <cms:show k_error/>" />
                    <cms:log msg />
                </cms:if>
               
            </cms:db_persist>
        </cms:pages>
    </cms:if>

    <cms:if k_paypal_error>
        <cms:set msg="ERROR: <cms:show k_paypal_error/>" />
        <cms:log msg />
    </cms:if>
</cms:paypal_processor>


i also tried it as just

Code: Select all
<cms:paypal_processor>
    <cms:if k_paypal_success>
        <cms:pages masterpage='p_index.php' id=pp_item_number>
            <cms:db_persist
                 _masterpage=k_template_name
                 _mode='edit'
                 _page_id=k_page_id
                 
                 amount_c = "<cms:sub amount_c '1' />"
            >
           
                <cms:if k_error >
                    <cms:set msg="ERROR db_persist: <cms:show k_error/>" />
                    <cms:log msg />
                </cms:if>
               
            </cms:db_persist>
        </cms:pages>
    </cms:if>

    <cms:if k_paypal_error>
        <cms:set msg="ERROR: <cms:show k_paypal_error/>" />
        <cms:log msg />
    </cms:if>
</cms:paypal_processor>


Still not reducing the amount by 1
What do you see reported in the log file (log.txt in your site's root)?
This is what the output is.



=======================[2015-11-25 20:54:42]=======================
ERROR: Receiver email(accounts@tsmspec.co.uk) does not match seller's email(seller_1272492192_biz@gmail.com)

=======================[2015-11-25 21:00:52]=======================
ERROR: Receiver email(accounts@tsmspec.co.uk) does not match seller's email(seller_1272492192_biz@gmail.com)

=======================[2015-11-25 21:06:30]=======================
ERROR: Receiver email(accounts@tsmspec.co.uk) does not match seller's email(seller_1272492192_biz@gmail.com)

=======================[2015-12-01 20:29:07]=======================
ERROR: Receiver email(accounts@tsmspec.co.uk) does not match seller's email(seller_1272492192_biz@gmail.com)

=======================[2015-12-01 22:48:18]=======================
ERROR: Receiver email(accounts@tsmspec.co.uk) does not match seller's email(seller_1272492192_biz@gmail.com)

=======================[2015-12-01 22:49:30]=======================
ERROR: Receiver email(accounts@tsmspec.co.uk) does not match seller's email(seller_1272492192_biz@gmail.com)



I am not using the current business id i'm using the edited version that was submitted by @Tim
Whoops! That's because the paypal_processor doesn't know that we changed the business id. It thinks someone is trying to pull a fast one! It throws an error and stops processing.

On line 2164 of couch/functions.php (thanks @KK), the validator is checking that the email matches.
Code: Select all
                            // Finally validate that the payment has been made to the right account
                            if( trim($receiver_email) != trim(K_PAYPAL_EMAIL) ){
                                return KFuncs::raise_error( 'Receiver email('.$receiver_email.') does not match seller\'s email('.K_PAYPAL_EMAIL.')' );
                            }

That error looks familiar, right? Unfortunately, I don't think we can gain access to our custom seller email in this scope. Maybe @KK can think of something.

You could simply comment out that section and not make the check. IPN scripts are meant to be paranoid about these things in case someone's trying to rip you off. But in this case, your sellers are going to be getting order information directly from their PayPal accounts, so it's not really a big deal for this situation.

Tim
Hi Tim,

Removing that code has worked :) takes a few seconds for it to update from buy it now and ended however it's now working. Thank you KK and Tim
Glad to hear you got it working. One drawback to modifying the core files is that you're now responsible for maintaining those changes when you upgrade your Couch version. You'll never be able to remember the exact files and lines that were changed when it comes time to upgrade.

I've learned the hard way - more than once :roll: and I finally learned to keep a list of the changes I've made in my own UPGRADE.txt file that I put in the couch folder. I follow the ordinary upgrade procedure, then reapply my custom mods and it all goes smoothly.
That is very true Tim. Good shout.

I'll document it all tonight to ensure that changes are made when upgrading :lol:
17 posts Page 2 of 2