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

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.

Related

Adaptive Payment Partial Refund Functionality

I am sending the request like below and getting error in response. Please help me what I did wrong. Thanks .
My Request :-
requestEnvelope.errorLanguage=en_US&requestEnvelope.detailLevel=ReturnAll
&payKey=AP-0VR709562K128704J&receiverList.receiver(0).email=buyer#abc.com&receiverList.receiver(0).amount=14.00¤cyCode=GBP
My Response :-
Array
(
[responseEnvelope.timestamp] => 2017-02-24T05:50:55.589-08:00
[responseEnvelope.ack] => Failure
[responseEnvelope.correlationId] => 66bf1bad1aa91
[responseEnvelope.build] => 30051544
[error(0).errorId] => 589037
[error(0).domain] => PLATFORM
[error(0).subdomain] => Application
[error(0).severity] => Error
[error(0).category] => Application
[error(0).message] => The refund's receiver buyer#abc.com wasn't part of the payment request
[error(0).parameter(0)] => buyer#abc.com
)
I got a solution for this. In request We need to send receiver (seller) email not buyer email and it will automatically send refund to the appropriate receiver.
So the answer will be
requestEnvelope.errorLanguage=en_US
&requestEnvelope.detailLevel=ReturnAll
&payKey=AP-0VR709562K128704J
&receiverList.receiver(0).email=api_email#apiemail.com
&receiverList.receiver(0).amount=14.00
¤cyCode=GBP
and we will get the responce like
Array
(
[responseEnvelope.timestamp] => 2017-04-05T07:34:25.622-07:00
[responseEnvelope.ack] => Success
[responseEnvelope.correlationId] => 3a31df57541f3
[responseEnvelope.build] => 31096492
[currencyCode] => GBP
[refundInfoList.refundInfo(0).receiver.amount] => 19.02
[refundInfoList.refundInfo(0).receiver.email] => api_email#apiemail.com
[refundInfoList.refundInfo(0).refundStatus] => REFUNDED
[refundInfoList.refundInfo(0).refundNetAmount] => 18.37
[refundInfoList.refundInfo(0).refundFeeAmount] => 0.65
[refundInfoList.refundInfo(0).refundGrossAmount] => 19.02
[refundInfoList.refundInfo(0).totalOfAllRefunds] => 39.04
[refundInfoList.refundInfo(0).refundHasBecomeFull] => false
[refundInfoList.refundInfo(0).encryptedRefundTransactionId] => 00487139PD976194Y
[refundInfoList.refundInfo(0).refundTransactionStatus] => COMPLETED
)

PayPal pre-approval giving error

