Closed Natelegreat1 closed 3 years ago
@Natelegreat1 Which Mastercard API you are trying to connect? From the response it looks like you are getting error response which isn't in JSON format.
@piyuhirpara I was trying:
@Natelegreat1
Could you please paste request response logs from the sample app for Open Banking service call.
For Transaction Notifications, correct end point is : https://sandbox.api.mastercard.com/cardbasedconsent/ For more details please refer documentation available here.
@piyuhirpara I am using https://api.mastercard.com/openbanking/sandbox/connect/api/ for Open Banking service call - same AFError. Using https://sandbox.api.mastercard.com/cardbasedconsent/ for Transaction Notifications and also getting the same error.
Maybe you can spot something that I changed by mistake?
Transaction Notification APIs support two calls.
GET https://sandbox.api.mastercard.com/cardbasedconsent/consents/{card_reference}
POST https://sandbox.api.mastercard.com/cardbasedconsent/transactions
The screenshot suggests that you are doing a POST on https://sandbox.api.mastercard.com/cardbasedconsent
without the transactions
, unless I miss seeing it the right way.
Could you please make the call using the insomnia plugin first to make sure your keys work with the endpoint correctly before trying out the Swift library?
@Natelegreat1,
In Addition to above answer from Ramson,
You also need to change "payload" according to API endpoint requirement.
Setup
Xcode 12.2 (12B45b)
Issue
Hello. I am trying to run the sample (Example) project. I have added my consumerKey, private key certificate & key password. I have tried several services for
urlString
:No matter what I try, I get the following error:
Alamofire.AFError.responseSerializationFailed(reason: Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(error: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.}))
Any ideas?