如何在Cron工作中检查Paypal重复用户付款状态?

时间:2016-07-28 13:49:37

标签: php paypal

我正在使用PHP中的Paypal开发基于订阅的付款方式

以下是我用于订阅付款的表单

<form name = "myform" action = "https://www.sandbox.paypal.com/cgi-bin/webscr" method = "post" target = "_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type = "hidden" name = "business" value = "test-facilitator@sample.com">
<input type="hidden" name="lc" value="US">
<input type = "hidden" name = "item_name" value = "Patient Trasportation">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="src" value="1">        
<!--<input type="hidden" name="srt" value="1">-->
<input type="hidden" name="a3" value="<?php echo $price; ?>">
<input type="hidden" name="p3" value="1">
<input id="subValue" type="hidden" name="t3" value="">
<input type="hidden" name="currency_code" value="USD">
<input type = "hidden" name = "cancel_return" value = "http://www.example/Process">
<input type = "hidden" name = "return" value = "http://www.example/buy">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest">
<input type='hidden' name='rm' value='2'>
<input type="hidden" name="cbt" value="Return to The Store">
<input type="hidden" name="custom" value="<?php echo  $last_ins_id; ?>">        
<input type="submit" class='btn btn-primary btn-paypal' value="Pay with Paypal">
</form> 

使用此我将在PayPal成功返回后存储所需的付款详细信息,返回值低于,

Array
(
    [txn_type] => subscr_signup
    [subscr_id] => I-WJ5JU5F5J4EL
    [last_name] => singh
    [residence_country] => US
    [mc_currency] => USD
    [item_name] => Test
    [business] => test.zerosoft-facilitator@sample.com
    [amount3] => 40.00
    [recurring] => 1
    [address_street] => 1 Main St
    [payer_status] => verified
    [payer_email] => test@test.com
    [address_status] => confirmed
    [first_name] => test
    [receiver_email] => test.zerosoft-facilitator@sample.com
    [address_country_code] => US
    [payer_id] => RTNTA7JN44S7S
    [address_city] => San Jose
    [reattempt] => 1
    [payer_business_name] => mano singh's Test Store
    [address_state] => CA
    [subscr_date] => 03:54:15 Jul 28, 2016 PDT
    [address_zip] => 95131
    [custom] => 206
    [charset] => windows-1252
    [period3] => 1 W
    [address_country] => United States
    [mc_amount3] => 40.00
    [address_name] => Test Store
    [auth] => AimgDlXpiQ7gYXJgDylV-75JQwlPSBkduKhg79fKg2.8qxXDZ4w51lgCVLg.20WJk1jT0USO27QbLUZBnGZKm8A
    [form_charset] => UTF-8
)

现在我需要使用Cron作业在一个月内检查所有用户的付款状态,并检查他们的付款状态并增加他们的有效日期或阻止他们。我用Google搜索了一个没有得到解决方案的任何帮助。

先谢谢

1 个答案:

答案 0 :(得分:1)

使用标准订阅时,没有可用于点击和提取个人资料详细信息的API,但每次处理付款时您都会获得额外的IPN,因此您可以根据它进行更新,而不是使用cron作业。