LOCALECODE in paypal express checkout not working - paypal

In using paypal express chackout via "NVP http api" and I need to customize the gateway page locale.
Following the doc I tried:
LOCALECODE=ES
(but also checked using es_ES, en_US, ecc..)
The problem is that it always show the gateway in italian (I think it consider only the current merchant address).
This on Sandbox and Live env. too.
Now, I also read about this "Localizing the buyer's checkout experience in Express Checkout", where we can read:
The following are all taken into consideration to determine the locale of the checkout page:
The shipping address country provided by the merchant in the SetExpressCheckout request.
The country taken from the LocaleCode parameter passed by the merchant.
The country of the currently logged-in user.
The merchant's country.
the request is:
array:18 [▼
"USER" => "paypal-xxxxx"
"PWD" => "xxxxxx"
"SIGNATURE" => "xxxxx"
"VERSION" => 123
"METHOD" => "SetExpressCheckout"
"L_PAYMENTREQUEST_0_NAME0" => "my product"
"L_PAYMENTREQUEST_0_AMT0" => "364.78"
"L_PAYMENTREQUEST_0_QTY0" => 1
"PAYMENTREQUEST_0_ITEMAMT" => 364.78
"PAYMENTREQUEST_0_AMT" => 364.78
"PAYMENTREQUEST_0_PAYMENTACTION" => "Sale"
"PAYMENTREQUEST_0_CURRENCYCODE" => "EUR"
"PAYMENTREQUEST_0_DESC" => "customer #64637 Schowalter..."
"PAYMENTREQUEST_0_INVNUM" => "#64637"
"NOSHIPPING" => 1
"RETURNURL" => "http://mydomain.es/payment/success/64637"
"CANCELURL" => "http://mydomain.es"
"LOCALECODE" => "ES"
]
the endpoint is:
https://api-3t.sandbox.paypal.com/nvp
someone an help? just want to use spanish, because the website is spanish.

I don't know why but now it works, the correct LOCALECODE is the "full locale" so:
LOCALECODE=es_ES
I can only think that there is some kind of latency on sandbox.. after 3 tries, with "es_ES" finally the gateway is in spanish.

Related

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

Perl using USAePay billing module

I was wondering if anybody has experience using the USAePay billing module? I have reached out to the developer and his response was he does not have time to help people. My problem is this -
I have written the following code to add a customer's billing information using the Sandbox server but it looks as though the module defaults to the production server so each time I attempt to validate the transaction I get the response -
Card was rejected: Specified source key not found.
How do I tell it to use the Sandbox server?
use strict;
use warnings;
use Business::OnlinePayment;
use constant {
LOGIN => 'source key', #USAePay source key
PASSWORD => '12345', #USAePay PIN
};
my $tx = new Business::OnlinePayment("USAePay");
$tx->content(
login => LOGIN,
password => PASSWORD,
type => 'CC',
action => 'Recurring Authorization',
description => 'Business::OnlinePayment test',
amount => '49.95',
invoice_number => '100100',
name => 'Tofu Beast',
card_number => '4000100011112224',
expiration => '09/19',
address => '1234 Bean Curd Lane',
city => 'San Francisco',
state => 'CA',
zip => '94102',
);
$tx->submit();
if($tx->is_success()) {
print 'Card processed successfully: '.$tx->authorization.'\n';
} else {
print 'Card was rejected: '.$tx->error_message."\n";
}
As Business::OnlinePayment::USAePay is a processor for Business::OnlinePayment, but doesn't have a lot of docs itself, a look at the docs of Business::OnlinePayment might help. It reveales the test_transaction method.
Most processors provide a test mode, where submitted transactions will not actually be charged or added to your batch, calling this function with a true argument will turn that mode on if the processor supports it, or generate a fatal error if the processor does not support a test mode (which is probably better than accidentally making real charges).
An untested example:
my $tx = new Business::OnlinePayment("USAePay");
$tx->test_transaction; # here
$tx->content(
login => LOGIN,
password => PASSWORD,
type => 'CC',
action => 'Recurring Authorization',
description => 'Business::OnlinePayment test',
amount => '49.95',
invoice_number => '100100',
name => 'Tofu Beast',
card_number => '4000100011112224',
expiration => '09/19',
address => '1234 Bean Curd Lane',
city => 'San Francisco',
state => 'CA',
zip => '94102',
);
$tx->submit();
Digging a bit deeper in the source of Business::OnlinePayment::USAePay shows that this particular processor actually has three different test modes.
# test_transaction(0): normal mode
# 1 : test mode (validates formatting only)
# 2 : use sandbox server
# 3 : test mode on sandbox server
It looks like you can set the server details in the constructor - it takes an optional hash of parameters beyond the processor name.
Have you tried something like:
my $tx = new Business::OnlinePayment(
"USAePay",
Server => 'https://sandbox.usaepay.com/gate'
);

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?

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.

The X-PAYPAL-APPLICATION-ID header contains an invalid value

I am using paypal adaptive payment on my project.But when i try to pay using preapproval i am getting this response from paypal
Array
(
[responseEnvelope.timestamp] => 2013-05-15T05:53:33.709-07:00
[responseEnvelope.ack] => Failure
[responseEnvelope.correlationId] => ec16bc5b116e0
[responseEnvelope.build] => 5867333
[error(0).errorId] => 560022
[error(0).domain] => PLATFORM
[error(0).subdomain] => Application
[error(0).severity] => Error
[error(0).category] => Application
[error(0).message] => The X-PAYPAL-APPLICATION-ID header contains an invalid value
[error(0).parameter(0)] => X-PAYPAL-APPLICATION-ID
)
And the transaction is failed.
Please help
Thanks
The appID for sandbox and live are different. For sandbox, everyone must use APP-80W284485P519543T. For live, you must use the ID that matches the app's credentials.