Is it possible to change only AMT using UpdateRecurringPaymentsProfile PayPal? - paypal

This question has been posted elsewhere however I have not found a specific answer yet.
What I want to do is simply change the amount (AMT) of a PayPal recurring payments profile from say £55.00 to £60.00. The amount is all I want to change. I am using the below to do this:
$request_params = array
(
'USER' => $api_username,
'PWD' => $api_password,
'SIGNATURE' => $api_signature,
'VERSION' => $api_version,
'METHOD' => 'UpdateRecurringPaymentsProfile',
'PROFILEID' => 'I-R159ACHCUJHF',
'AMT' => '60.00',
'NOTE' => 'Re-adjust amount to £60'
);
OR
&USER=xxxxxxx&PWD=123456789&SIGNATURE=xyxyxyxyxyxyx&VERSION=85.0&METHOD=UpdateRecurringPaymentsProfile&PROFILEID=I-R159ACHCUJHF&AMT=11.00&NOTE=Re-adjust+amount+to+%C2%A360&TAXAMT=0.00
So I guess my question is can this be done using the fields above only or do you know if I am missing some other variables that are required possibly?
On another note, when I run this on the sandbox I get the following error:
Array
(
[TIMESTAMP] => 2014-11-28T10:11:36Z
[CORRELATIONID] => 9a5452736a159
[ACK] => Failure
[L_ERRORCODE0] => 10001
[L_SHORTMESSAGE0] => Internal Error
[L_LONGMESSAGE0] => Timeout processing request
)
Does anyone understand what this means and if it relates to the way I am requesting the change in amount (AMT) in the params above?
Many thanks in advance.

According to the example I'm cribbing from, you also need to pass CURRENCYCODE. The only example I could actually find was on PayPal Developer Brazil:
https://www.paypal-brasil.com.br/desenvolvedores/code-sample/recurring-payments-php/

Related

PayPal Orders v2: TRANSACTION_REFUSED and UNPROCESSABLE_ENTITY

