We created a user on authorize.net with the following data:
Customer profile ID : 901961001
Payment Profile ID: Payment ProfileID: 901782940
Now on Woocommerce API, we have the following JSON that we try to run to create the subscription:
{
"customer_id": 80595,
"status": "active",
"billing_period": "month",
"billing_interval": 3,
"start_date": "2021-10-08 19:45:00",
"next_payment_date":"2021-10-08 19:48:00",
"payment_method": "authorize_net_cim_credit_card",
"payment_details":{
"post_meta": {
"_wc_authorize_net_cim_credit_card_customer_id":"901961001",
"_wc_authorize_net_cim_payment_profile_id ": "901782940",
"_wc_authorize_net_cim_credit_card_payment_token": "901782940"
}
},
"billing": {
"first_name": "check6",
"last_name": "check6",
"address_1": "check6",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US",
"email": "check6@example.com",
"phone": "(555) 555-5555"
},
"shipping": {
"first_name": "check6",
"last_name": "check6",
"address_1": "check6",
"address_2": "",
"city": "San Francisco",
"state": "CA",
"postcode": "94103",
"country": "US"
},
"line_items": [
{
"product_id": 33704,
"quantity": 3
}
],
"shipping_lines": [
{
"method_id": "flat_rate",
"method_title": "Flat Rate",
"total": "10"
}
],
"meta_data": [
{
"key": "_custom_subscription_meta",
"value": "custom meta"
}
]
}
Well.. the subscription does get created BUT when it's time for the renewal we get the following error: Authorize.Net Credit Card Payment Failed (Subscription Renewal: payment token is missing/invalid.) Order status changed from Pending payment to Failed.
How do we pass the correct payment token thru woocommerce subscriptions api?