Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4004478
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:16:42+00:00 2026-05-20T08:16:42+00:00

I’m using Paypal Express Checkout system on my website. But I want to put

  • 0

I’m using Paypal Express Checkout system on my website. But I want to put a coupon (discount) code area. It will make a reduction if code is true. (Like GoDaddy.com’s cart system)

Have you any idea, where should I start for this?

(I’m not using any eCommerce framework)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:16:43+00:00Added an answer on May 20, 2026 at 8:16 am

    One approach is to have a shopping cart on your site where the user can enter a promo code. Once they’ve entered their promo codes, and are ready to begin the checkout process, this is when you redirect them to the Express Checkout (where you send Paypal the final amount of your order, etc).

    According to this post on Paypal forum, they do not have a feature to pass the discount details to the checkout process: https://www.x.com/thread/39681 (“With express checkout all discount calculations will need to be done on your site.”)

    How to calculate before sending price to paypal
    1) Add a SEPARATE form for the promo code to your page:

    <form method="GET">
        <input type="text" name="promocode"> 
        <input type="submit" value="Add Promo">
    </form>
    

    2) On the server side, check the code, update the page accordingly with new prices (e.g. re-build your select menu with new prices). Example with PHP:

    <?
    if(isset($_GET('promocode')) {
        $prices = processPromo($_GET('promocode'));
    }
    else {
        $prices = array(2000, 4000, 6000);
    }
    ?>
    

    If you don’t have access to the server, you would have to do this with JavaScript I guess (i.e. have your promo-code and price hard-coded into the page)

    To initiate express checkout on server side
    Download PHP NVP SDK & examples from Paypal’s website:
    https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_download_sdks

    <?php
    require_once 'CallerService.php';
    
    session_start();
    
    
    ini_set('session.bug_compat_42',0);
    ini_set('session.bug_compat_warn',0);
    
    /* Gather the information to make the final call to
       finalize the PayPal payment.  The variable nvpstr
       holds the name value pairs
       */
    $token =urlencode( $_SESSION['token']);
    $paymentAmount =urlencode ($_SESSION['TotalAmount']);
    $paymentType = urlencode($_SESSION['paymentType']);
    $currCodeType = urlencode($_SESSION['currCodeType']);
    $payerID = urlencode($_SESSION['payer_id']);
    $serverName = urlencode($_SERVER['SERVER_NAME']);
    
    $nvpstr='&TOKEN='.$token.'&PAYERID='.$payerID.'&PAYMENTACTION='.$paymentType.'&AMT='.$paymentAmount.'&CURRENCYCODE='.$currCodeType.'&IPADDRESS='.$serverName ;
    
    
    
     /* Make the call to PayPal to finalize payment
        If an error occured, show the resulting errors
        */
    $resArray=hash_call("DoExpressCheckoutPayment",$nvpstr);
    
    /* Display the API response back to the browser.
       If the response from PayPal was a success, display the response parameters'
       If the response was an error, display the errors received using APIError.php.
       */
    $ack = strtoupper($resArray["ACK"]);
    
    
    if($ack != 'SUCCESS' && $ack != 'SUCCESSWITHWARNING'){
        $_SESSION['reshash']=$resArray;
        $location = "APIError.php";
             header("Location: $location");
                   }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I want to construct a data frame in an Rcpp function, but when I
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.