我正在嘗試使用paypal的訂閱HTML按鈕爲我的移動WEB用戶創建一個選項來訂閱我的服務。我還沒有發現任何說這不是用貝寶,或通過搜索stackoverflow或谷歌,但當我嘗試發送我的訂戶(通過CMD)「_express-checkout-mobile」而不是「_xclick-subscriptions」我被告知「交易無效」。paypal在移動網站上訂閱html按鈕
我希望可以這樣做,因爲我希望能夠使用PayPal來創建包含第一個月的設置費用的月度費用(這與「設置試用價格」完全一致),因此我可以使用javascript/php /表格根據用戶的選擇(或通過手動輸入房屋電話價格)更新價格,然後將我的移動用戶發送到移動網站。
基本上,價格和第一個月的費用需要是可變的,並且可以是按月或按年進行的,對於每筆交易......我也可以用其他方式解決這個問題,但我希望它從我的動態用戶選擇去paypal mobile。 (我有一個paypay驗證商業帳戶btw)。
示例 「測試」 代碼的PHP等
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="[email protected]">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input type="hidden" name="item_name" value="<? echo $_POST['my_item']; ?>">
<input type="hidden" name="item_number" value="">
<!-- Set the terms of the trial period (e.g. first month/year with setup). -->
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="a1" value="<? echo $my_total; ?>">
<input type="hidden" name="p1" value="1">
<?
if($_POST['onoffswitch']){//Monthly or annual
echo '<input type="hidden" name="t1" value="Y">';
}else{
echo '<input type="hidden" name="t1" value="M">';
}
?>
<!-- Set the terms of the regular subscription. -->
<input type="hidden" name="a3" value="<? echo $my_mo_total; ?>">
<input type="hidden" name="p3" value="1">
<?
if($_POST['onoffswitch']){
echo '<input type="hidden" name="t3" value="Y">';
}else{
echo '<input type="hidden" name="t3" value="M">';
}
?>
<!-- Set recurring payments until canceled. -->
<input type="hidden" name="src" value="1">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
我發現了這一點,但我甚至不能移動版本訂閱。 (Paypal Standard not redirecting to mobile checkout when discount_amount posted)
的'_express結賬-mobile'值僅適用於快速結帳交易。在這裏,您只是試圖使用付款標準。你想要做什麼是可能的,但前提是你要將有效的變量和值傳遞給PayPal。上面的代碼不適合你嗎?使用移動付款標準有一些限制,但訂閱按鈕可以使用它。 – Gerzie
謝謝。我沒有意識到這是移動支付標準,我發現後,搜索更多:[鏈接](https://developer.paypal.com/webapps/developer/docs/classic/products/mobile-paypal-payments-standard /):'代碼'注意:與「捐贈」,「加入購物車」,_italic或「訂閱」按鈕集成的商家目前無法從移動優化體驗中受益._他們的客戶將繼續以通過移動設備上的當前支付體驗.'代碼' 所以我想這回答我的問題,但爲什麼不上述類型重定向到移動? – abuser2582707