php - Emisión de reembolsos de Paypal Adaptive Payments
codeigniter paypal-adaptive-payments (1)
revisa la documentación dice por PayPal aquí
Turkish Lira TRY
NOTE:This currency is supported as a payment currency and a currency balance for in-country PayPal accounts only.
Estoy tratando de reembolsar un pago encadenado de pago adaptativo totalmente al remitente, pero estoy atascado. Estoy usando CodeIgniter y la asombrosa biblioteca de Andrew Angell para pagos adaptativos.
El reembolso que deseo hacer tiene detalles como este: (puede ver las solicitudes XML sin procesar y responde a continuación)
Array
(
[Errors] => Array
(
)
[Ack] => Success
[Build] => 5472483
[CorrelationID] => 4d31bf900a109
[Timestamp] => 2013-03-20T09:45:02.585-07:00
[ActionType] => PAY_PRIMARY
[CancelURL] => http://my-cancel-url.com
[CurrencyCode] => TRY
[FeesPayer] => PRIMARYRECEIVER
[FundingTypes] => Array
(
)
[IPNNotificationURL] =>
[Memo] =>
[PayKey] => my-paykey
[PaymentInfo] => Array
(
[PendingRefund] => false
[RefundAmount] => 0.00
[SenderTransactionID] =>
[SenderTransactionStatus] => COMPLETED
[TransactionID] => my-transaction-id
[TransactionStatus] => COMPLETED
)
[PreapprovalKey] =>
[ReturnURL] => http://success-url-area.com
[ReverseAllParallelPaymentsOnError] => false
[SenderEmail] => [email protected]
[Status] => INCOMPLETE
[TrackingID] =>
[Receiver] => Array
(
[Amount] => 5.00
[Email] => [email protected]
[InvoiceID] =>
[PaymentType] => SERVICE
[Primary] => true
)
[XMLRequest] => <?xml version="1.0" encoding="utf-8"?><PaymentDetailsRequest xmlns="http://svcs.paypal.com/types/ap"><requestEnvelope xmlns=""><detailLevel>ReturnAll</detailLevel><errorLanguage>en_US</errorLanguage></requestEnvelope><payKey xmlns="">my-paykey</payKey></PaymentDetailsRequest>
[XMLResponse] => <?xml version=''1.0'' encoding=''UTF-8''?><ns2:PaymentDetailsResponse xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-03-20T09:45:02.585-07:00</timestamp><ack>Success</ack><correlationId>4d31bf900a109</correlationId><build>5472483</build></responseEnvelope><cancelUrl>http://my-cancel-url.com</cancelUrl><currencyCode>TRY</currencyCode><paymentInfoList><paymentInfo><transactionId>my-transaction-id</transactionId><transactionStatus>COMPLETED</transactionStatus><receiver><amount>5.00</amount><email>[email protected]</email><primary>true</primary><paymentType>SERVICE</paymentType><accountId>7VYWTSCQKWPAL</accountId></receiver><refundedAmount>0.00</refundedAmount><pendingRefund>false</pendingRefund><senderTransactionId>7P642947V2872150G</senderTransactionId><senderTransactionStatus>COMPLETED</senderTransactionStatus></paymentInfo><paymentInfo><receiver><amount>4.60</amount><email>[email protected]</email><primary>false</primary><paymentType>SERVICE</paymentType><accountId>7UZSWUVKCU4UW</accountId></receiver><refundedAmount>0.00</refundedAmount><pendingRefund>false</pendingRefund></paymentInfo></paymentInfoList><returnUrl>http://success-url-area.com</returnUrl><senderEmail>[email protected]</senderEmail><status>INCOMPLETE</status><payKey>my-paykey</payKey><actionType>PAY_PRIMARY</actionType><feesPayer>PRIMARYRECEIVER</feesPayer><reverseAllParallelPaymentsOnError>false</reverseAllParallelPaymentsOnError><sender><email>[email protected]</email><accountId>Y2BSLXZ8DQYY2</accountId><useCredentials>false</useCredentials></sender></ns2:PaymentDetailsResponse>
)
Cuando trato de ejecutar el reembolso, proporcionando la clave de pago, la identificación de la transacción (que recibí de la solicitud anterior) y el correo electrónico del remitente (que recibirá un reembolso) aparece este error (puede ver la solicitud sin procesar y las respuestas a continuación):
Array
(
[Errors] => Array
(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 589061
[ExceptionID] =>
[Message] => The receiver [email protected] is invalid for this refund
[Parameter] => [email protected]
[Severity] => Error
[Subdomain] => Application
)
)
[Ack] => Failure
[Build] => 5472483
[CorrelationID] => 2a1630b772ee0
[Timestamp] => 2013-03-20T09:52:10.986-07:00
[EncryptedTransactionID] =>
[RefundFeeAmount] =>
[RefundGrossAmount] =>
[RefundHasBecomeFull] =>
[RefundNetAmount] =>
[RefundStatus] =>
[RefundTransactionStatus] =>
[TotalOfAllRefunds] =>
[Receiver] => Array
(
[Amount] =>
[Email] =>
[InvoiceID] =>
[PaymentType] =>
[Primary] =>
)
[RawRequest] => <?xml version="1.0" encoding="utf-8"?><RefundRequest xmlns="http://svcs.paypal.com/types/ap"><requestEnvelope xmlns=""><detailLevel>ReturnAll</detailLevel><errorLanguage>en_US</errorLanguage></requestEnvelope><currencyCode>TRY</currencyCode><payKey xmlns="">my-paykey</payKey><receiverList xmlns=""><receiver xmlns=""><amount xmlns="">1.00</amount><email xmlns="">[email protected]</email><paymentType xmlns="">SERVICE</paymentType></receiver></receiverList><transactionId xmlns="">1VL98806A27476639</transactionId></RefundRequest>
[RawResponse] => <?xml version=''1.0'' encoding=''UTF-8''?><ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-03-20T09:52:10.986-07:00</timestamp><ack>Failure</ack><correlationId>2a1630b772ee0</correlationId><build>5472483</build></responseEnvelope><error><errorId>589061</errorId><domain>PLATFORM</domain><subdomain>Application</subdomain><severity>Error</severity><category>Application</category><message>The receiver [email protected] is invalid for this refund</message><parameter>[email protected]</parameter></error></ns3:FaultMessage>
)
1
Además, cuando no proporciono la identificación de la transacción y dejo el resto a PayPal, el problema cambia a esto (la solicitud XML sin formato se encuentra debajo de la matriz):
Array
(
[Errors] => Array
(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 589036
[ExceptionID] =>
[Message] => The currency code is missing or doesn''t match the code in the payment request
[Parameter] =>
[Severity] => Error
[Subdomain] => Application
)
)
[Ack] => Failure
[Build] => 5472483
[CorrelationID] => e3fc5e41040f3
[Timestamp] => 2013-03-20T10:02:29.233-07:00
[EncryptedTransactionID] =>
[RefundFeeAmount] =>
[RefundGrossAmount] =>
[RefundHasBecomeFull] =>
[RefundNetAmount] =>
[RefundStatus] =>
[RefundTransactionStatus] =>
[TotalOfAllRefunds] =>
[Receiver] => Array
(
[Amount] =>
[Email] =>
[InvoiceID] =>
[PaymentType] =>
[Primary] =>
)
[RawRequest] => <?xml version="1.0" encoding="utf-8"?><RefundRequest xmlns="http://svcs.paypal.com/types/ap"><requestEnvelope xmlns=""><detailLevel>ReturnAll</detailLevel><errorLanguage>en_US</errorLanguage></requestEnvelope><currencyCode>TRY</currencyCode><payKey xmlns="">AP-52A99028X8685964M</payKey><receiverList xmlns=""><receiver xmlns=""><amount xmlns="">1.00</amount><email xmlns="">[email protected]</email><paymentType xmlns="">SERVICE</paymentType></receiver></receiverList></RefundRequest>
[RawResponse] => <?xml version=''1.0'' encoding=''UTF-8''?><ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-03-20T10:02:29.233-07:00</timestamp><ack>Failure</ack><correlationId>e3fc5e41040f3</correlationId><build>5472483</build></responseEnvelope><error><errorId>589036</errorId><domain>PLATFORM</domain><subdomain>Application</subdomain><severity>Error</severity><category>Application</category><message>The currency code is missing or doesn''t match the code in the payment request</message></error></ns3:FaultMessage>
)
1
Como puede ver, ya he proporcionado el CurrencyCode, también la dirección de correo electrónico del remitente se toma de la solicitud para evitar errores tipográficos. Incluso si el código duro no cambia la situación.
¿Puedes ayudarme? ¿Qué me estoy perdiendo?
Gracias,