Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Phil Derksen

    (@pderksen)

    @ppdoan I just ran a test and $charge->receipt_email came back with a value for a one-time payment.

    I’m having this exact problem. Here is the code I’m using:

    function simpay_custom_create_user_from_charge( $charge ) {
    error_log(print_r($charge, true));
    }
    add_action( ‘simpay_charge_created’, ‘simpay_custom_create_user_from_charge’ );

    The error log outputs the following array, which as you can see does not contain a value for receipt_email, even though I entered an email address during this test.

    Stripe\Charge Object
    (
    [id] => ch_1D7RiTLhh3u9e6qZn7MQOGV6
    [object] => charge
    [amount] => 100
    [amount_refunded] => 0
    [application] =>
    [application_fee] =>
    [balance_transaction] => txn_1D7RiTLhh3u9e6qZJLmCDcoB
    [captured] => 1
    [created] => 1536256589
    [currency] => usd
    [customer] => cus_DYYqmNCD57AFWe
    [description] =>
    [destination] =>
    [dispute] =>
    [failure_code] =>
    [failure_message] =>
    [fraud_details] => Array
    (
    )

    [invoice] =>
    [livemode] =>
    [metadata] => Stripe\StripeObject Object
    (
    )

    [on_behalf_of] =>
    [order] =>
    [outcome] => Stripe\StripeObject Object
    (
    [network_status] => approved_by_network
    [reason] =>
    [risk_level] => normal
    [risk_score] => 30
    [seller_message] => Payment complete.
    [type] => authorized
    )

    [paid] => 1
    [receipt_email] =>
    [receipt_number] =>
    [refunded] =>
    [refunds] => Stripe\Collection Object
    (
    [object] => list
    [data] => Array
    (
    )

    [has_more] =>
    [total_count] => 0
    [url] => /v1/charges/ch_1D7RiTLhh3u9e6qZn7MQOGV6/refunds
    )

    [review] =>
    [shipping] =>
    [source] => Stripe\Card Object
    (
    [id] => card_1D7RiPLhh3u9e6qZ0jNEkJpk
    [object] => card
    [address_city] =>
    [address_country] =>
    [address_line1] =>
    [address_line1_check] =>
    [address_line2] =>
    [address_state] =>
    [address_zip] =>
    [address_zip_check] =>
    [brand] => Visa
    [country] => US
    [customer] => cus_DYYqmNCD57AFWe
    [cvc_check] => pass
    [dynamic_last4] =>
    [exp_month] => 12
    [exp_year] => 2033
    [fingerprint] => pgTVb9sgK1ypYWC8
    [funding] => credit
    [last4] => 4242
    [metadata] => Stripe\StripeObject Object
    (
    )

    [name] => [email protected]
    [tokenization_method] =>
    )

    [source_transfer] =>
    [statement_descriptor] =>
    [status] => succeeded
    [transfer_group] =>
    )

    So receipt_email is returning a blank value despite the fact that I added an email address when filling out the Stripe form.
    Could it have to do with it being a test transaction? I’ve deactivated all plugins except WP Simple Pay and the helper plugin with the above code and reset the theme to twentyseventeen and am still getting the issue.

    Plugin Contributor Phil Derksen

    (@pderksen)

    @dagfooyo Troubleshooting in premium support channels.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘$charge->receipt_email missing in simpay_charge_created’ is closed to new replies.