wp-pronamic-pay
wp-pronamic-pay copied to clipboard
Introduce public subscription view page for `cancel`, `renew` and `mandate` actions
https://github.com/pronamic/wp-pay-core/blob/5ec06f5d31a3125d6912aecae6934c7f5e221009/src/Subscriptions/SubscriptionsModule.php#L105-L151
Something like: http://pay.local/?subscription=XXX&key=subscr_XXX&view=subscription or should we implement some rewrite rules?
http://pay.local/abonnement-inzien/{secret_40_chars_sha_1_hash} http://pay.local/abonnement-inzien/9cf95dacd226dcf43da376cdb6cbba7035218921
Tools like Google Drive, Dropbox, Payt (https://factuurinzien.nl/) also use secrets in their public links.
<?php
echo $subscription->get_id();
foreach ( $subscription->get_phases() as $phase ) {
echo $phase->get_id();
foreach ( $phase->get_created_periods() as $period ) {
echo $period->get_id();
foreach ( $period->get_payments() as $payment ) {
echo $payment->get_id();
}
}
}
The $phase->get_created_periods()
and $period->get_payments()
methods currently don't exist.
Cancel
Renew
Mandate
Use wp_hash( $subscription->get_id() )
for an unique hash in a public URL, if users generate new salts (https://api.wordpress.org/secret-key/1.1/salt/) the old public links will also no longer work.
In internal HelpScout ticket https://secure.helpscout.net/conversation/1637278281/22756?folderId=1425710 we have a customer that doesn't see any payments attached to a subscription.

This could indicate an issue in the $periods = $subscription->get_payments_by_period();
method. This may be a reason to implement the following:
<?php
echo $subscription->get_id();
foreach ( $subscription->get_phases() as $phase ) {
echo $phase->get_id();
foreach ( $phase->get_created_periods() as $period ) {
echo $period->get_id();
foreach ( $period->get_payments() as $payment ) {
echo $payment->get_id();
}
}
}
CC @rvdsteege
it is possible that the cancel
, renew
and mandate
actions will no longer function properly after the 8.0
update. I think it would be good to test this again for 8.1
and possibly revise it. Also see internal HelpScout ticket: https://secure.helpscout.net/conversation/1692642890/22994/.
What issues are we running into with these actions? Users use these action URL's in their customer communication, so I'd expect they function properly in a plugin release.
Received an issue at support with the period dates moving forward on pending/incomplete renewals. This could be improved/resolved with better user subscription management functionality.
Internal Help Scout ticket: https://secure.helpscout.net/conversation/2165411530/25264/