Bug passing metadata direct_stripe_before_success_redirection
-
I’ve written a function to pass metadata using direct_stripe_before_success_redirection, but can’t get it to accept any variable generated by WordPress function.
Note that these results all come in Test Mode.
So, for example, in the below, if I set the variable $recipient to “Joe Blow”, it comes out on the other end on the Stripe dashboard:
$recipient = 'Joe Blow' ; $ch = \Stripe\Charge::retrieve($chargeID); $ch->metadata[recipient]=$recipient; $ch->save();That will get me
recipient: Joe Blow
in the Stripe Payment Metadata section.
However, if I set $recipient using a function (passing $post_id) to it, I get the payment Token instead of the value of the variable.
So,
$recipient = get_the_title( $post_id ); $ch = \Stripe\Charge::retrieve($chargeID); $ch->metadata[recipient]=$recipient; $ch->save();Produces the following in the Stripe dashboard Metadata section:
recipient: tok_1Bl7AMD4ac685pxnsV2QmiJ6
I am able to pass such values via Button ID – the actual button ID, not the $button_id variable) which is how some Stripe users used to do this kind of thing, I believe.
The same thing happens when I try to pass data via description or fields other than metadata: I can pass a string, but when I use a function, the value that ought to be a string instead is replaced by the Token.
Any ideas or solutions?
The topic ‘Bug passing metadata direct_stripe_before_success_redirection’ is closed to new replies.