I am trying to write in bash the code the partial refund paypal transaction. This is the guide I am following https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/ but I'm receiving a 520002 error message. In previous request I've seen that it's needed to specify receiverList.receiver(0).email but it's still not working.
This is what my request look like:
curl -s --insecure
-H "X-PAYPAL-SECURITY-USERID: api_username"
-H "X-PAYPAL-SECURITY-PASSWORD: api_password"
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: your_app_id "
https://svcs.sandbox.paypal.com/AdaptivePayments/Refund -d
"requestEnvelope.errorLanguage=en_US
&requestEnvelope.detailLevel=ReturnAll
&transactionId=xxxxxxxxxx
&receiverList.receiver(0).email=xxxxxxxx
¤cyCode=EUR
&receiverList.receiver(0).amount=44.00"
Anybody knows how to solve it?
I think you're using the wrong API for this.
Your endpoint goes to the Adaptive Payments API which is used for very specific business case and is very complicated to implement.
If you want to make a simple refund from a payment made with PayPal Express Checkout or PayPal Standard you should use the RefundTransaction API call.
https://developer.paypal.com/docs/classic/express-checkout/ht_basicRefund-curl-etc/
You CURL call should be like this:
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=merchant_user_name
&PWD=merchant_password
&SIGNATURE=merchant_signature
&METHOD=RefundTransaction
&VERSION=94
&TRANSACTIONID=transaction_ID #ID of the transaction for which the refund is made
&REFUNDTYPE=Full #Specifies a full refund; a partial refund requires more input fields
Related
To revise a paypal subscription I use the following curl translated to php:
curl -v -X POST https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-BW452GLLEP1G/revise
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '{
"plan_id": "P-5ML4271244454362WXNWU5NQ"
}'
I replaced the plan-id and subscription id with variables. But I receive the following error:
{
"name":"UNPROCESSABLE_ENTITY",
"message":"The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id":"1620f0049dfd6",
"details":[
{
"issue":"PAYMENT_IN_PROGRESS",
"description":"Payment for the subscription is in progress."
}
],
"links":[
{
"href":"https://developer.paypal.com/docs/api/v1/billing/subscriptions#UNPROCESSABLE_ENTITY",
"rel":"information_link",
"method":"GET"
}
]
}
I can't explain why this isn't working.
Could this be it?
The error "PAYMENT_IN_PROGRESS" is returned if you attempt to revise the billing details for a subscription within 24 hours of the next scheduled billing.
As the profile you referenced "_____________" has a daily billing cycle, you won't be able to revise the billing details for this subscription. Instead, you would need to cancel the existing subscription and create a new one with the relevant billing details which you wish to use.
I try export and import nifi templates via nifi rest api; but when i tried to delete controller-services, connections or import a template i get the response message "The revision must be specified." with '400 bad request' status from nifi rest api. I didn't understand what i have to do.
This my request for delete a control-service,
request "/controller-services/{id}" (id is, The controller service id.)
curl -X DELETE \
http://localhost:8090/nifi-api/controller-services/015b1030-a099-13d3-812c-77772afcaeb0 \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
and the response is "The revision must be specified."
status : "400 Bad Request"
Any idea please?
I finally got some answers about my mistake after reading this article
It seems you have to add two information to request url; version and clientId.
After make a call and get a component form nifi instance, it sends a version number inside a DTO to you as explained here
like this:
and finally i made a call like below and it worked:
curl -X DELETE \
'http://localhost:8090/nifi-api/controller-services/015b1030-a099-13d3-812c-77772afcaeb0?version=0&clientId=5ed15669-015d-1000-99cf-bc9c6f378085' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
Rundeck supports triggering jobs via their API. The API documentation is available under documentation.
We are using API version 13 which does not yet support application/json. Therefore i need to use the XML based request.
In my previous attempts, i always get the response:
<result error="true" apiversion="13">
<error code="api.error.job.options-invalid">
<message>Job options were not valid: Option 'container' is required. Option 'version' is required.
</message>
</error>
</result>
Since there is no example request provided, i am searching for an example payload to trigger the job.
As seen in the response i have to provide the parameters "container" and "version" since they are required.
My most recent request payload was:
<executeJob>
<argString>-container containerName -version 1234567</argString>
</executeJob>
I also tried different variations of this payload, every time with the same response.
This should help you, assuming you have a token to access Rundeck with authorization to run the job
curl -D - -X "POST" -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Rundeck-Auth-Token: <TOKEN>" \
-d '{"argString":"-arg1 val1 -arg2 val2"}' \
http://<URL>/api/16/job/<JOB_ID>/executions
I use Sandbox PayPal now in order to test payments.
So, I am trying to use ConvertCurrencyRequest and it returns very-very old data.
Is it a bug of sandbox?
curl -H "X-PAYPAL-SECURITY-USERID: <MYDATA>" -H "X-PAYPAL-SECURITY-PASSWORD: <MYDATA>" -H "X-PAYPAL-SECURITY-SIGNATURE: <MYDATA>" -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" -H "X-PAYPAL-SANDBOX-EMAIL-ADDRESS: <MYDATA>" -H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON" -H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON" -X POST -d '{"requestEnvelope" : {"detailLevel" : "ReturnAll","errorLanguage": "en_US"},"baseAmountList": [{ "currency" : { "code" : "USD", "amount" : "1" } }],"convertToCurrencyList": [{ "currencyCode" : "RUB" }]}' https://svcs.sandbox.paypal.com/AdaptivePayments/ConvertCurrency
This url returns
{"responseEnvelope":...,"estimatedAmountTable":{"currencyConversionList":[{"baseAmount":{"code":"USD","amount":"1"},"currencyList":{"currency":[{"code":"RUB","amount":"31.63"}]}}]}}
but,russian ruble costs about 50-66 RUB per USD at least 10 monthes.And more than 40 from Sept2014.Is this normal for Sandbox PayPal?
Yes, the database of currencies was frozen when created to reduce the amount of network resources required for the sandbox requirements. Sandbox environment is designed to test the implementation. After you see that the implementation works, switch to live credentials and you will get up-to-date information.
The example call in the PayPal Invoicing API documentation is returning an error?
Request
curl -s --insecure -H "X-PAYPAL-SECURITY-USERID: caller_1312486258_biz_api1.gmail.com" -H "X-PAYPAL-SECURITY-PASSWORD: 1312486294" -H "X-PAYPAL-SECURITY-SIGNATURE: AbtI7HV1xB428VygBUcIhARzxch4AL65.T18CTeylixNNxDZUu0iO87e" -H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON" -H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON" -H "X-PAYPAL-APPLICATION-ID:APP-80W284485P519543T" https://svcs.sandbox.paypal.com/Invoice/CreateAndSendInvoice -d {\"requestEnvelope\":{\"errorLanguage\":\"en_US\"},\"invoice\":{\"merchantEmail\":\"caller_1335455804_biz#x.com\",\"payerEmail\":\"sender_1335455648_per#x.com\",\"currencyCode\":\"USD\",\"paymentTerms\":\"DueOnReceipt\",\"itemList\":{\"item\":[{\"name\":\"BananaPlant\",\"quantity\":\"1\",\"unitPrice\":\"38.95\"},{\"name\":\"PeachTree\",\"quantity\":\"2\",\"unitPrice\":\"14.95\"}]}}}
Response
{"responseEnvelope":{"timestamp":"2013-08-22T23:58:47.340-07:00","ack":"Failure","correlationId":"4838886d6636b","build":"7236486"},"error":[{"errorId":"580001","domain":"PLATFORM","subdomain":"Application","severity":"Error","category":"Application","message":"Invalid request: {0}"}]}
Try wrapping the payload in the -d switch within "". Running the curl snippet with the -v switch as-is will show you that the payload gets truncated and hence the "Invalid request" error.
Also, you will see a "Invalid token" error when the merchantEmail in the request is not the same as the API caller. If you need to generate invoices on behalf of a third party (in which case the API caller and merchantEmail are naturally different), you must obtain third party permissions and attach a X-PAYPAL-AUTHORIZATION header to your request.