PayPal Express Checkout
Passing a user input field to express checkout (3 posts)

  1. ykhaled
    Posted 2 years ago #

    Everything is working like charm. The check out cycle is working with sandbox. My only request is how to pass user input from a field before customer clicks "Pay with Paypal".

    This is the express checkout button I implemented in one of the wordpress pages:
    [paypal amount="2.2" currency=USD button_style="checkout" description="$2.2 USD Buying a service"]

    The issue is. This order requires a certain input from the customer that I need to validate 1st and then append to the order table so I can execute it later if the payment is a success.

    Is it possible to have a form? the user will fill the form (one field only in this case), the script validate the input and direct to express checkout?

    Can I use a function instead of a short code?
    something like this: expresscheckout($amount,$currency,$desc,$identifier)

    My end goal is to automate an online service from ordering to delivery.

    Please if someone can point me in the right direction.


  2. ykhaled
    Posted 2 years ago #

    No much of a support, so I decided to support my self.

    I used the description field to pass a variable user input. This can not be done in short code.

    <form name="form"  action="LINK TO WORDPRESS DIR/wp-content/plugins/paypal-express-checkout/form-handler.php" method="post" onsubmit="return validateForm()">
    <input type="hidden" value="2.2" name="AMT">
    <input type="hidden" value="USD" name="CURRENCYCODE">
    <input type="text" name="PAYMENTREQUEST_0_DESC">
    <input type="hidden" value="start" name="func">
    <input type="submit" value="Pay with PayPal">

    validateForm() will simply validate user input before submission.

  3. ykhaled
    Posted 2 years ago #

    I installed short code plugin, created a new short code with the code above as contents. Now I have a custom shortcode to access PaypalExpressCheckout.

    Now I started adding new fields to append user input to the payment history in the admin area.
    So I can start using the short code as follows:
    [paypal amount=10 currency=USD button_style="buy_now" custom_field="value"]

    if someone think that this is not a good approach; please do advise. My end goal is pass user input to the order history.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PayPal Express Checkout
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic