2015-11-04 94 views
0

我正在将Paypal支付与我的应用程序集成。因此,在使用存储的信用卡进行支付时,是否有任何方法在继续付款之前通过调用Paypal REST API使用cvv进行验证?是否有任何Paypal REST API来验证使用CVV存储的信用卡

任何帮助,将不胜感激。

+0

请说明。你的CVV有一张拱形信用卡。客户希望进行付款,并且您希望在运行付款之前检查以确保该卡有效?无法运行付款为您提供所需的信息?如果CVV无效或其他问题,它会回应该信息? –

+0

我很抱歉延迟回复您的查询,实际上我正在与PayPal客户支持联系,但直到现在我还没有从他们那里得到任何积极的信息。在使用REST API存储信用卡进行支付的同时,不需要cvv,它已经与卡一起保存,并且只有存储的卡的ID才能用于存储信用卡。因此,在这种情况下,如何验证特定用户是否有权使用存储卡,并且是否有任何REST API使用cvv或任何交易密码来验证卡作为额外的安全级别。 –

+0

我按照你的说法试过,我在将卡片保存到保险库时存储了cvv,但在查找时我没有收到cvv的回应。在REST API文档中,响应中也没有cvv。由于安全原因,贝宝实际上隐藏了信息。这就是为什么我坚持这一点。下面给出的样本响应 –

回答

-2
<?php 
// 1. Autoload the SDK Package. This will include all the files and classes to your autoloader 
require __DIR__ . '/PayPal-PHP-SDK/autoload.php'; 
// 2. Provide your Secret Key. Replace the given one with your app clientId, and Secret 
// https://developer.paypal.com/webapps/developer/applications/myapps 
$apiContext = new \PayPal\Rest\ApiContext(
    new \PayPal\Auth\OAuthTokenCredential(
     'AYSq3RDGsmBLJE-otTkBtM-jBRd1TCQwFf9RGfwddNXWz0uFU9ztymylOhRS',  // ClientID 
     'EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRbL'  // ClientSecret 


    ) 
); 
// 3. Lets try to save a credit card to Vault using Vault API mentioned here 
// https://developer.paypal.com/webapps/developer/docs/api/#store-a-credit-card 
$creditCard = new \PayPal\Api\CreditCard(); 
$creditCard->setType("visa") 
    ->setNumber("4417119669820331") 
    ->setExpireMonth("11") 
    ->setExpireYear("2019") 
    ->setCvv2("012") 
    ->setFirstName("Joe") 
    ->setLastName("Shopper"); 
// 4. Make a Create Call and Print the Card 
try { 
    $creditCard->create($apiContext); 
    echo $creditCard; 
    $mycard=json_decode($creditCard, true); 

//echo json_encode($mycard["id"]); 
$response["success"] = "1"; 
     $response["message"] = "update success"; 
$response["cardid"] = $mycard["id"] ; 
echo '{"worldpopulation":'.json_encode($response).'}'; 
} 
catch (\PayPal\Exception\PayPalConnectionException $ex) { 
    // This will print the detailed information on the exception. 
    //REALLY HELPFUL FOR DEBUGGING 
$response["success"] = "0"; 
     $response["message"] = "not update success"; 

echo '{"worldpopulation":'.json_encode($response).'}'; 
    //echo $ex->getData(); 
} 

?> 
+1

如果可能,最好使用此代码提供一些说明。另外,它是你自己的代码?如果没有,那么指定它的来源是很重要的,如果可能的话,指向原始来源的链接。 – DaveyDaveDave

+0

一个非常快速的谷歌表明,它确实不是你自己的代码,原始源代码是[here](https://github.com/paypal/PayPal-PHP-SDK/wiki/File-based-Configurations) – DaveyDaveDave