Skip to Content Skip to Menu

🏖 Summer has arrived! Start your summer right with our summer sale!Get 30% off Now!

Setting Stripe Descriptions

  • krileon
  • krileon
  • ONLINE
  • Posts: 48072
  • Thanks: 8193
  • Karma: 1437
1 year 2 months ago #333820 by krileon
Replied by krileon on topic Setting Stripe Descriptions

- Full snippet code of the checkout session and creation of the subscription in plain text

Below are all the properties we send to Stripe when creating a recurring subscription checkout session.
Code:
// Applied by our general code $requestParams = [ 'cancel_url' => $this->getStripeCancelURL( $paymentBasket ), 'client_reference_id' => $basketId, 'metadata[user_id]' => $paymentBasket->getInt( 'user_id', 0 ), 'metadata[order_id]' => $basketId, 'metadata[invoice]' => $paymentBasket->getString( 'invoice', '' ), 'metadata[gateway]' => (int) $this->getAccountParam( 'id', 0 ), ]; if ( $customerId ) { $requestParams['customer'] = $customerId; } // Applied specifically to subscription checkout sessions $requestParams = [ 'mode' => 'subscription', 'success_url' => $this->getStripeReturnURL( $paymentBasket, true, true ), 'line_items[0][price_data][currency]' => strtolower( $paymentBasket->getString( 'mc_currency', '' ) ), 'line_items[0][price_data][product_data][name]' => $paymentBasket->getString( 'item_name', '' ), 'line_items[0][price_data][recurring][interval]' => $recurringPeriodLimits['interval'], 'line_items[0][price_data][recurring][interval_count]' => $recurringPeriodLimits['interval_count'], 'line_items[0][price_data][unit_amount]' => ( $recurringAmount * 100 ), 'line_items[0][quantity]' => 1, 'subscription_data[description]' => $paymentBasket->getString( 'item_name', '' ), 'subscription_data[metadata][user_id]' => $paymentBasket->getInt( 'user_id', 0 ), 'subscription_data[metadata][order_id]' => $paymentBasket->getInt( 'id', 0 ), 'subscription_data[metadata][invoice]' => $paymentBasket->getString( 'invoice', '' ), 'subscription_data[metadata][gateway]' => (int) $this->getAccountParam( 'id', 0 ), ];

- The expected description that you set when you created the checkout session

That would just be "Plan Name for Username" as per your configuration. You can see it as item_name being set to the subscription data above.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • wjgadmin
  • wjgadmin
  • OFFLINE
  • Posts: 489
  • Thanks: 28
  • Karma: 4
1 year 2 months ago #333831 by wjgadmin
Replied by wjgadmin on topic Setting Stripe Descriptions
Here's the response received from Stripe:

Upon careful review, the description you've added is indicated on the subscription itself since you've added it as the subscription data. You can also see it here[0].
If you would like to pass the description in the payment, then you'll need to pass it via Paymentintent or update it. You can read more about it here[1].
In the meantime, if you need any further assistance or have any questions, please feel free to get in touch as I’m happy to help.
Best regards,
Dee
[0] dashboard.stripe.com/subscriptions/sub_1N3RHcJm7rNb75SfmywuevKBv
[1] stripe.com/docs/api/payment_intents/update#update_payment_intent-description

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48072
  • Thanks: 8193
  • Karma: 1437
1 year 2 months ago #333833 by krileon
Replied by krileon on topic Setting Stripe Descriptions
You can't set payment_intent_data for a subscription mode checkout session. It will fatally error and not create the session. It's simply not permitted. For single payments we do set payment_intent_data as shown below.
Code:
return [ 'mode' => 'payment', 'success_url' => $this->getStripeReturnURL( $paymentBasket, false, true ), 'line_items[0][price_data][currency]' => strtolower( $paymentBasket->getString( 'mc_currency', '' ) ), 'line_items[0][price_data][product_data][name]' => $paymentBasket->getString( 'item_name', '' ), 'line_items[0][price_data][unit_amount]' => ( $amount * 100 ), 'line_items[0][quantity]' => 1, 'payment_intent_data[description]' => $paymentBasket->getString( 'item_name', '' ), 'payment_intent_data[metadata][user_id]' => $paymentBasket->getInt( 'user_id', 0 ), 'payment_intent_data[metadata][order_id]' => $paymentBasket->getInt( 'id', 0 ), 'payment_intent_data[metadata][invoice]' => $paymentBasket->getString( 'invoice', '' ), 'payment_intent_data[metadata][gateway]' => (int) $this->getAccountParam( 'id', 0 ), ];

So they're saying we'd have to create the subscription checkout session. Wait for that to complete so we can get the payment intent. Then update the payment intent? That's just silly and am not going to implement that. Their API should pass the subscription_data[description] through or at the very least improve subscription mode checkout sessions to allow for payment_intent_data.

Sorry I don't think there's anything more I can do for you regarding this issue. The problem is their API in this instance.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: wjgadmin

Please Log in or Create an account to join the conversation.

  • wjgadmin
  • wjgadmin
  • OFFLINE
  • Posts: 489
  • Thanks: 28
  • Karma: 4
1 year 2 months ago #333834 by wjgadmin
Replied by wjgadmin on topic Setting Stripe Descriptions
I understand, I will reach back out to them to see if there's anything more they can assist with.

It seems we have an issue either way we use the gateway:
1. If onsite - issue with security authentication
2. If hosted - issue with their description tagging

Hopefully they will be able to assist with a resolution. Unfortunately we will remain on the hosted for now to be safe with authentication as this is priority one.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48072
  • Thanks: 8193
  • Karma: 1437
1 year 2 months ago - 1 year 2 months ago #333835 by krileon
Replied by krileon on topic Setting Stripe Descriptions

1. If onsite - issue with security authentication

This shouldn't be a problem anymore. The JS should trigger the verification action just fine and does in my tests, but have implemented the following not long ago.

forge.joomlapolis.com/issues/9141

If there is a verification action still required when a payment hits server side it will redirect them to it.

2. If hosted - issue with their description tagging

Unfortunately I don't really see anything I can do about this. Their proposed solution isn't very reasonable. Is it that significant of a problem though? You should be able to see the appropriate details after clicking into a payment as it links everything up to its subscription. Just makes first glance a little annoying.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 1 year 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • wjgadmin
  • wjgadmin
  • OFFLINE
  • Posts: 489
  • Thanks: 28
  • Karma: 4
1 year 2 months ago #333837 by wjgadmin
Replied by wjgadmin on topic Setting Stripe Descriptions
Thank you for the detailed response.

- This is great news, we can start using the on-site & I’m confident that will resolve it for us.

- No worries friend, I understand if it’s a large item code wise.
It is a bit of a deal for us, just because of all other automation that goes along with our model, such as the bookkeeping; all payments are sent to bookkeeping per automation using 3rd party software (Like Zapier) & not having the description means we have to manually alter every single transaction so we can differentiate them.
But again, no worries, we will switch back to the on-site & most likely problem solved.

Thank you for your support!
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum