Open abdullahmoh21 opened 2 weeks ago
Hello, thank you for your questions.
https://sandbox.api.getsafepay.com/order/payments/v3/
and send the customer id in the body like this after creating the customer
{ user: "cus_99642a9a-704e-4fff-bb49-067a6949ba11"}
it is required by safepay so the user will have to enter the address every time they make a payment by entering their card details
there is an endpoint to do that but it is not supported in the sdk so you will have to call the endpoint https://sandbox.api.getsafepay.com/api/v1/payments/track_27ca0d9e-80a4-46cc-abc0-fd095e3d09bc
to fetch the payment details
it is not supported in the sdk but you can call this endpoint to refund a payment https://sandbox.api.getsafepay.com/payments/v3/track_27ca0d9e-80a4-46cc-abc0-fd095e3d09bc/refund
or you can also go to your merchant dashboard to do that
what is the status of your tracker
at this point?
thank you for your response. I have been having some issues with the refund endpoint and the "get payment status" endpoint. when i call the endpoint GET https://sandbox.api.getsafepay.com/api/v1/payments/${tracker}
i simply get served the safepay.com homepage (I am assuming this is a catch all for requests). here is how i am calling it:
const options = {
method: 'get',
maxBodyLength: Infinity,
url: `https://sandbox.api.getsafepay.com/api/v3/payments/${tracker}`,
headers: {
'X-SFPY-MERCHANT-SECRET': process.env.SAFEPAY_SECRET_KEY,
},
}
try {
const response = await axios(options);
logger.info(`Safepay Response: ${JSON.stringify(response.data, null, 2)}`);
return res.status(200).json(response.data);
} catch (error) {
logger.error(`Error getting payment status: ${error}`);
return res.status(500).json({'message': 'No response was returned'}); // Internal Server Error
}
why is this happening? is the endpoint url incorrect? Also i assumed the method would be GET, is this the case? The api docs are extremely lacking in this regard. are the v1 api docs somewhere else? because there is no mention of these endpoints here
(in response to 5.) : my payment is completed when i am calling the refund endpoint. do you see any issue with how i am calling the refund endpoint(code above)?
(in response to 1. ) : would it be possible to create the payment using the SDK's await safepay.payments.create
method and then add customer data later using the endpoint you mentioned? or if i want to add customer data will i have to do everything via endpoint?
here is the html i receive when trying to access a payment details:
I have a few questions about current behavior of the SDK:
Is there any way to add user data to my payment so that user does not have to enter details every time at checkout(other than user creating a Safepay account)? For example, if i create a customer using the following endpoint: POST https://dev.api.getsafepay.com/user/customers/v1 , is there any way to add said customer when i create a payment using:
I do not require user's physical address. is there way i can generate a checkout link that does not ask user for this input or this required by Safepay?
Is there any specific endpoint i can call to get the status of a transaction using the above tracker token? or is a webhook the only way to get a pending transactions status updates?
Is there a way to create refunds using the SDK. or does one have to call the refund endpoint for that.
while attempting to call the refund endpoint. I keep getting a HTTP 500 error. Since this is an error on your end how should i navigate around this? or do you send 500 codes for bad requests as well? here is my relevant node code:
package: "@sfpy/node-sdk": "^3.0.1" When i send above response here are my debug logs:
Please let me know why I am receiving a 500 code and if there is anything i can do to fix it.
Thank you in advance!