dongliao3450 2019-05-10 23:19
浏览 74

如何确保从paypal服务器调用paypal notify_url?

I was working with paypal recurring payment subscription form and using sandbox account for testing

here is my form:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <input type="hidden" name="business" value="testacc@email.com">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="Standard Pack">
    <input type="hidden" id="item_number" name="item_number" value="1233434-23213">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="user_id" value="13692">
    <input type="hidden" id="package_id" name="package_id" value="<?php echo $package_type; ?>">
    <input type="hidden" name="a1" value="0">
    <input type="hidden" name="p1" value="1">
    <input type="hidden" id="t1" name="t1" value="M">
    <input type="hidden" id="a3" name="a3" value="10">
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="M">
    <input type="hidden" name="src" value="1">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="no_shipping" value="1">
    <input name="return" type="hidden" value="<?php echo base_url();?>package/new_payment_success" />
    <input name="notify_url" type="hidden" value="<?php echo base_url();?>package/new_payment_notify" /> 
    <input name="cancel_return" type="hidden" value="<?php echo base_url();?>package/new_payment_cancel" />

    <div class="paypal-btn">
        <input type="image" src="pay-with-paypal.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style='width: 125px'>
    </div>
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

and it's working totally fine and sends a success information to notify_url url now for security purpose im checking HTTP_USER_AGENT from $_SERVER variable but this can be modified too.

so how can i make sure that transection is done successfully before i update my database?

  • 写回答

1条回答 默认 最新

  • doudeng8691 2019-05-11 02:16
    关注

    I think that you can verify the whole POST content by appending cmd=_notify-validate and sending it to PayPal. They will answer you with a Verified or Not verified response.

    Please, check the link below for more information:

    https://developer.paypal.com/docs/classic/ipn/gs_IPN/

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。