Good day, Paypal is not working on my website, which is a wordpress site. I am getting this error. Can anyone help?
Array
(
[code] => 40003
[userinfo] => Array
(
[error] => The requested action could not be performed, semantically incorrect, or failed business validation.
[data] => Array
(
[name] => UNPROCESSABLE_ENTITY
[details] => Array
(
[0] => Array
(
[issue] => TRANSACTION_REFUSED
[description] => The request was refused
)
)
[message] => The requested action could not be performed, semantically incorrect, or failed business validation.
[debug_id] => d438b2beb9f7c
[links] => Array
(
[0] => Array
(
[href] => https://developer.paypal.com/docs/api/orders/v2/#error-TRANSACTION_REFUSED
[rel] => information_link
[method] => GET
The important part of the error message is "TRANSACTION_REFUSED". Because it was refused the request is unprocessable as a general matter, but other things can also lead to an unprocessable request.
Why was it refused? Usually an issue with the payer. However, if all payments to your account are being refused, then it is an issue with the receiving account. What is the country of the account? It may be missing some setup to be able to receive funds, such as a required withdrawal method for certain countries. Contact PayPal for details.

Paypal Refund NVP API : You do not have permission to refund this transaction

i Am using Paypal NVP Refund Api For Refund Paypal Transaction.
All Things are ok but when i try to rung api, it gives me below Response.
Array
(
[TIMESTAMP] => 2017-07-17T13:58:24Z
[CORRELATIONID] => xxxxxxxxxx
[ACK] => Failure
[VERSION] => 51.0
[BUILD] => 36458220
[L_ERRORCODE0] => 10007
[L_SHORTMESSAGE0] => Permission denied
[L_LONGMESSAGE0] => You do not have permission to refund this transaction
[L_SEVERITYCODE0] => Error
)
is that some process i miss to call.?
After giving permission same issue exists.
Then I found I missed an argument..
I'm sending this request.
$nvpreq = array(
'USER' => '',
'PWD' => '',
'SIGNATURE' => '',
'METHOD'=> 'RefundTransaction',
'VERSION' => urlencode('94'),
'TRANSACTIONID' => 'xxxxxxxx',
'REFUNDTYPE' => 'Partial',
'AMT' => '0.01',
'CURRENCYCODE' => 'USD');
I forgot to add 'SUBJECT' => 'reiceversemail#gmail.com',.
Now it is working.
Here is the some causes of this error.
You used the wrong transaction ID.
You're trying to make the call for a third party and have the wrong
email address in the subject.
The subject account hasn't given you permission to make the
third-party call.
Here is link you can check this. Why did I get API error code 10007?

Paypal error 580029 One of the required parameters for subscription is missing

When I try to make a preapproval this message comes up instead of showing me the Paypal login screen. Usually it is more specific, but now it just says "One of the required parameters for subscription is missing", so
I would like to know what is the parameter missing?.
Is this related to the APP ID?
It worked fine in Sandbox but when going live I have this error.
Preapproval adaptive-preapproval
Error
PayPal\Types\AP\PreapprovalResponse Object
[responseEnvelope] => PayPal\Types\Common\ResponseEnvelope Object
(
[timestamp] => 2016-01-06T11:02:03.894-08:00
[ack] => Failure
[correlationId] => 4d382b98c6be4
[build] => 17820627
)
[preapprovalKey] =>
[error] => Array
(
[0] => PayPal\Types\Common\ErrorData Object
(
[errorId] => 580029
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => One of the required parameters for subscription is missing
[exceptionId] =>
[parameter] => Array
(
[0] => PayPal\Types\Common\ErrorParameter Object
(
[name] =>
[value] => Subscription
)
)
)
)
Request
PayPal\Types\AP\PreapprovalRequest Object
[requestEnvelope] => PayPal\Types\Common\RequestEnvelope Object
(
[detailLevel] =>
[errorLanguage] => en_US
)
[clientDetails] => PayPal\Types\Common\ClientDetailsType Object
(
[ipAddress] =>
[deviceId] =>
[applicationId] => MY_APP_NAME
[model] =>
[geoLocation] =>
[customerType] =>
[partnerName] =>
[customerId] =>
)
[cancelUrl] => http://localhost/auction/create-auction/?post_new_step=1&projectid=181
[currencyCode] => CAD
[dateOfMonth] =>
[dayOfWeek] =>
[endingDate] => 2016-02-05Z
[maxAmountPerPayment] =>
[maxNumberOfPayments] =>
[maxNumberOfPaymentsPerPeriod] => 1
[maxTotalAmountOfAllPayments] => 1.5
[paymentPeriod] => NO_PERIOD_SPECIFIED
[returnUrl] => http://localhost/auction/?page_id=10&finalize=1&post_new_step=4&projectid=181
[memo] =>
[ipnNotificationUrl] =>
[senderEmail] =>
[startingDate] => 2016-01-06Z
[pinType] =>
[feesPayer] =>
[displayMaxTotalAmount] => 1
[requireInstantFundingSource] =>
[sender] =>
I just experienced the same issue.
I resolved it by filling out all of the "Max*" fields.
In my case, I was missing the "maxNumberOfPaymentsPerPeriod" field.
Successfully created a approval token for a "one-time" payment with the following request:
cancelUrl: "http://localhost:55182/Booking/InitialBookingRequest?StartDate=7/1/2016 1:15:00 AM&EndDate=7/1/2016 2:15:00 AM&ListingId=119295&bookingId=90802" string
clientDetails: null
currencyCode: "USD"
dateOfMonth: null
dayOfWeek: null
displayMaxTotalAmount: null
endingDate: "2016-07-15"
feesPayer: null
ipnNotificationUrl: "http://localhost:55182/home/handler"
maxAmountPerPayment: 5.00
maxNumberOfPayments: 1
maxNumberOfPaymentsPerPeriod: 1
maxTotalAmountOfAllPayments: 5.00
memo: null
paymentPeriod: null
pinType: null
requireInstantFundingSource: null
returnUrl: "http://localhost:55182/booking/Success?StartDate=7/1/2016 1:15:00 AM&EndDate=7/1/2016 2:15:00 AM&ListingId=119295&bookingId=90802" string
sender: null
senderEmail: null
startingDate: "2016-06-30"
We have been battling with this issue too, and it seems it comes up on the internet quite a bit. Unfortunately, the PayPal documentation lists most fields as Optional, when they aren't.
What fields are actually optional depends on the type of Pre-approval you are using (there is Subscription / One-time / On-demand), but none of this seems to be mentioned in the PayPal API documentation.
Looking at your request, I believe the one field you will also need to specify is maxAmountPerPayment, which in your case would be the same as maxTotalAmountOfAllPayments
Although the error is cryptic, it is in fact informing you that for a Subscription type of Pre-approval, you are missing some required fields. Unfortuantely these required fields are not documented. If it turns out maxAmountPerPayment doesn't work, my advice would be to start populating each field and testing until the request passes! Good luck.

How do you get the shipping address back from an Adaptive Payment API call?

How are you supposed to get the shipping info back from a Parallel Payment, using PayPal's Adaptive API system? Normally it would just get passed back as payer_country, etc - when the IPN script is requested. However, this doesn't seem to be the case.
Here are the params being passed in when the IPN script is called:
transaction[0].amount
transaction[0].id
verify_sign
transaction[1].receiver
reverse_all_parallel_payments_on_error
transaction[1].pending_reason
transaction[0].pending_reason
transaction[1].id_for_sender_txn
transaction[0].invoiceId
payment_request_date
test_ipn
cancel_url
charset
return_url
transaction[0].status_for_sender_txn
ipn_notification_url
transaction[1].is_primary_receiver
transaction[1].status
transaction_type
transaction[1].amount
transaction[0].status
log_default_shipping_address_in_transaction
transaction[0].receiver
status
transaction[0].id_for_sender_txn
action_type
fees_payer
pay_key
transaction[1].status_for_sender_txn
transaction[0].paymentType
transaction[1].invoiceId
transaction[1].id
sender_email
notify_version
transaction[1].paymentType
transaction[0].is_primary_receiver
If I then do a PaymentDetails API call, I get back stuff like:
$VAR1 = {
'currencyCode' => 'USD',
'responseEnvelope' => {
'correlationId' => '9944330ab9a8c',
'timestamp' => '2014-04-07T06:08:16.094-07:00',
'ack' => 'Success',
'build' => '10273932'
},
'status' => 'COMPLETED',
'senderEmail' => 'andy.aaaa#ultranerds.co.uk',
'cancelUrl' => 'http://somesite.net/paypal/cancel.html',
'paymentInfoList' => {
'paymentInfo' => [
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'NY3AD33DD739C',
'email' => 'andy-xxx#ultranerds.com',
'amount' => '65.00',
'invoiceId' => '1022',
'primary' => 'false',
'paymentType' => 'GOODS'
},
'transactionId' => '8E1114341X895213Y',
'senderTransactionStatus' => 'COMPLETED',
'senderTransactionId' => '5EV71352C33256006',
'transactionStatus' => 'COMPLETED',
'refundedAmount' => '0.00'
},
{
'pendingRefund' => 'false',
'receiver' => {
'accountId' => 'YYP5C69YWCMKE',
'email' => 'andy.yyy#gmail.com',
'amount' => '15.00',
'invoiceId' => '1023',
'primary' => 'false',
'paymentType' => 'GOODS'
},
'transactionId' => '68H86656UP574062X',
'senderTransactionStatus' => 'COMPLETED',
'senderTransactionId' => '2XW88939LK1112523',
'transactionStatus' => 'COMPLETED',
'refundedAmount' => '0.00'
}
]
},
'feesPayer' => 'EACHRECEIVER',
'actionType' => 'CREATE',
'ipnNotificationUrl' => 'http://somesite.net/paypal/test_ipn.cgi',
'sender' => {
'useCredentials' => 'false',
'accountId' => 'B74RBM5F6SLZG',
'email' => 'andy.aaa#ultranerds.co.uk'
},
'returnUrl' => 'http://somesite.net/paypal/success.html',
'payKey' => 'AP-4EK17906VB6613533',
'reverseAllParallelPaymentsOnError' => 'false'
};
As you can see, there is no reference to the delivery address at all. How are you supposed to get that info back?
UPDATE: Mmm ok, so it looks like GetShippingAddresses is what I need - but for some reason its coming back with nothing in when I call it:
{"requestEnvelope":{"errorLanguage":"en_US","detailLevel":"ReturnAll"},"key":"AP-1B1377463N9785350"} /GetShippingAddresses_API_Operation/
...simply returns:
{
'responseEnvelope' => {
'correlationId' => '3a4443aed09c9',
'timestamp' => '2014-04-07T06:40:35.460-07:00',
'ack' => 'Success',
'build' => '10273932'
}
}
I'm a bit baffled as to why its doing that. Any suggestions?
I found a quote here:
http://go.developer.ebay.com/devzone/articles/using-paypals-adaptive-payments-and-google-app-engine-build-online-market-python-part-3
Unfortunately, although this follows the process recommended by
PayPal's documentation, it doesn't work. There's currently a bug in
PayPal's Adaptive Payments implementation. For a traditional payment,
the shipping address is not collected; for embedded payments, the
GetShippingAddresses call does not return the shipping address.
PayPal has acknowledged the bug and indicated that it expects to have
this fixed in April 2011. If you need shipping addresses right now,
the recommendation is to collect them on your site rather than relying
on the PayPal API.
That was from 2011... but is this still the case??
Sorry to bump - but has anyone got any suggestions?
Ok, well I got my answer - but unfortunately its not what I was hoping for:
Yes, unfortunately this feature is only available for embedded payment
flow.
https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-embeddedPayment-curl-etc/
If you're using embedded payment flow, then you can retrieve the
address on their PayPal account by passing in
senderOptions.requireShippingAddressSelection = true during
SetPaymentOption API call. You can then retrieve it via
GetShippingAddresses API call.
So it looks like really what I need to do, is ask the user to provide their shipping information BEFORE sending them to paypal, then storing it. Not ideal - but I guess you just have to work with what you got!

PayPal address_override integration to PayPal Express Checkout

I'm trying to set up PayPal address_override at my shop checkout as my customers have already filled in their delivery details.
I'm using express checkout, and following on from reading the documentation here: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/
I've got the following basic set up added into my working express checkout code (perl file):
# -- build the request for Paypal
my $response = $useragent->post($api_endpoint,
[
'METHOD' => 'SetExpressCheckout',
'VERSION' => '3.0',
'PWD' => $API_PASSWORD,
'USER' => $API_USERNAME,
'SIGNATURE' => $API_SIGNATURE,
'Amt' => $amount,
'PAYMENTACTION' => 'Sale',
'ReturnUrl' => $returnurl,
'CANCELURL' => $cancelurl,
'CURRENCYCODE' => $API_CURRENCYCODE,
'address_override' => '1',
'address1' => $d_address1,
'address2' => $d_address2,
'city' => $d_city,
'country' => $country,
'zip' => $d_post_code
]
);
However this isn't overriding the address when I get through to my PayPal account, it's still just showing my stored addresses.
I've read this post:
Paypal | Website Payment Standard | Adddress Override
And this one:
Paypal Address Override not working
Hopefully someone can show me where I'm going wrong, or if I've missed a step! Any help appreciated.
I may be wrong here but that API link you've pasted doesn't look like it's the same API that the rest of your code sample is using?
Searching for SetExpressCheckout leads to this page: https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
I think you need to use the ADDROVERRIDE parameter instead of address_override and whatever else you need from that page.