2016-08-17 25 views
1
<form name="myform" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> 
    <div id="other_element"></div> 
    <input type="hidden" name="cmd" value="_xclick-subscriptions"> 
    <input type="hidden" name="business" value="<?php echo $adminpaypal; ?>"> 
    <input type="hidden" name="currency_code" value="USD"> 
    <input type="hidden" name="item_name" value="Monthly Subscription"> 
    <input type="hidden" name="a3" value="5.00"> 
    <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="sra" value="1"> 
    <input type="hidden" name="notify_url" value="<?php echo $paypal_notify; ?>" id="payment-notify" /> 
    <!-- Display the payment button. --> 
    <input name="return" value="<?php echo $paypal_return; ?>" type="hidden"> 
    <input type="image" src="" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> 
</form> 

我已经创建了每月订阅的PayPal表单。订阅后,我收到“订阅ID”。现在我正在制作取消订阅按钮。是否可以通过在链接上传递订阅ID来取消订阅按钮?我们可以通过在链接上通过订阅ID取消订阅定期付款

回答

0

如果您使用订阅按钮创建者创建了订阅,那么您可以按照以下步骤操作。

当你去你保存的按钮,点击“行动” - >“查看代码”。在底部,在您的代码下,有一个“创建取消订阅按钮”选项。

创建按钮并复制代码。将其粘贴到您的网络应用中。你已准备好出发。

下面是隐藏值按钮创建者代码---

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> 
    <input type="hidden" name="cmd" value="_s-xclick"> //custom variable. You can access it like $_POST['cmd'] when you call listener (IPN) 
    <input type="hidden" name="hosted_button_id" value="*********"> 
    <input type="hidden" name="custom" value="<?php echo $_SESSION['user']['id']; ?>"> 
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 

这里是退订按钮的代码。当您创建取消订阅按钮时,它将生成相同的代码。只是******会被一些价值取代。

<a HREF="https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=*******"> 
    <img SRC="https://www.paypalobjects.com/en_US/i/btn/btn_unsubscribe_LG.gif" BORDER="0"> 
</a> 
+0

不,实际上,我想发送一些更多的信息,如user_id等格式。所以这只能像我一样制作自定义表单。 –

+0

@Pankaj夏尔马号你有错误的信息。您也可以通过subscri按钮代码发送user_id。就像你现在发送隐藏的字段一样。类似这样的”> – user3831445

+0

你可以分享一些代码,看看你如何通过按钮传递隐藏值发电机 ? –