How to allow customers to apply promo code on existing subscription in stripe customer portal? - stripe-payments

in stripe customer portal settings I have set "Allow customers to apply promotion codes", but when I open customer portal I can't find anywhere, where I could add promo code.
I can cancel subscription, update payment methods or customer data as I configured in settings, but not promotion code. Is there something special that needs to be done?
In production we are opening that via special BillingPortalSession (stripe api), but I also checked with generated link from stripe it self.
billing portal configuration features looks like this:
"features": {
"customer_update": {
"allowed_updates": [
"email",
"address",
"phone"
],
"enabled": true
},
"invoice_history": {
"enabled": true
},
"payment_method_update": {
"enabled": true
},
"subscription_cancel": {
"cancellation_reason": {
"enabled": true,
"options": [
"too_expensive",
"missing_features",
"switched_service",
"unused",
"other",
"customer_service",
"too_complex"
]
},
"enabled": true,
"mode": "at_period_end",
"proration_behavior": "none"
},
"subscription_pause": {
"enabled": false
},
"subscription_update": {
"default_allowed_updates": [
"price",
"promotion_code"
],
"enabled": true,
"proration_behavior": "create_prorations"
}

If you are using the default portal configuration on your account, make sure to double check that your "Allow customers to apply promotion codes" setting is enabled in your dashboard settings[1].
If you are using the API to define your billing portal configuration, make sure to check that promotion_code is included in your portal's features.subscription_update.default_allowed_updates list[2].
If neither of those seem to work for you, you can get help by going to Stripe's Discord Server[3] or writing in to their support team[4]. If you go to one of those, please make sure to have an example request ID[5] from a time when you created a customer portal session and did not see the behavior that you were expecting.
[1] https://dashboard.stripe.com/test/settings/billing/portal
[2] https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-default_allowed_updates
[3] https://stripe.com/go/developer-chat
[4] https://support.stripe.com/?contact=true
[5] https://stripe.com/docs/api/request_ids

Related

Scope multiple groups in same Azure access review (API)

I'm trying to create an access review using the Microsoft Graph API. I can't figure out how to scope (target) multiple groups in the same access review using the available documentation and samples. This is easily done when creating one in the Azure portal.
My goal is to have one access review that scope two or three Azure AD groups. These groups are granting access to Reader, Contributor and Owner role within a subscription.
Here is a sample code that I used to create an access review that scope one group.
{
"displayName": "Testing",
"descriptionForAdmins": "Testing",
"descriptionForReviewers": "Testing",
"scope": {
"#odata.type": "#microsoft.graph.accessReviewQueryScope",
"query": "/groups/<groupid>/transitiveMembers",
"queryType": "MicrosoftGraph"
},
"reviewers": [
{
"query": "/groups/<groupid>/owners",
"queryType": "MicrosoftGraph"
}
],
"settings": {
"mailNotificationsEnabled": true,
"reminderNotificationsEnabled": true,
"justificationRequiredOnApproval": true,
"defaultDecisionEnabled": false,
"defaultDecision": "None",
"instanceDurationInDays": 3,
"recommendationsEnabled": false,
"recurrence": {
"pattern": {
"type": "weekly",
"interval": 1
},
"range": {
"type": "noEnd",
"startDate": "2022-02-25T12:02:30.667Z"
}
}
}
}
Any ideas?
I will answer my own question.
I see now in the browser when I create an access review with two groups in scope that it actually creates two separate access reviews, one for each group. It seems that it's not possible to create one access review for multiple groups when posting this.

How to set products in Stripe Customer Portal

I have a Stripe account for a company selling subscriptions on two websites:
on website A: subscription plans A1, A2, A3 (these are Products in Stripe parlance)
on website B: subscription plans B1, B2 (also Products)
I would like to use the Customer Portal to allow the customers of both websites to manage their plan. I would like to show only show the respective plans on the portals created for each website.
Is it possible? How can I achieve this?
I see that we can provide a configuration built at runtime when creating a portal session, but I don't see how to specify the product set.
You can use the Customer Portal Configuration object’s features.subscription_update.products parameter to specify the products available in the portal session. This is what that would look like in Python:
stripe.billing_portal.Configuration.create(
business_profile={
"headline": None,
"privacy_policy_url": "https://example.com/privacy",
"terms_of_service_url": "https://example.com/tod"
},
features={
"subscription_update": {
"default_allowed_updates": ["price", "quantity", "promotion_code"],
"enabled": True,
"products": [
{
"product": "prod_B1",
"prices": [
"price_123",
"price_456"
]
},
{
"product": "prod_B2",
"prices": ["price_789"]
},
]
},
"payment_method_update": {
"enabled": True
},
},
)
session = stripe.billing_portal.Session.create(
customer="cus_123",
return_url='https://example.com/account',
configuration=configuration.id
)

Users migrated to Office 365 have duplicate calendars called 'calendar' when using Microsoft Graph

We're using an CRM that has switched to using Graph to add events into our users Office 365 calendars. We're getting error messages that there are duplicate calendars called calendar for some users, the users are all users who were migrated from on premise Exchange to Office 365.
Looking in Office 365 via Powershell (get-mailboxfolderstatics -Identity user#contos.com -FolderScope Calendar | ft or in Outlook itself, there is only the one calendar named calendar.
But if I look at the same user via Graph
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('XXXXXXX-762d-47ee-9f82-XXXXXXXXXXX')/calendars",
I see 2 calendars with name Calendar, with slightly different IDs (see last few characters)
Azure support closed the case but the problem remains, how do I get Graph to see only the ONE calendar named calendar, or, how to rename one to something other THAN calendar?
Here's a dump of what I see:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('Bob.Smith%40contoso.com')/calendars",
"value": [
{
"id": "**snipped**_MRaRoNlRUYsQkAAAAABwPAAA=",
"name": "Calendar",
"color": "lightBlue",
"hexColor": "#a6d1f5",
"isDefaultCalendar": true,
"changeKey": "rX0CNBsSo0inAqdEAWRRmQAFRAI=",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": true,
"isRemovable": false,
"owner": {
"name": "Bob Smith",
"address": "Bob.Smith#contoso.com"
}
},
{
"id": "**snipped**_MRaRoNlRUYsQkAAApN6VAAAA=",
"name": "Calendar",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "dt7cZZK/jEWkaDZUVGLEJAAGY8x28w==",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "Bob Smith",
"address": "Bob.Smith#contoso.com"
}
}
]
}
I have no access to the software creating events, it's a third party SaaS system.
In the short term, one way to do this would be to fetch the calendar by id, then use the query parameters to customize the response using the changeKey. The longer term solution would be to engage your exchange admin to help with setting the right calendar for the users in question, which will eliminate the two calendars returned by graph.

