te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>Getting PayPal transaction details (subscription id) with just "token" variable from thank you page - Stack Ov
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Getting PayPal transaction details (subscription id) with just "token" variable from thank you page - Stack Ov

programmeradmin4浏览0评论

I use the below older [?] method to create subscription payments. And when client completed payment at PayPal, it is returned to my "thank you" url specified in the return form variable. By default PayPal sends to this confirmation page just a token as GET variable, like thank-you.php?token=XXXXXXXXXXXXXXXXX

But I need to make subscription_id available on this page too.

I seen one way to do this is by:

  • enabling paypal auto return at
  • I need to specify / hardcode my return URL there
  • then I can enable Payment Data Transfer (PDT) right underneath auto return
  • Now I receive a PDT Identity Token
  • This PDT identity token can be used to make requests back to paypal on the "thank you" page, together with the tx now received in the URL and get from PayPal all transaction details that I need (including subscription_id).

But if I have multiple webistes I don't want to set fixed settings at PayPal like that, specifying a default return URL there, etc.

The question: Is there a way (by API maybe) to get all transdaction details (I actually just need subscription_id) just by the default GET variable ?token=XXXXXXXXXXXXXXXXX that PayPal sends to the thank you page ? Without enabling all the above steps.

I have API keys too but they seem to perform different functions (get subscription details by subscription_id, cancel subscription by id, etc)

And I already use IPN in background but this need is a bit more client-side related.

Current payment form:

<form action="; method="post" enctype="multipart/form-data" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="my-paypal-id">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Some service purchase">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value=";>
<input type="hidden" name="cancel_return" value="/">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="9.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_buynowCC_LG.gif:NonHosted">
<input type="submit" value="Subscribe">
</form>

I use the below older [?] method to create subscription payments. And when client completed payment at PayPal, it is returned to my "thank you" url specified in the return form variable. By default PayPal sends to this confirmation page just a token as GET variable, like thank-you.php?token=XXXXXXXXXXXXXXXXX

But I need to make subscription_id available on this page too.

I seen one way to do this is by:

  • enabling paypal auto return at https://www.paypal/businessmanage/preferences/website
  • I need to specify / hardcode my return URL there
  • then I can enable Payment Data Transfer (PDT) right underneath auto return
  • Now I receive a PDT Identity Token
  • This PDT identity token can be used to make requests back to paypal on the "thank you" page, together with the tx now received in the URL and get from PayPal all transaction details that I need (including subscription_id).

But if I have multiple webistes I don't want to set fixed settings at PayPal like that, specifying a default return URL there, etc.

The question: Is there a way (by API maybe) to get all transdaction details (I actually just need subscription_id) just by the default GET variable ?token=XXXXXXXXXXXXXXXXX that PayPal sends to the thank you page ? Without enabling all the above steps.

I have API keys too but they seem to perform different functions (get subscription details by subscription_id, cancel subscription by id, etc)

And I already use IPN in background but this need is a bit more client-side related.

Current payment form:

<form action="https://www.paypal/cgi-bin/webscr" method="post" enctype="multipart/form-data" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="my-paypal-id">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Some service purchase">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="https://www.example/thanks">
<input type="hidden" name="cancel_return" value="https://www.example/">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="9.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_buynowCC_LG.gif:NonHosted">
<input type="submit" value="Subscribe">
</form>
Share Improve this question edited Feb 18 at 7:35 VLAZ 29.1k9 gold badges62 silver badges84 bronze badges asked Feb 17 at 22:04 adrianTNTadrianTNT 4,1025 gold badges35 silver badges40 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The HTML form integration in the question is very old, released more than 20 years ago, and should not be used for anything new.

Best solution is to integrate the current version of PayPal Subscriptions. It has an API.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论