I have used PayPal api in which first i do preapproval and then make chained payment using that approval key. Everything works fine on my local server. But as on live its giving me below error.
Preapproval
Error
PreapprovalResponse Object
(
[responseEnvelope] => ResponseEnvelope Object
(
[timestamp] => 2015-05-01T08:38:40.374-07:00
[ack] => Failure
[correlationId] => 88fffca2a737c
[build] => 15743565
)
[preapprovalKey] =>
[error] => Array
(
[0] => ErrorData Object
(
[errorId] => 580001
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => Invalid request: Data validation warning(line -1, col 0): null
[exceptionId] =>
[parameter] => Array
(
[0] => ErrorParameter Object
(
[name] =>
[value] => Data validation warning(line -1, col 0): null
)
[1] => ErrorParameter Object
(
[name] =>
[value] => Data validation warning(line -1, col 0): null
)
)
)
)
)
My request is
requestEnvelope.errorLanguage=en_US&cancelUrl=http%3A%2F%2Fredesignbox.com%2Fopendemo%2Fhappyfund%2Fcheckout&currencyCode=RUB&maxAmountPerPayment=1%2C032.00&maxNumberOfPayments=1&maxTotalAmountOfAllPayments=1%2C032.00&returnUrl=http%3A%2F%2Fredesignbox.com%2Fopendemo%2Fhappyfund%2Fcheckout_action%2Faction%2FafterApproval&startingDate=2015-05-01&feesPayer=PRIMARYRECEIVER
Response is
responseEnvelope.timestamp=2015-05-01T08%3A38%3A40.374-07%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=88fffca2a737c&responseEnvelope.build=15743565&error(0).errorId=580001&error(0).domain=PLATFORM&error(0).subdomain=Application&error(0).severity=Error&error(0).category=Application&error(0).message=Invalid+request%3A+Data+validation+warning%28line+-1%2C+col+0%29%3A+null&error(0).parameter(0)=Data+validation+warning%28line+-1%2C+col+0%29%3A+null&error(0).parameter(1)=Data+validation+warning%28line+-1%2C+col+0%29%3A+null
What's wrong i cannot understand.
EDIT
On local my ssl version is
OpenSSL/0.9.8y and
on live its NSS/3.16.2.3 Basic ECC
$maxpaymentss = floor(2000/68.50);
$data = array(
'ClientDetails' => array(
'applicationId' => 'My_APP',
),
'returnUrl' => 'http://www.yourdomain.com/success.html',
'cancelUrl' => 'http://www.yourdomain.com/cancel.html',
'startingDate' => gmdate("Y-m-d\TH:i:s\Z"),
'endingDate' => gmdate("Y-m-d\TH:i:s\Z"),
'maxAmountPerPayment' => 68.50,
'maxNumberOfPayments' => $maxpaymentss,
'maxTotalAmountOfAllPayments' => 2000.00,
'maxNumberOfPaymentsPerPeriod' => 1,
'currencyCode' => 'USD',
'requestEnvelope' => array(
'errorLanguage' => 'en_US',
'detailLevel' => 'ReturnAll'
)
);
these are the required fields for the live mode of PayPal adaptive preapproval.
Remove the "," in the "maxAmountPerPayment" and "maxTotalAmountOfAllPayments" field and try again . It should work fine

adaptive Chained Payments failed code 520009 - account is restricted

