繁体   English   中英

检索和存储贝宝订阅

[英]Retrieve and Store paypal subscriptions

我正在使用贝宝(PayPal)订阅付款,当用户在注册后输入订阅时,我会在其中付款。

以下是向用户收费的贝宝代码:

<form id="myForm" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="item_name" value={{currentUser.get('plan')}}>
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="0.01">
<input type="hidden" name="p3" value="1">




<input type="hidden" name="t3" value="M">
<input type="hidden" name="return" value="">
value="">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest">

</form>

现在,我想为当前用户将已确认的付款(即金额,日期等)存储到Parse中,但不确定如何执行。 任何帮助将不胜感激。

任何帮助将不胜感激。

更新: success.php?tx=6BA48179L4889664N&st=Pending&amt=0%2e01&cc=CAD&cm=&item_number=&sig=Hfh95Y%2fv8XTcl9zZasPjTwswbzJ2CRgSxRX%2f5U%2fmtDxQQk1cCOpuUH4awkCCGSQsI%2fgQnNeg%2bKUa7a9p0UPwNHQgL%2bST1aonNptQBSXKCVqAlVGY9QMb%2bQJJk2QMxttgKxysFZnBaKxBxLl8E2vbtLNsDflWf%2fJfT2eCMnSlzSc%3d ,我需要抓住入账金额,货币和tx我尝试使用

<?php
//Getting payment details from paypal
$amount = $_GET[‘amt’];
$currency = $_GET[‘cc’];
$trx_id = $_GET[‘tx’];
$invoice = mt_rand();
//inserting the payment to table


echo "$trx_id";

?>但它不起作用

PayPal可以使用此处描述的PDT / IPN变量向您提供有关订阅的信息:

https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#id091EB0901HT

如果您从贝宝(PayPal)获取订阅详细信息,则应使用PDT或IPN来确保发回给您的信息是合法的。

但是,由于必须首先具有订阅详细信息才能将其发送到PayPal,所以您可能会发现,以原始格式记录自己的信息比从PayPal的变量中重建信息更容易/更可靠。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM