Create method doesn"t work for me
atefrihane opened this issue · comments
Hi everyone,
I'm using this package to handle subscriptions in my project
it's already in PC2.0
the issue that whenever I call ChargeBee_Subscription::create method I get the following error :
This API operation is not enabled for this site. Please contact support@chargebee.com to get this enabled
Whereas I can use the other endpoints without any issue!
When I do the following it works just fine :
$result = ChargeBee_Customer::create(array(
"firstName" => "John",
"lastName" => "Doe",
"email" => "john@test.com",
"locale" => "fr-CA",
"billingAddress" => array(
"firstName" => "John",
"lastName" => "Doe",
"line1" => "PO Box 9999",
"city" => "Walnut",
"state" => "California",
"zip" => "91789",
"country" => "US",
),
));
ChargeBee_PaymentSource::createUsingToken(array(
"customerId" => "customer_id",
"tokenId" => "cb_token",
));
ChargeBee_Subscription::createWithItems("customer_id", array(
"subscriptionItems" => array(
array(
"itemPriceId" => "plan_id",
"quantity" => 1,
"itemType" => "plan"),
),
));
Though when doing the following it doesn't work :
$result = ChargeBee_Subscription::create(array(
"planId" => 'plan_id',
"autoCollection" => "off",
"billingAddress" => array(
"firstName" => "John",
"lastName" => "Doe",
"line1" => "PO Box 9999",
"city" => "Walnut",
"state" => "California",
"zip" => "91789",
"country" => "US"
),
"customer" => array(
"firstName" => "John",
"lastName" => "Doe",
"email" => "john@user.com"
)
));
Could you help me to know the reason?
Hey atefrihane, please go through the docs for PC2.0 https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=2#create_subscription_for_items and also this documentation will help you upgrade to PC 2.0 https://apidocs.chargebee.com/docs/api/upgrade?prod_cat_ver=2