phplaravelcurlamazon-paypayfort

amazon payfort capture operation error: "Operation not allowed : CAPTURE"


I have started using the "Amazon payfort payment service", but I'm facing some issues. I am trying to get the transaction information based on the Api example, but I always get the error "Operation not allowed: CAPTURE" This is my curl request:

curl -H "Content-type: application/json" -XPOST -d '{   "command": "CAPTURE",   "access_code": "Xw************",   "merchant_identifier": "51*****",   "merchant_reference": "ORDR.90342",   "amount": 350100,   "currency": "SAR",   "language": "en",   "fort_id": "169996200001495787",   "signature": "942b11d7e204d433913383ca68fa03eb0c5eca34cec6c44f8e6869d4fcea795c" }' 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi'

And this is the server response:

{"response_code":"00034","amount":"350100","signature":"650003b1b6c8243a7ef7daec851a69cb0795212a92c6acc30b283d960c521224","merchant_identifier":"51*****","access_code":"X****************","language":"en","fort_id":"169996200001495787","command":"CAPTURE","response_message":"Operation not allowed : CAPTURE","merchant_reference":"ORDR.90342","currency":"SAR","status":"00"}

Solution

  • The problem was the purchase request, not the capture operation. i changed the command from PURCHASE to AUTHORIZATION, and now the capture request is working successfully. Thank you everyone.