Cannot get invoice in respose of CreateRecurringPaymentsProfile in paypal - paypal
My intention is to create a Recurring Profile and pass a company_id as custom parameter to be stored IPN database, where I can create a relation between payment and for which company it was done.
I have read that while creating Recurring Payment Profile to get some custom value in IPN database, you should pass it in PROFILEREFERENCE parameter and then retrieve it from rp_invoice_id in response.
I cannot get the desired output
My request:
$inputData = array(
'METHOD' => 'CreateRecurringPaymentsProfile',
'TOKEN' => $_GET['token'], //get from GetExpressCheckout
'PAYERID' => $billerInfo['PAYERID'], //from GetExpressCheckout response
'PROFILESTARTDATE' => date("Y-m-d h:i:s", strtotime("+5 seconds")), //2012-05-11T00:00:00Z #Billing date start, in UTC/GMT format
'DESC' => 'LeaveBuddy: subscription amount is $' . $bill .' for the provided service ($12 per user per year).', //#Profile description - same as billing agreement description
'BILLINGPERIOD' => 'Year', #Period of time between billings
'BILLINGFREQUENCY' => 1,#Frequency of charges
'AMT' => 10, //Todo: dynamically calculate the amt #The amount the buyer will pay in a payment period
'CURRENCYCODE' => 'USD',#The currency, e.g. US dollars
'COUNTRYCODE' => 'US',#The country code, e.g. US
'MAXFAILEDPAYMENTS' => '0',#Maximum failed payments before suspension of the profile
'PROFILEREFERENCE' => 'companyid=1', //my custom value
);
The response that I am getting is:
{"InstantPaymentNotification":{"id":"553db30b-ea1c-4f68-8b5d-4fe5cbdd56cb","notify_version":"3.8","verify_sign":"A--8MSCLabuvN8L.-MHjxC9uypBtAQZom1C7.mbS1Jv-J898ZO0eeOr9","test_ipn":"1","address_city":null,"address_country":null,"address_country_code":null,"address_name":null,"address_state":null,"address_status":null,"address_street":null,"address_zip":null,"first_name":"code","last_name":"booster","payer_business_name":null,"payer_email":"codebooster#gmail.com","payer_id":"XXXXXXXX","payer_status":"verified","contact_phone":null,"residence_country":"US","business":null,"item_name":null,"item_number":null,"quantity":null,"receiver_email":"boom#gmail.com","receiver_id":null,"custom":null,"invoice":null,"memo":null,"option_name1":null,"option_name2":null,"option_selection1":null,"option_selection2":null,"tax":"0.00","auth_id":null,"auth_exp":null,"auth_amount":null,"auth_status":null,"num_cart_items":null,"parent_txn_id":null,"payment_date":null,"payment_status":null,"payment_type":null,"pending_reason":null,"reason_code":null,"remaining_settle":null,"shipping_method":null,"shipping":"0.00","transaction_entity":null,"txn_id":"316859739","txn_type":"recurring_payment","exchange_rate":null,"mc_currency":null,"mc_fee":null,"mc_gross":10,"mc_handling":null,"mc_shipping":null,"payment_fee":null,"payment_gross":null,"settle_amount":null,"settle_currency":null,"auction_buyer_id":null,"auction_closing_date":null,"auction_multi_item":null,"for_auction":null,"subscr_date":null,"subscr_effective":null,"period1":null,"period2":null,"period3":null,"amount1":null,"amount2":null,"amount3":null,"mc_amount1":null,"mc_amount2":null,"mc_amount3":null,"recurring":null,"reattempt":null,"retry_at":null,"recur_times":null,"username":null,"password":null,"subscr_id":null,"case_id":null,"case_type":null,"case_creation_date":null,"created":"2015-04-27 03:54:51","modified":"2015-04-27 03:54:51"},"PaypalItem":[]}
So i cannot find any [rp_invoice_id] parameter here, and my invoice is also appearing null. Can any one tell me what I am missing?
Related
paypal trial recurring payment not getting started
I have created a paypal recurring payment with a trial period of 1 month. I am testing with my sandbox account. After completing 1 payment I can see in my sandbox merchant account that the recurring payment has been created. But it's displaying: "recurring cycle remaining 1 month" and I have received $0. I mean the recurring payment has been started, but I am not receiving the money. Is that paypal's fault or is there a problem with my code? Well I am using a CMS(Social Eninge) . Paypal has been integrated here already . So I am just modifying it. Here is the parameters I am sending. // This Portion to display the payment summery : $params['driverSpecificParams']['PayPal'] = array( 'ITEMCATEGORY'=> 'Digital', 'AMT' => $params['price'], 'NAME' => $package->title, 'DESC' => $desc, 'ITEMS' => array( array( 'NAME' => $package->title, 'AMT' => $params['price'], 'QTY' => 1, ), ), 'BILLINGTYPE' => 'RecurringPayments', 'BILLINGAGREEMENTDESCRIPTION' => $desc, ); // And this portion for payment subscription. $rpData = array( 'TOKEN' => $params['token'], 'PROFILEREFERENCE' => $order->order_id, 'PROFILESTARTDATE' => $data['TIMESTAMP'], 'DESC' => $desc, //Item Description 'BILLINGPERIOD' => ucfirst($package->recurrence_type), 'BILLINGFREQUENCY' => $package->recurrence, 'INITAMT' => 0 , 'TRIALBILLINGPERIOD' => ucfirst($package->recurrence_type), 'TRIALBILLINGFREQUENCY' => $package->recurrence, 'TRIALTOTALBILLINGCYCLES' => 1, 'TRIALAMT' => $_SESSION["price"], 'AMT' => $package->price, 'CURRENCYCODE' => $this->getGateway()->getCurrency(), ); I would also like to know whether setting $0 for a few months in my trial period will work or not ? Paypal displaying like this : [1]: https://i.stack.imgur.com/mSxk1.png
Well, I have found my code is right. It's paypal's delay for few hours. Also setting $0 for trial period works perfectly. Trial period automatically choose the starting interval. You need to pass for how many days ,months, year, or week you wanna offer trial and which price, it might be lower price or zero doesn't matters.Like I am offering 1st month free/some reduced price after that it will continue the normal price.
Send User Email address with payer information in paypal REST API
hi friends i am using paypal REST API in my eCommerce website. all are works fine. what i need is, i have to send user email with cart and payer information to store it in paypal. how can i do this? $items[] = array( 'name' => $product_name, 'quantity' => 1, 'price' => $cart_item['amount'], 'sku' => $current['uid'], 'currency' => 'USD' ); $credit_card = array( 'type'=> $cc_card_type, 'number' => $cc_card_number, 'expire_month'=>$cc_card_month, 'expire_year'=>$cc_card_year, 'cvv2'=>$cc_card_cvv2, 'first_name'=>$cc_first_name, 'last_name'=>$cc_last_name ); $result = pay_direct_with_credit_card($credit_card, PP_CURRENCY , $total_amount, $items, $payment_desc) ;
You can do that by providing payer_info object See: Payment Object > Payer > payer_info object Hth..
PayFlow PayPal recurring Payment EXPDATE Validation
Hi I have been trying to validate CC no., CVV no., EXPDATE of the users credit card for recurring billing in PayFlow. The main objective is to let the user have access to subscription products only if the credit card is valid. I have been advised to check the card prior to creating the profile you could run a credit card verification ($0 authorization) So I did it and I got [RESPMSG] => Verified Here's my request and response messages: Request Array ( [TRXTYPE] => A [TENDER] => C [PARTNER] => PayPal [USER] => XXXXX [PWD] => XXXXX [AMT] => 0 [ACCT] => 5105105105105100 [EXPDATE] => 1218 [INVNUM] => PONUM1 [VERBOSITY] => HIGH [BILLTOZIP] => 95031 ) Response Array ( [RESULT] => 0 [PNREF] => A11A8C1A41C0 [RESPMSG] => Verified [AUTHCODE] => 992PNI [AVSADDR] => X [AVSZIP] => X [HOSTCODE] => A [PROCAVS] => U [TRANSTIME] => 2015-11-22 23:30:52 [AMT] => 0.00 [ACCT] => 5100 [EXPDATE] => 1218 [CARDTYPE] => 1 [IAVS] => X [PREFPSMSG] => No Rules Triggered [POSTFPSMSG] => No Rules Triggered ) Now my question is I haven't provided CVV2 and also Any future date as EXPDATE gets verified. Can you please explain how things are working here? Also how can I verify CC, CVV and EXPDATE ?
This is simply creating the profile without any initial payment. As such, it's not going to validate the card at all. Of course, the first payment attempted on the profile would fail. If you want to check the card prior to creating the profile you could run a credit card verification ($0 authorization). So run the card verification first, and then only if that is successful you would follow up with a call to create the profile. Keep in mind that if you're working in the sandbox any credit card expiration and security code will be accepted as long as it's not expired. This is done in the sandbox to make testing quick and easy. If you would like to force errors in the API response so you can test those cases, take a look at the PayFlow documentation on testing.
Yes in the Test mode any future date for EXPDATE will be fine as Andrew mentioned . If you are looking for CVV value to be returned as "N" in the test mode then you can adjust the CVV values according to the docs below . https://developer.paypal.com/webapps/developer/docs/classic/payflow/integration-guide/#testing-card-security-code NVP Request: VENDOR=XXX&PARTNER=Paypal&USER=XXXX&PWD=XXXX&TRXTYPE[1]=A&TENDER[1]=C&VERBOSITY=HIGH&ACCT[16]=5105105105105100&EXPDATE[4]=1020&AMT=0.00&**CVV2[3]=400**&COMMENT1[23]=Global Test Transaction&FIRSTNAME[4]=John&LASTNAME[5]=Smith&STREET=49354 Main&CITY[7]=SanJose&STATE[2]=CA&ZIP[5]=94303&COUNTRY[2]=US NVP Response: RESULT=0 PNREF=A71C8A7EA028 RESPMSG=Verified AUTHCODE=010101 AVSADDR=N AVSZIP=N CVV2MATCH=N HOSTCODE=A RESPTEXT=100 PROCAVS=I8 PROCCVV2=N TRANSTIME=2015-11-23 20:05:55 FIRSTNAME=John LASTNAME=Smith AMT=0.00 ACCT=5100 EXPDATE=1020 CARDTYPE=1 IAVS=N PREFPSMSG=No Rules Triggered POSTFPSMSG=No Rules Triggered
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.
PayPal response missing tax
I'm working on an NVP API integration and the entire payment process is working properly. The response I get from PayPal upon completion doesn't provide all the proper information. Here is the code I am sending PayPal &PAYMENTREQUEST_0_AMT=44.48 &PAYMENTREQUEST_0_ITEMAMT=40 &PAYMENTREQUEST_0_TAXAMT=4.48 &PAYMENTREQUEST_0_SHPPINGAMT=0 &PAYMENTREQUEST_0_INVNUM=5193f0cca7e70 &PAYMENTREQUEST_0_CURRENCYCODE=USD &PAYMENTREQUEST_0_DESC=Test payment desc &L_PAYMENTREQUEST_0_AMT0=40 &L_PAYMENTREQUEST_0_QTY0=1 &L_PAYMENTREQUEST_0_NAME0=Test item &L_PAYMENTREQUEST_0_NUMBER0=5191cd62462fb &L_PAYMENTREQUEST_0_DESC0=Test item desc &L_PAYMENTREQUEST_0_SHPPINGAMT0=0.00 &L_PAYMENTREQUEST_0_TAXAMT0=4.48 &RETURNURL=[REMOVED] &CANCELURL=[REMOVED] &BRANDNAME=Some Con 2014 &CUSTOMERSERVICENUMBER=000-000-0000 The order goes through and proper payment is processed, however the information given back is missing the tax information. [TOKEN] => EC-1KS56755YX305151R [SUCCESSPAGEREDIRECTREQUESTED] => false [TIMESTAMP] => 2013-05-15T20:48:42Z [CORRELATIONID] => 553a6a47ec1 [ACK] => Success [VERSION] => 98 [BUILD] => 5956203 [INSURANCEOPTIONSELECTED] => false [SHIPPINGOPTIONISDEFAULT] => false [PAYMENTINFO_0_TRANSACTIONID] => 1XV29769HY7702037 [PAYMENTINFO_0_TRANSACTIONTYPE] => expresscheckout [PAYMENTINFO_0_PAYMENTTYPE] => instant [PAYMENTINFO_0_ORDERTIME] => 2013-05-15T20:48:41Z [PAYMENTINFO_0_AMT] => 44.48 [PAYMENTINFO_0_FEEAMT] => 1.59 [PAYMENTINFO_0_TAXAMT] => 0.00 [PAYMENTINFO_0_CURRENCYCODE] => USD [PAYMENTINFO_0_PAYMENTSTATUS] => Completed [PAYMENTINFO_0_PENDINGREASON] => None [PAYMENTINFO_0_REASONCODE] => None [PAYMENTINFO_0_PROTECTIONELIGIBILITY] => Eligible [PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE] => ItemNotReceivedEligible,UnauthorizedPaymentEligible [PAYMENTINFO_0_SECUREMERCHANTACCOUNTID] => 3JTQYBPNDRWES [PAYMENTINFO_0_ERRORCODE] => 0 [PAYMENTINFO_0_ACK] => Success Why is PAYMENTINFO_0_TAXAMT coming back 0 when it is 4.48? I'm also having an issue where the email that is sent upon purchase from PayPal is not listing the items purchased and only a general total amount. Notice description is not the item description but the overall order description. ----------------------------------- Purchase Details ----------------------------------- Description: Test payment desc Unit price: $44.48 USD Qty: 1 Amount: $44.48 USD Subtotal: $44.48 USD
The tax is not being displayed because it is not getting passed over in your DoExpressCheckoutPayment API call. I checked the logs, and I only show that you passed it over in the SetExpressCheckout API call, but not the DoExpressCheckoutPayment API call. You would need to pass it over in the Do EC call if you are wanting it returned. This is also what is happening with your description. It is not getting passed over in the Do EC call.