can i use the ping feature to create a subscription for a user

can i use the ping feature to create a subscription for a user?

  • Mason
    • DEV MAN’s Sidekick

    Hiya @corelove,

    So the original purpose of the ping feature was to integrate with other services so that when a subscription is created you can send that information to other places (so you can subscribe a member to a mailchimp list automatically for example).

    However, I believe it is possible to use pings or hook into the process to add a subscription/level to a user when your using an alternate payment method.

    I’m not sure if it’s fully ready yet or not though. Looking at the plugin you can go to membership/membershipincludes/classes/class.ping.php and fine the following actions (though they are currently commented out):

    do_action( 'membership_add_level', $tolevel_id, $this->ID );
    do_action( 'membership_drop_level', $fromlevel_id, $this->ID );
    do_action( 'membership_move_level', $fromlevel_id, $tolevel_id, $this->ID );

    do_action( 'membership_add_subscription', $tosub_id, $tolevel_id, $to_order, $this->ID);
    do_action( 'membership_drop_subscription', $fromsub_id, $this->ID );
    do_action( 'membership_move_subscription', $fromsub_id, $tosub_id, $tolevel_id, $to_order, $this->ID );

    So I’m going to ask the developer about this one and get his take on this specifically.

    Thanks for posting and being a member at WPMU DEV!

  • Barry
    • DEV MAN’s Mascot

    Pings are outgoing things really – you’d need to custom code a url / file to receive notifications from other systems to create subscriptions – and with that a security system so that only approved / known systems notifications are processed by the url – so unfortunately it’s not as straightforward as would initially seem.

    I’ll add it to the features request forum and see if we can get it into an update.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.