Directory: Adding Pagestyle to Express Checkout Module

Hey there.

I'm looking to add a custom pagestyle call to my Express Checkout payment gateway directory.

I've created custom checkout pagestyles before and are familiar with how to use them.

I've created mine and tested it on the paypal end, and can call to it using a button, so I assume it should work when adding it to the express checkout gateway. I tried adding this line to the express checkout nvprstr (in multiple areas, recurring payments, direct, etc) and it doesn't seem to be taking effect, no matter what I get the default paypal pagestyle I have setup. Is there something I'm missing with how this is implemented?

Style15 is the name of the style in my paypal PageStyles.
$nvpstr .= '&PAGESTYLE=Style15';

  • aecnu

    Greetings Kruzen,

    Sorry for the delay here on this plugin issue regarding the PayPal gateway and page style.

    I know that the new lead developer is still digesting this inherited plugin and hopefully he will be able to make his way in here to answer your question soon.

    However, I will ping him again to see if this got away from him or hopefully a hack to get your page style working if possible.

    Thank you for your patience.

    Cheers, Joe

  • Arnold

    There are multiple commands that go back and forth. The PAGESTYLE is part of the SetExpressCheckout command. Make sure you're putting it on the right command. Search for

    hash_call( 'SetExpressCheckout', $nvpstr )

    and the string prepared for that call should be the one you need to change.

    I also note that the PDF manual is different from the online docs. They refer to the page_style variable instead of PAGESTYLE. and they were referring to buttons which you indicate work.

    "Page Style Name (required) Enter a name up to 30 characters long. The name can contain letters, numbers, and
    underscores, but no other symbols or spaces. The Page Style Name is used to refer
    to the page style in your PayPal account and in the page_style HTML variable
    for your Website Payment buttons."

    so there's an apparent descrepance in the documentation.

  • Kruzen

    Hi Arnold,

    SetExpressCheckout is called for in call_shortcut_express_checkout and call_mark_express_checkout

    I tried adding it to both in this fashion:

    function call_shortcut_express_checkout( $payment_amount, $billing_type, $billing_agreement ) {
            // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
            $nvpstr  = '&PAYMENTREQUEST_0_AMT='           . urlencode( $payment_amount );
            $nvpstr .= '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode( $this->payment_type );
            $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE='  . urlencode( $this->currency_code_type );
            $nvpstr .= '&NOSHIPPING=1';
            $nvpstr .= '&PAGESTYLE=Style15';
            $nvpstr .= '&RETURNURL='                      . urlencode( $this->return_url );
            $nvpstr .= '&CANCELURL='                      . urlencode( $this->cancel_url );

    and in this fashion:

    function call_mark_express_checkout(
            $payment_amount , $ship_to_name         , $ship_to_street , $ship_to_city    ,
            $ship_to_state  , $ship_to_country_code , $ship_to_zip    , $ship_to_street2 , $phone_number ) {
    
            // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
            $nvpstr  = '&PAYMENTREQUEST_0_AMT='               . $payment_amount;
            $nvpstr .= '&PAYMENTREQUEST_0_PAYMENTACTION='     . $this->payment_type;
            $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE='      . $this->currency_code_type;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTONAME='        . $ship_to_name;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOSTREET='      . $ship_to_street;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOSTREET2='     . $ship_to_street2;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOCITY='        . $ship_to_city;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOSTATE='       . $ship_to_state;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=' . $ship_to_country_code;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOZIP='         . $ship_to_zip;
            $nvpstr .= '&PAYMENTREQUEST_0_SHIPTOPHONENUM='    . $phone_number;
            $nvpstr .= '&ADDROVERRIDE=1';
            $nvpstr .= '&PAGESTYLE=Style15';
            $nvpstr .= '&RETURNURL='                          . $this->return_url;
            $nvpstr .= '&CANCELURL='                          . $this->cancel_url;
    
            $_SESSION['currency_code_type'] = $this->currency_code_type;
            $_SESSION['payment_type']       = $this->payment_type;
    
            /*
             * Make the API call to PayPal
             * If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
             * If an error occured, show the resulting errors
             */
            $result = $this->hash_call( 'SetExpressCheckout', $nvpstr );

    I also attempted calling it as PAGE_STYLE in either case as well. Neither seem to be working and I don't understand why. I also tried several other page styles that I know work.

  • 3SixtyEvolve

    Hi @Kruzen

    Just a quick note to say that we haven't forgotten about you. We're awaiting feedback from the Developer, but he has been extremely busy with a new release of another plugin. So I apologize for the delay in getting back to you.

    I will follow up with the Developer again. In the meantime, if you did manage to solve the problem, please let me know.

    Thank you in advance for your patience. I will be in touch shortly.

    Have a good day!

    GinaB

  • Arnold

    @Kruzen

    I've looked at it but I can't get it to work either. Since it's not a feature we offer and it's really a PayPal interface issue, have you asked PayPal how it should be done? About all I have are theories.

    I've seen instances where it done form forms

    <input type="hidden" name="page_style" value="style name">

    Here again they are using page_style instead of PAGESTYLE. I'm sure it's probably something simple but about all I could do is keep throwing vairations at it and hope it works or go to the source and ask PayPal.

  • aecnu

    Greetings Kruzen,

    Just touching base with you to confirm that we are at the end of what we can do on our end and that it appears that final page style resolution is up to PayPal at this point.

    We do not like the idea of sending one of our members chasing another source to get an answer, but on rare occasion we have run out of options and have no other choice.

    Since there is now nothing more that we can do I am marking this ticket as resolved.

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.