How is the flow to collect subscriptions?

0

I am trying to implement the following flow Plans and Subscriptions

When I get to the step of subscribing a client to a plan the header says: "Make a POST specifying the identifier of the plan and the customer to be associated (the customer must have charged a default_card to which they will be charged, suitable for subscription payments)"

Even though I have searched a lot I can not find what is referred to with default_card , I deduce that it must be a card simply assigned to the client so I follow the following guide Customer and Cards

When I arrive at the end I can make the payment perfectly but this is not what I want since I want to subscribe my user to a plan, so I keep researching and I find this Charge with cards

To create a card assigned to a user, he says:

curl -X POST \
    -H 'accept: application/json' \
    -H 'content-type: application/json' \
    'https://api.mercadopago.com/v1/customers/[CUSTOMER_ID]/cards?access_token=TEST-7019883171081771-051423-224e9f156ecb76b25f428a9c7f69ae78-117317563' \
    -d '{"token": "ff8080814c11e237014c1ff593b57b4d"}'

Where that token I send is the token that generates for the card:

  • I know that the algorithm to generate it is correct because I have been able to enter payments (although not subscriptions).

The answer is:

{
"message": "invalid parameters ",
"error": "bad_request",
"status": 400,
"cause": [
    []
]

}

Evidently this is a bug or in the documentation or in the same application.

I have tried other combinations for example sending all the information of the card that I have available and not only the token, this has not worked.

Could someone help me isolate the problem?

    
asked by user1336321 20.07.2018 в 13:32
source

0 answers