Support » Plugin: Stripe Payments » session data

  • Resolved cajsoft

    (@cajsoft)


    Hi, How to a parse the session data from a completed payment ? I’m trying to pull the “name” field but i keep getting blank data.. it’s in json format.

    $_SESSION[‘asp_data’]

    thanks
    Craig.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, I have submitted a message to the developers to reply to your question.

    Thank you

    Plugin Author mra13

    (@mra13)

    I am not 100% what you are trying to do but the best way to handle it is to use hooks and filters of the plugin. You can see the hooks and filters that we offer in the following documentation:

    https://s-plugins.com/stripe-payments-plugin-filter-hooks-reference/

    https://s-plugins.com/stripe-payments-plugin-action-hooks-reference/

    We are open to adding more hooks if needed.

    Plugin Contributor Alexander C.

    (@alexanderfoxc)

    Hi Craig.

    As mra13 stated, you need to use hooks, as WP is event-driven.

    Also note that you need to enable billing address collection for your product, otherwise customer name won’t be available.

    If you want to get customer name, here’s an example how to do it:

    add_action('asp_stripe_payment_completed', 'asp_after_txn_callback', 10 ,2);
    function asp_after_txn_callback ($post_data, $charge)
    {
    $customer_name=isset($charge->source->name) ? $charge->source->name : '';
    
    if (!empty($customer_name)) {
    //do your thing with customer name
    } else {
    //no customer name available. You should enable billing address collection for your product.
    }
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘session data’ is closed to new replies.