Get Instant Solutions for Kubernetes, Databases, Docker and more
Braintree Recurring is a powerful tool that facilitates subscription billing and management for businesses. It is part of the Braintree suite of payment solutions, which allows developers to integrate seamless payment processing into their applications. The recurring billing feature is particularly useful for businesses that offer subscription-based services, enabling automated billing cycles and customer management.
When integrating Braintree Recurring into your application, you might encounter the error code 91509. This error typically manifests when attempting to create or update a subscription with an invalid trial duration. The error message might read: "Invalid trial duration." This indicates that the trial period specified does not meet the criteria set by Braintree.
The error code 91509 is triggered when the trial duration for a subscription is set incorrectly. Braintree imposes certain limits on the trial period, and any value outside these limits will result in this error. The trial duration must be a positive integer and should not exceed the maximum allowed duration set by Braintree.
To resolve the 91509 error, follow these steps:
Ensure that the trial duration is a positive integer and within the allowed limits. Check Braintree's documentation for the maximum trial period allowed. You can find more information on trial periods in the Braintree Recurring Billing Guide.
Review the code where the subscription is created or updated. Ensure that the trial duration is set correctly. Here is an example of how to set the trial duration:
subscription = gateway.subscription.create({
"payment_method_token": "the_payment_method_token",
"plan_id": "the_plan_id",
"trial_period": true,
"trial_duration": 14,
"trial_duration_unit": "day"
})
In this example, the trial duration is set to 14 days. Adjust the value as necessary.
After updating the code, test the subscription creation process to ensure that the error is resolved. Use Braintree's testing environment to verify the changes without affecting live data.
By following these steps, you should be able to resolve the 91509 error related to invalid trial durations in Braintree Recurring. Always ensure that your trial periods comply with Braintree's guidelines to avoid similar issues in the future. For further assistance, refer to Braintree's official documentation or reach out to their support team.
(Perfect for DevOps & SREs)
Try Doctor Droid — your AI SRE that auto-triages alerts, debugs issues, and finds the root cause for you.