but when i am reading the doc :
/**
* Sets Subscription Plan Id.
* The id of the subscription plan, if there is one.
*
* @maps subscription_plan_id
*/
so where should i guess the ID ?
Because when i am trying to put ID i have error
{"errors":[{"category":"INVALID_REQUEST_ERROR","code":"INVALID_VALUE","detail":"[merchant_token=ML0NMDX8JSNVV] Object `#WEECALLER` of type SUBSCRIPTION_PLAN_VARIATION references an object with token `WEECALLER123456789`, which does not exist. Expected an object of type SUBSCRIPTION_PLAN.","field":"subscription_plan_id"}]}
Did you first create the subscription plan? In the documentation you first create the plan to generate the subscription_plan_id. Then you pass it in when creating the variation.
@Bryan-Square I get what you say. We need to create a Subscription Plan before trying to create a Subscription Plan Variation in order to create a Subscription.
So Iām trying to create a Subscription Plan as described in the docsā¦ but then I found I need to send this array āeligible_category_idsā, and if I left it in blank because I donāt have any, it fails.
Note: It failed with all_items as true (because I wanted to make all items subscribable under this Plan), so I tried again but with all_items as false and it worked. I wasnāt convinced anyways because I wanted to make all the items subscribable, so I tried again with all_items as true and it worked this timeā¦
This flow looks inconsistent and I canāt trust 100% on it, but Iāll take it since Stripe is not working for iOS on my app and I need to make subscriptions purchases available on my app.
@amity Try creating first a Plan Subscription and then create a Plan Variation.
@Bryan-Square Thereās still an issue. API wonāt let me create a Plan Variation that costs $1, it says it must be greater than $100. How is it possible I cannot reate a Plan Variation less than $100? am I missing something?
Thanks for help, i created my subscription, i will try full process now.
But I still have one issue about card_id, i am using basic payment in JS.
How should I retrieve card_id ? I dont see in response when user submit credit card ā¦
I am trying to link card object to my customer, but during creation card i have this
{āerrorsā:[{ācategoryā:āINVALID_REQUEST_ERRORā,ācodeā:āINVALID_CARD_DATAā,ādetailā:āInvalid card data.ā,āfieldā:āsource_idā}]}
I am following POST /v2/cards - Square API Reference (squareup.com)
$body = new \Square\Models\CreateCardRequest(
Str::uuid()->toString(),
$data['sourceId'],
$card
);
$data[āsourceIdā] is coming from data processPayment request (from front side)
Whatās wrong ?
Mmh no, why should i do that ?
I am using test card yes, so i am sending sourceId of this test card.
I want to simulate full process subscription to put this in production for my website.
Our test values are mainly for generating tokens with the Web Payments SDK and walking through various buyer verification scenarios. They donāt work well when being saved on file and charged. If thatās the scenario you need to test we recommend using cnon:card-nonce-ok.