Redirection to the original site after purchase is completed in Paypal

前端 未结 3 1556
逝去的感伤
逝去的感伤 2020-12-18 17:25

I\'m making one web app. I\'ve integrated Paypal in it using simple form submission to the Paypal site. Everything works well. but whenever the payment gets successful it sh

相关标签:
3条回答
  • 2020-12-18 17:41

    You have to enable auto return functionality setting in paypal .

    Just follow the below steps to enable

    1. Log in and click the Profile subtab under My Account.
    2. Click the Website Payment Preferences link under Selling Preferences.
    3. Click the On radio button to enable Auto Return.
    4. Enter the Return URL. Note: You must meet the Return URL requirements in order to set up Auto Return. Learn more about Return URL.

    For sandbox account do the following

    1. Log in to the Sandbox Merchant Id and click the Profile subtab under My Account.
    2. Click the More Option link under Profile.
    3. Look Selling Preferences which is third row.
    4. Click the Website Payment Preferences link under Selling Preferences
    5. Click the On radio button to enable Auto Return.
    6. Click the On radio button to enable Auto Return.
    7. Enter the Return URL. Note: You must meet the Return URL requirements in order to set up Auto Return. Learn more about Return URL.
    0 讨论(0)
  • 2020-12-18 17:49

    For implement PayPal button html form parameters, use this

    <form method=post action=https://api-3t.sandbox.paypal.com/nvp>
      <input type=hidden name=USER value=API_username>
      <input type=hidden name=PWD value=API_password>
      <input type=hidden name=SIGNATURE value=API_signature>
      <input type=hidden name=VERSION value=XX.0>
      <input type=hidden name=PAYMENTREQUEST_0_PAYMENTACTION value=Sale>
      <input name=PAYMENTREQUEST_0_AMT value=19.95>
      <input type=hidden name=RETURNURL value=https://www.YourReturnURL.com>
      <input type=hidden name=CANCELURL value=https://www.YourCancelURL.com>
      <input type=submit name=METHOD value=SetExpressCheckout>
    </form>
    

    This page contains all the information you need https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECGettingStarted/

    Or use the integration wizard to generate de form https://devtools-paypal.com/integrationwizard/ecpaypal/main.php

    0 讨论(0)
  • 2020-12-18 17:55

    According to the spec for PayPal button parameters, you need to set the return method.

    <input type='hidden' name='return' value='http://mysite.com/user_credits/purchase_credits'>
    <input type='hidden' name='rm' value='1'>
    

    The values are as follows:

    • 0 - Don't redirect, and use GET.
    • 1 - Automatically redirect to the return URL using GET.
    • 2 - Automatically redirect to the return URL using POST, including all payment variables.
    0 讨论(0)
提交回复
热议问题