I am trying to set up a chained payment (working perfectly for the sandbox environment), but am getting error 520009 (Account is restricted) for live .
First reply response form PayPal
Array
(
[responseEnvelope] => Array
(
[timestamp] => 2014-05-08T00:18:05.168-07:00
[ack] => Failure
[correlationId] => 16ead17a17432
[build] => 10680030
)
[error] => Array
(
[0] => Array
(
[errorId] => 520009
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => Account XXXX#gmail.com is restricted
[parameter] => Array
(
[0] => XXXX#gmail.com
)
)
)
Second response form paypal for "SetPaymentOptions response" =
Array
(
[responseEnvelope] => Array
(
[timestamp] => 2014-05-08T00:18:06.185-07:00
[ack] => Failure
[correlationId] => b569e8963ed54
[build] => 10680030
)
[error] => Array
(
[0] => Array
(
[errorId] => 580022
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => Invalid request parameter: payKey with value
[parameter] => Array
(
[0] => payKey
[1] =>
)
)
)
)
If you are getting an "Account Restricted" error in the live environment then your PayPal account is restricted. Visit the Resolution Center within your PayPal account to determine why. You may have to contact customer service to resolve.

Paypal API GetVerifiedStatus return User is not allowed to perform this action

Hy,
I would like to use GetVerifiedStatus of Paypal API.
So I have create my application and I have an application ID.
In sandbox, all is ok, the service return the status of my customer.
But when I make a live call I have this error :
"User is not allowed to perform this action"
Do you have a solution?
Thanks!
Request :
Array
(
[emailAddress] => myCustomer#email.com
[matchCriteria] => NONE
)
Response :
stdClass Object
(
[responseEnvelope] => stdClass Object
(
[timestamp] => 2013-10-29T06:47:26.456-07:00
[ack] => Failure
[correlationId] => 21820ac9a046c
[build] => 7784095
)
[error] => Array
(
[0] => stdClass Object
(
[errorId] => 550001
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => User is not allowed to perform this action
)
)
)
(Paypal GetVerifiedStatus with "User is not allowed to perform this action" : This is not the same problem because he update the error with "Cannot determine PayPal Account status")
In order to perform the GetVerifiedStatus call in a live environment, you need to pass also firstName and lastName in the arguments, and they need to be consistent with those of the PayPal account for the email address you are checking. You also need to set matchCriteria to 'NAME'. So, your request would look like:
Array (
[emailAddress] => myCustomer#email.com
[firstName] => myCustomerFirstName
[lastName] => myCustomerLastName
[matchCriteria] => NAME
)
Try updating the merchant PayPal account to a business account and verify it.

making Order in Paypal Parallel Express Checkout

I am trying to place Order with Parallel Paypal Express Checkout. Here is the API implementation.
I am using PAYMENTREQUEST_0_PAYMENTACTION => Order in SetExpressCheckout and in DoExpressChecoutPayment and it gives error (this is required).
When I use PAYMENTREQUEST_0_PAYMENTACTION => Order in SetExpressCheckout and PAYMENTREQUEST_0_PAYMENTACTION => Sale in DoExpressChecoutPayment it works.
All goes well until DoExpressChecoutPayment. Please check this
DoExpressCheckoutPayment Request
(
[TOKEN] => EC-4U931568VK402050F
[PAYERID] => BFSU67Z2LX5FJ
[VERSION] => 97.0
[METHOD] => DoExpressCheckoutPayment
[USER] => 'user'
[PWD] => 'pwd'
[SIGNATURE] => 'sig'
[PAYMENTREQUEST_0_PAYMENTACTION] => ORDER
[PAYMENTREQUEST_0_AMT] => 200.00
[PAYMENTREQUEST_0_CURRENCYCODE] => EUR
[PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID] => vendortwo2#yhaoo.com
[PAYMENTREQUEST_0_PAYMENTREQUESTID] => 25935
[PAYMENTREQUEST_1_PAYMENTACTION] => ORDER
[PAYMENTREQUEST_1_AMT] => 22.00
[PAYMENTREQUEST_1_CURRENCYCODE] => EUR
[PAYMENTREQUEST_1_SELLERPAYPALACCOUNTID] => vendorone#yahoo.com
[PAYMENTREQUEST_1_PAYMENTREQUESTID] => 25934
)
and response from this is:
(
[TOKEN] => EC-4U931568VK402050F
[SUCCESSPAGEREDIRECTREQUESTED] => false
[TIMESTAMP] => 2013-09-26T10:08:27Z
[CORRELATIONID] => 2381c85a926e3
[ACK] => Failure
[VERSION] => 97.0
[BUILD] => 7882219
[INSURANCEOPTIONSELECTED] => false
[SHIPPINGOPTIONISDEFAULT] => false
[PAYMENTINFO_0_PAYMENTSTATUS] => Failed
[PAYMENTINFO_0_SELLERPAYPALACCOUNTID] => vendortwo2#yhaoo.com
[PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => DRM9QQUAG9UNC
[PAYMENTINFO_0_PAYMENTREQUESTID] => 25935
[PAYMENTINFO_0_ERRORCODE] => 10001
[PAYMENTINFO_0_SHORTMESSAGE] => Internal Error
[PAYMENTINFO_0_LONGMESSAGE] => Internal Error
[PAYMENTINFO_0_SEVERITYCODE] => Error
[PAYMENTINFO_0_ACK] => Failure
[PAYMENTINFO_1_PAYMENTSTATUS] => Failed
[PAYMENTINFO_1_SELLERPAYPALACCOUNTID] => vendorone#yahoo.com
[PAYMENTINFO_1_SECUREMERCHANTACCOUNTID] => M7HT95CA3PUCE
[PAYMENTINFO_1_PAYMENTREQUESTID] => 25934
[PAYMENTINFO_1_ERRORCODE] => 10001
[PAYMENTINFO_1_SHORTMESSAGE] => Internal Error
[PAYMENTINFO_1_LONGMESSAGE] => Internal Error
[PAYMENTINFO_1_SEVERITYCODE] => Error
[PAYMENTINFO_1_ACK] => Failure
)
I have asked same question here.
Internal error came because wrong type of account ids are assigned to PAYMENTINFO_0_SELLERPAYPALACCOUNTID and PAYMENTINFO_1_SELLERPAYPALACCOUNTID in DoExpressCheckoutPayment request. Accounts assigned are personal, they should be paypal Business Accounts instead. that was the reason of "Internal Error". Thanks