Zohaib Shamshad
Zohaib Shamshad

Reputation: 151

Paytabs recurring payment request with token is giving [422 - Unable to process your request] error

I created a token by Paytabs Tokenization method, then latter on used the generated token to request again using tran_class: recurring but I'm getting {'code': 422, 'message': 'Unable to process your request', 'trace': 'PMNT0102.65DCFAF6.0002C7A0'} as response

First time payment request payload

payload = {
    "profile_id": PROFILE_ID,
    "tran_type": "sale",
    "tran_class": "ecom",
    "cart_id": cart_id,
    "cart_currency": "EUR",
    "cart_amount": amount,
    "cart_description": "Advertising Services",
    "paypage_lang": "en",
    "customer_details": customer_details,
    "shipping_details": customer_details,
    "tokenise": 2,
    "callback": "url",
    "return": "url"
}

From above I get token which I save it for future payment request, but when I try to request using this token I get error {'code': 422, 'message': 'Unable to process your request', 'trace': 'PMNT0102.65DCFAF6.0002C7A0'}

Payment request payload with token

payload = {
    "profile_id": PROFILE_ID,
    "tran_type": "sale",
    "tran_class": "recurring",
    "cart_id": cart_id,
    "cart_currency": "EUR",
    "cart_amount": amount,
    "cart_description": "Advertising Services",
    "payment_token": payment_token,
    "tran_ref": tran_ref,
    "callback": "url",
    "return": "url"
}

Can anyone please guide what I'm doing wrong here

Upvotes: 0

Views: 257

Answers (1)

Mohammad Nemrawi
Mohammad Nemrawi

Reputation: 1

this error occurred because your profile did not enable recurring.

Upvotes: 0

Related Questions