txn_id and payment_status makes PayPal IPN unique? - paypal

I'm working with PayPal IPN and I have the following question: Is it possible, to have two IPN messages with the same txn_id and payment_status parameter?
For example:
IPN: txn_id=4BB79227HY951745W&payment_status=pending
IPN: txn_id=4BB79227HY951745W&payment_status=idontknowwhat
IPN: tnx_id=4BB79227HY951745W&payment_status=pending
IPN: txn_id=4BB79227HY951745W&payment_status=completed
So my question is basically that the txn_id and the payment_status together make the messages unique, or not?
Another example:
If I have an SQL query like:
SELECT * FROM transactions WHERE txn_id=4BB79227HY951745W AND payment_status=something
Can it returns with more than one rows? (If I don't store any messages re-sent by PayPal because of the lack of 200 OK response message or slow response time or anything like this.)
I read this thread before: PayPal IPN unique identifier . Here it sounds that these two parameters make the message unique, but i'm not sure.

I think that the txn_id and payment_status alone are not enough to make the IPN unique. Since in your case you want to save every IPN related to a given transaction, you should also check the pending_reason value:
Let's say you have created a transaction using the Authorization - Capture model and Your transaction goes through Instant Payment Review (IPR). You'll have something like this as IPN:
IPN 1: TXN goes into UNDER REVIEW (IPR)
[payment_status] => Pending
[txn_id] => 0CD48848U16230847
[pending_reason] => paymentreview
[txn_type] => express_checkout
[auth_status] => Pending
[ipn_track_id] => 8c7559d39005
IPN 2: TXN has passed IPR (Note that the pending reason has changed!)
[payment_status] => Pending
[txn_id] => 0CD48848U16230847
[pending_reason] => authorization
[txn_type] => express_checkout
[auth_status] => Pending
[ipn_track_id] => 8c7559d39005

Related

Paypal with multiple recurrent subscriptions only accepts the first one

Im trying to make a CreateRecurringPaymentsProfile on Paypal with two subscription items, but only works for the first one, the second one fails with "Failure" and returns an 11581 error ("Profile description is invalid").
What I do first is a SetExpressCheckout call with something like:
...
L_BILLINGTYPE0=RecurringPayments
L_BILLINGTYPE1=RecurringPayments
L_BILLINGAGREEMENTDESCRIPTION0=First subscription
L_BILLINGAGREEMENTDESCRIPTION1=Second subscription
...
I get a Success response, then I call CreateRecurringPaymentsProfile for each subscription item with all the required POST fields with their correct DESC field that matches the L_BILLINGAGREEMENTDESCRIPTION0 and L_BILLINGAGREEMENTDESCRIPTION1 in the SetExpressCheckout call.
The first subscription gets a Success response, but not the second one with the error mentioned above.
The DESC fields are short alphanumeric strings (Paypal wants a 127 string length limit).
Any ideas about what I am doing wrong?

Generate email once order is changed to filled in netsuite

Once someone clicks on the fulfill button on the Sales Order I want it to send an email to someone.How can make this occur in Netsuite?
You can create a custom workflow on sales order and configure the worflow to send email to the specific email id. The email id can be either custom one / a field value from the sales order record (ex. customer, salesperson etc.,)
The condition for the workflow will be
OldRecord.Status!="Pending Fulfillment" && NewRecord.Status!="Pending Fulfillment"
Thanks
Frederick D
you can write a user event on Item Fulfillment record type and send email using nlapiSendEmail()
You may want to put a check in script if type == 'create' to avoid sending email on other record operation.

REST: If the procedure is a DB UPDATE command, should your API call strictly be PUT?

Consider the following invoice table with two entries, id 1 and 2:
id, item, date_paid
1, 'apple', ''
2, 'banana', ''
When a payment is made date_paid column needs to be updated.
What is a proper REST verb for this?
POST invoices/1/payments
or
PUT invoices/1/payments
I feel like POST is proper since I am "adding" a payment detail but then again internally I'm actually "updating" a DB row so PUT seems applicable also.
If I understand your example, you have an invoice that was created in your Invoice table at some point in the past. You're now updating said invoice to reflect that a payment was made. That's definitely an update and PUT is the correct verb. Presumably you might also have a Payment table with the actual payment details (amount, payer, etc.). If so, then that's where you would be adding a new payment record. That call would be a POST.

PayPal Transaction Search API does not return any result

I am calling PayPal API transaction Search [SOAP] from java and getting no results .
Here are my search Parameters
Transaction start date :- 04-Mar-2012
InvoiceId :- '1000010'
However the response is SUCCESS but with NO payment transactions.
I checked and this payment is present in my account [ created today ] .
Details :
1) sdk jar file : "merchant-java-sdk-1.2.95.jar"
2) Related properties/configuration file values.
service.Binding=SOAP
service.RedirectURL=https://www.sandbox.paypal.com/webscr&cmd=
service.DevCentralURL=https://developer.paypal.com
service.EndPoint.PayPalAPI=https://api-3t.sandbox.paypal.com/2.0
service.EndPoint.PayPalAPIAA=https://api-3t.sandbox.paypal.com/2.0
If you are currently pointing to sandbox, there is an issue that is preventing the TransactionSearch API from working correctly when searching via the invoice id. For example if you did a search just based on the start date, you should get results back.

What is the length and type of PayPal's transaction ID (txn_id)?

I want to store PayPal transaction IDs. What is the length and type I need to set on that field in the database? Currently, I set varchar(128). Is that sufficient?
In the transaction search API it suggests the maximum length of a transaction ID is 19 single bytes. The transaction id is alphanumeric so a varchar(19) would be fine.
Personally I'd go for varchar(20) just in case they max out on transaction ids and need to add an extra digit :)
parent_txn_id In the case of a refund, reversal, or canceled reversal, this variable contains the txn_id of the original transaction, while txn_id contains a new ID for the new transaction.
Length: 19 characters
Type: String