paypal trial recurring payment not getting started - paypal

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.

Related

paypal error processing payment bmcreatebutton

I am creating Paypal buttons on the fly for shopping cart processing. I've used Express Checkout with no issues but the client does not want customers to have to complete the billing details on the EC page, using Hosted Payment buttons seems to be the solution.
I create the button using the NVP code sending the following:
(
[L_BUTTONVAR0] => business=emailaddress
[L_BUTTONVAR1] => paymentaction=sale
[L_BUTTONVAR2] => currency_code=AUD
[L_BUTTONVAR3] => cancel_return=http://localhost/orders/view/335774
[L_BUTTONVAR4] => notify_url=http://localhost/orders/complete_hostedpaypal/335774
[L_BUTTONVAR5] => return=http://localhost/orders/view/335774
[L_BUTTONVAR6] => invoice=Order #335774
[L_BUTTONVAR7] => subtotal=167.40
[L_BUTTONVAR8] => tax=2
[L_BUTTONVAR9] => shipping=3
[L_BUTTONVAR10] => handling=4
[L_BUTTONVAR11] => template=templateC
[L_BUTTONVAR12] => first_name=TEST
[L_BUTTONVAR13] => last_name=ORDER
[L_BUTTONVAR14] => buyer_email=emailaddress
[L_BUTTONVAR15] => address1=PO Box 2633
[L_BUTTONVAR16] => address2=
[L_BUTTONVAR17] => city=TAREN POINT
[L_BUTTONVAR18] => state=NSW
[L_BUTTONVAR19] => country=AU
[L_BUTTONVAR20] => zip=2229
[L_BUTTONVAR21] => billing_first_name=TEST
[L_BUTTONVAR22] => billing_last_name=ORDER
[L_BUTTONVAR23] => billing_address1=PO Box 2633
[L_BUTTONVAR24] => billing_address2=
[L_BUTTONVAR25] => billing_city=TAREN POINT
[L_BUTTONVAR26] => billing_state=NSW
[L_BUTTONVAR27] => billing_country=AU
[L_BUTTONVAR28] => billing_zip=2229
[L_BUTTONVAR29] => showBillingAddress=false
[L_BUTTONVAR30] => showShippingAddress=false
[L_BUTTONVAR31] => address_override=false
[L_BUTTONVAR32] => bn=AUD
[L_BUTTONVAR33] => lc=AU
[METHOD] => BMCreateButton
[BUTTONCODE] => TOKEN
[BUTTONTYPE] => PAYMENT
[USER] => [api_user]
[PWD] => [api_pwd]
[SIGNATURE] => [api_sig]
[VERSION] => 109.0
)
This returns ACK "Success" and the relevant code for the button and links...
When I navigate to the link the Paypal page https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?hosted_button_id=HSSS-BPdXvwvPaocw3NpZuxuIhGZuRL1DXlbqFgOo1BvzVYWKoSNjWyYwVilsDmt-QRxxvPmrlA shows:
Error Processing Payment
Error Message "This transaction can't be processed. Please pay with another card."
I emailed Paypal Merchant Services but have not had a response for some weeks now. Does anyone have any ideas?
I have upgraded the sandbox to pro.
I made a test using your parameters and generated a payment link, it worked for me(got redirected to templateC page and made a card payment). I used my own test pro account though. Are you seeing the error after you entered card info? If so you may create a fake credit card number on this page, step 4,
https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1413&viewlocale=en_US&direct=en

Cannot get invoice in respose of CreateRecurringPaymentsProfile in 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?

Recurring payment payflow error response "Invalid tender"

I am trying to create recurring profile and I get his log output with error
[METHOD] => CreateRecurringPaymentsProfile
[SUBSCRIBERNAME] => testuser
[PROFILESTARTDATE] => 2014-05-14T16:01:36-04:00
[DESC] => Monthly Payment for Package:Package 4
[MAXFAILEDPAYMENTS] => 1
[AUTOBILLOUTAMT] => NoAutoBill
[TRIALBILLINGPERIOD] => Month
[TRIALBILLINGFREQUENCY] => 1
[TRIALTOTALBILLINGCYCLES] => 1
[TRIALAMT] => 129.00
[BILLINGPERIOD] => Month
[BILLINGFREQUENCY] => 12
[TOTALBILLINGCYCLES] => 0
[AMT] => 129.00
[CURRENCYCODE] => USD
[CREDITCARDTYPE] => MasterCard
[ACCT] => 5473878247587096
[EXPDATE] => 012015
[CVV2] => 962
[STARTDATE] =>
[ISSUENUMBER] =>
[FIRSTNAME] => John
[LASTNAME] => Doe
[STREET] => 1324 Adams Street
[CITY] => Omaha
[STATE] => AL
[COUNTRYCODE] => US
[ZIP] => 68138
[PHONENUM] => 1402935200
[L_PAYMENTREQUEST_0_L_ITEMCATEGORY0] => Digital
[L_PAYMENTREQUEST_0_L_NAME0] => Package 4
[L_PAYMENTREQUEST_0_L_DESC0] => test package
[L_PAYMENTREQUEST_0_L_AMT0] => 129.00
[L_PAYMENTREQUEST_0_L_NUMBER0] => 4
[L_PAYMENTREQUEST_0_L_QTY0] => 3500
RESULT=2&PNREF=A7X06BD15AD4&RESPMSG=Invalid tender.
The description suggests that merchant account does not support said credit card.But in my manager.paypal.com account I see visa/master and other credit cards are supported. I tried with visa/master , for both I get same error. May be I missing something, please help out.
I have paypal payments advanced subscription.
Sounds like maybe you're signed up for Payments Pro, but not for Recurring Payments, which is an add-on feature.
According to the PayPal PayFlow API documentation, receiving a result with the status "2" means:
Invalid tender type. Your merchant bank account does not support the
following credit card type that was submitted.
Source: https://developer.paypal.com/docs/classic/payflow/integration-guide/#result-values-and-respmsg-text

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.