PayPal API - Verify that an account is valid / exists / verified

后端 未结 4 1511
面向向阳花
面向向阳花 2021-02-07 10:15

Has anyone been able to verify the validity of a PayPal account only by the email address?

AdaptiveAccounts GetVerifiedStatus (in PayPal\'s own words) is only for use by

相关标签:
4条回答
  • 2021-02-07 10:31
    <?php
    // create a new cURL resource
    $ch = curl_init();
    
    $ppUserID = "******************"; //Take it from   sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
    $ppPass = "*************"; //Take it from sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
    $ppSign = "********************"; //Take it from sandbox dashboard for test mode or take it from paypal.com account in production mode, help: https://developer.paypal.com/docs/classic/api/apiCredentials/
    $ppAppID = "***********"; //if it is sandbox then app id is always: APP-80W284485P519543T
    $sandboxEmail = "********************"; //comment this line if you want to use it in production mode.It is just for sandbox mode
    
    $emailAddress = "sunil@rudrainnovatives.com"; //The email address you wana verify
    
    //parameters of requests
    $nvpStr = 'emailAddress='.$emailAddress.'&matchCriteria=NONE';
    
    // RequestEnvelope fields
    $detailLevel    = urlencode("ReturnAll");
    $errorLanguage  = urlencode("en_US");
    $nvpreq = "requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel&";
    $nvpreq .= "&$nvpStr";
    curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
    
    $headerArray = array(
    "X-PAYPAL-SECURITY-USERID:$ppUserID",
    "X-PAYPAL-SECURITY-PASSWORD:$ppPass",
    "X-PAYPAL-SECURITY-SIGNATURE:$ppSign",
    "X-PAYPAL-REQUEST-DATA-FORMAT:NV",
    "X-PAYPAL-RESPONSE-DATA-FORMAT:JSON",
    "X-PAYPAL-APPLICATION-ID:$ppAppID",
    "X-PAYPAL-SANDBOX-EMAIL-ADDRESS:$sandboxEmail" //comment this line in production mode. IT IS JUST FOR SANDBOX TEST 
    );
    
    $url="https://svcs.sandbox.paypal.com/AdaptiveAccounts/GetVerifiedStatus";
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray);
    $paypalResponse = curl_exec($ch);
    //echo $paypalResponse;   //if you want to see whole PayPal response then uncomment it.
    curl_close($ch);
    
    echo $data = json_decode($paypalResponse);
    
    
    
    ?>
    
    0 讨论(0)
  • 2021-02-07 10:35

    As a one off, you can use the "forgot password?" option to enter an email and you will be informed if an account with that email does not exist.

    The form includes a CAPTCHA so is probably not much use if you are looking for a coding solution.

    0 讨论(0)
  • 2021-02-07 10:38

    You can issue a request to the Pay API trying to set up a chained payment with the email to be tested as a secondary receiver. Since chained payments don't accept payments to receivers that do not have an account, the API will return an error when the input email does not correspond to a PayPal account (otherwise it will return a paykey, that you'll just throw away).

    0 讨论(0)
  • 2021-02-07 10:40
    Finde VerifiedStatus On Paypal:(Exists an account on payapal)
              GetVerifiedStatusRequest getVerifiedStatusRequest = new GetVerifiedStatusRequest
            {
                emailAddress = email,
                matchCriteria = "NONE"
            };
              AdaptiveAccountsService service = new              AdaptiveAccountsService(Configuration.GetAcctAndConfig());
            GetVerifiedStatusResponse response =  service.GetVerifiedStatus(getVerifiedStatusRequest);
            return response.accountStatus.ToString();
    
    0 讨论(0)
提交回复
热议问题