How can I setup taxes and make them included in the subscription price paypal sdk

So I live in europe and we are obligated to have taxes already included in the price displayed to the user and I was wondering how I could do this with Paypal sdk.
My billing_plan_attributes:
billing_plan_attributes = {
"name": request.args['name'],
"description": request.args['description'],
"merchant_preferences": {
"auto_bill_amount": "yes",
"cancel_url": "https://ruby-eu.com/profile/settings/paypal/cancel/token",
"initial_fail_amount_action": "continue",
"max_fail_attempts": "1",
"return_url": 'https://ruby-eu.com/profile/settings/paypal/subscribe/execute',
"setup_fee": {
"currency": request.args['currency'],
"value": request.args['setup_fee']
}
},
"payment_definitions": [
{
"amount": {
"currency": request.args['currency'],
"value": request.args['amount']
},
"cycles": request.args['cycles'],
"frequency": request.args['frequency'],
"frequency_interval": request.args['frequency_interval'],
"name": request.args['payment_name'],
"type": request.args['payment_type'],
}
],
"type": request.args['type']
}
I tried adding
"taxes": {
"percentage": "23",
"inclusive": True
}
inside merchant_preferences, payment_defenitions and under type but when I run it they return
Problem while creating a new plan: Incoming JSON request does not map to API request
and I don't know how could I fix this issue.
In case you're wondering if the problem is somewhere else I removed the taxes from the JSON and run and it worked.
First of all know that the depcrecated billing plan object in the Python SDK does NOT correspond to the new plans object in the new Subscriptions API. If you want to use the Subscriptions API (and you probably should), you need to integrate with direct HTTPS API calls, NOT any of the old SDKs. Basically, look at the CURL calls you see here: https://developer.paypal.com/docs/subscriptions/integrate/ ... and implement their equivalents from Python.
The billing plans objects of the Subscriptions API do support the syntax you were trying to add, so my guess is that is where you got it from: https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create

Optional claims in access token of azure missing for in_corp, vnet etc

I have been trying to get accesstoken with flag of in_corp and vent of the company within access token. I have added optional claims in manifest file, however it is not coming in access token.
"accessToken": [
{
"name": "in_corp",
"source": null,
"essential": true,
"additionalProperties": []
},
{
"name": "vnet",
"source": null,
"essential": true,
"additionalProperties": []
},
{
"name": "fwd",
"source": null,
"essential": true,
"additionalProperties": []
},
{
"name": "nickname",
"source": null,
"essential": true,
"additionalProperties": []
}
],
From office network I have been checking the token. Is there anything
in Azure AD security settings that needs to be checked?
No, there is nothing else needed to be done to get the optional claims. If there is a value for it, it will exit in the token. Your company must have configured ADFS, and your account is Synchronized to azure ad.
where should I ensure whether I am using V1 or V2?
You can check the value of accessTokenAcceptedVersion in manifest. Refer to this for the details.
if we are using V1, what are the steps to get the token from V2 then?
You can find the v1.0 and v2.0 optional claims set here.
In conclusion, though you added the optional claims, you still didn't get these claims since there are no values mapped with them.

Resources