I'm using the ColdFusion CFPayment Library for processing Stripe payments. The payments are working fine, but now I want to pass metadata values to along with the transaction.
I went into the stripe.cfc file in the library and passed the static metadata values, but in the stripe logs it's showing a request like this:
{
"firstname2": "test",
"source": "tok_1**************",
"currency": "usd",
"description": "test",
"amount": "3300"
}
The value firstname2 was supposed to be in metadata, but it's automatically putting this value in the main array / json.
Added later
TransactionData = {
"description" = "test",
"metadata[test]" = "1",
"metadata[FirstName]" = "Abdur",
"metadata[LastName]" = "Rehman",
"description" = "Online Donation"
};
gw_response = gw.purchase(money=money, account=account, options=TransactionData);
I modified my code according to your example but TransactionData items are not being displayed in the request.
I've been successfully using metadata w/Stripe using CFPayment. When authorizing, you need to pass an object as the third parameter and name your keys something like this.:
TransactionData = {
"statement_descriptor" = "Descriptor Override (5-22 chars)",
"metadata[test]" = "1",
"metadata[donorid]" = DonorID,
"metadata[accountid]" = AccountID,
"description" = "Online Donation"
};
authResponse = gateway.authorize(money, cardAccount, TransactionData);
"description" and "statement-descriptor" are not required, but I like to include them so I can override the Stripe account defaults.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With