We have a few clients who need it so their visitors can start off on the Paypal login page in Spanish by default.
Paypal Express allows parameters to be passed into the setExpressCheckout URL, in order to set default locale and language.
Is there an equivalent of Paypal's LC or LOCALECODE parameters that can be set using the authorize.net Paypal functions, or a query string suffix that can be passed into the Paypal secure redirect URI, so that one can declare what language the Paypal login screen displays when Express checkout initiates?
Taken from this page: https://developer.paypal.com/docs/classic/api/locale_codes/#localize-the-buyers-checkout-experience
Locale Codes
You can use any PayPal-supported language and locale to
localize PayPal checkout pages.
Localize the buyer's checkout experience Pass a locale code to PayPal
to customize the locale of the buyer's checkout experience.
PayPal payment buttons Merchants who use a PayPal payment button
(PayPal Payments Standard) can set the locale code using the lc
variable. To learn more about PayPal payment button HTML variables,
see HTML variables for displaying PayPal checkout pages.
Express Checkout Merchants who use the Express Checkout
SetExpressCheckout ( NVP, SOAP ) or Callback ( NVP ) API operations
can set the locale code using the LocaleCode parameter.
For an example, see changing the locale in the Express Checkout
integration guide.
And clicking the integration guide link:https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECCustomizing/#change-the-locale
Change the locale
You can change the locale of PayPal pages to match
the language on your website using either a 2-character country code
or a 5-character locale code from the supported codes listed on the
NVP/SOAP API locale codes page. To change the language displayed on
the PayPal pages, set the LOCALECODE parameter to one of the allowable
values in the SetExpressCheckout call.
Since authorize.net uses the Express Checkout API, is this option available?
Yes, you can pass this as a parameter which is then passed through to Paypal. The field is called paypalLc and is nested under createTransactionRequest -> transactionRequest -> payment -> payPal -> paypalLc.
From the manual:
payPalLc
Locale of pages displayed by PayPal during Express Checkout.
Defaults to US.
String.
One of:
AU -- Australia
CAN -- Canada
DE -- Germany
ES -- Spain
FR -- France
GB -- United Kingdom
IT -- Italy
US -- United States
Here is a sample JSON request:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "1.00",
"payment": {
"payPal": {
"successUrl": "https://my.server.com/success.html",
"cancelUrl": "https://my.server.com/cancel.html",
"paypalLc": "ES",
"paypalHdrImg": "",
"paypalPayflowcolor": "FFFF00"
}
},
"lineItems": {
"lineItem": {
"itemId": "item1",
"name": "golf balls",
"quantity": "1",
"unitPrice": "1.00"
}
}
}
}
}
Related
Hi I'm trying to place an order on the Sandbox environment as a guest assuming that no Paypal account would be needed to be added for the guest. I'm using the below REST APIs in that order to get this done.
I have a Listing (published offer) with the id 1xxxxxxxxxx4 in sandbox
I called the Order API -> initiateGuestCheckoutSession (Item ID : v1|1xxxxxxxxxx4|0)
I called the Order API -> initiateGuestPayment with below request body
{
"paymentMethodType": "WALLET",
"paymentMethodBrandType": "PAYPAL_CHECKOUT"
}
Got this as part of the response
"providedPaymentInstrument": {
"paymentMethodType": "WALLET",
"paymentInstrumentReference": {
"externalReferenceId": "2QG41254DS871200X"
}
I called Order API -> placeGuestOrder (Session Id : v1|1xxxxxxxxxx4|123365312 )
{ "marketingTerms": [
{"marketingTermsAccepted": false,
"marketingTypes": [ "OFFER", "SURVEY", "PROMOTION" ],
"marketingChannels": [ "EMAIL" ] } ]
}
I'm getting below for response 400 Bad request
{
"errors": [
{
"errorId": 15004,
"domain": "API_ORDER",
"category": "REQUEST",
"message": "If this is a eBay member checkout, this error indicates that the buyer does not have a PayPal account linked to their eBay account. If this is a guest checkout, this indicates that the buyer's credit card information is missing. In both cases, submit the buyer's credit card information."
}
]
}
So I have these questions in mind.
Am I calling the right APIs, in the correct order? or am I missing
something?
How do I add credit card information to this guest buyer?
If I'm to add credit card information to this guest buyer, are there
any TEST Credit cards that could be used for this purpose?
If linking a TEST Paypal to this scenario how should it be done?
To avoid all this can't we set "Cash On Delivery" option for orders?
if so how do you set that?
Thanks in advance, appreciate any help I could get on this matter guys.
When I view the transaction details in Paypal sandbox as buyer, it says "Category: flights".
Is it possible to change that - or is this automatically determined by Paypal? (The documentation only knows about item category physical/digital, but setting this value doesn't change anything.)
My code:
actions.order.create({
purchase_units: [{
"items":[
{"name":"ARGENTINISCHES H\u00dcFTSTEAK","unit_amount":{"currency_code":"EUR","value":"12.50"},"quantity":1,"sku":"FG_001"},
{"name":"Beilagensalat","unit_amount":{"currency_code":"EUR","value":"3.50"},"quantity":1,"sku":"FG_008"}
],
"amount":{
"currency_code":"EUR",
"value":"16.00",
"breakdown":{"item_total":{"currency_code":"EUR","value":"16.00"}}
}
}],
application_context: {
payment_method: {payee_preferred: "IMMEDIATE_PAYMENT_REQUIRED"},
shipping_preference: "NO_SHIPPING"
}
});
This is an account setting, not an integration issue.
You can try editing the category of the sandbox Business account you are receiving the payment with, via https://www.sandbox.paypal.com/businessmanage/account/aboutBusiness -> Update
But since it's sandbox, you can also just not worry about it. The setting in sandbox will not have any relation to any live account this integration ever processes payment with.
I have got a task to use Google Pay with PayPal in web applications and for that I have gone through numbers of posts over the internet, but not found any well documentation or guide. I have found only google pay codes with payment-gateway mostly and PayPal uses documentation only on PayPal and google blogs, I found that while using it with payment gateway, we don't need any self-created tokenization codes to pass in payment method but when we go with PayPal we must have to use DIRECT token specification method that means we have to create tokenization self for rotation or may be I didn't get it right. My question is that, do we still need public key while working with payment gateway or it belongs to direct method only. I am successfully running payment-gateway integration with test environment but not got any success over PayPal.
While learning about Direct method I understand that we have need to use public key in both payment request and in google pay developer profile but how we can run PayPal in test environment still not found neither any sample nor any success over that.
Below are links I have tried you can use for reference:
https://developers.google.com/pay/api/web/guides/tutorial
https://developers.google.com/pay/api/web/guides/resources/sample-tokens
https://developers.google.com/pay/api/web/reference/request-objects#purchasecontext
https://developers.google.com/pay/api/web/reference/request-objects#gateway
https://developers.google.com/pay/api/web/guides/paymentrequest/tutorial
https://stackoverflow.com/search?page=5&tab=Relevance&q=integrate%20google%20pay
https://developer.paypal.com/docs/archive/checkout/how-to/googlepay-integration/
https://developers.google.com/pay/api/web/guides/tutorial
Here you can see sample of json for payment request in google pay with PayPal.
{
"apiVersion":2,
"apiVersionMinor":0,
"allowedPaymentMethods":[
{
"type":"PAYPAL",
"parameters":{
"purchase_context":{
"payment_intent":"AUTHORIZE",
"purchase_units":[
{
"reference_id":"PUHF",
"description":"Sporting Goods",
"custom_id":"CUST-HighFashions",
"soft_descriptor":"HighFashions",
"payee":{
"merchant_id":"xxxxx"
},
"shipping":{
"method":"United States Postal Service",
"address":{
"name":{
"full_name":"John Doe"
},
"address_line_1":"123 Townsend St",
"address_line_2":"Floor 6",
"admin_area_2":"San Francisco",
"admin_area_1":"CA",
"postal_code":"94107",
"country_code":"US"
}
}
}
]
}
},
"tokenizationSpecification":{
"type":"DIRECT"
}
}
],
"transactionInfo":{
"displayItems":[
{
"label":"Subtotal",
"type":"SUBTOTAL",
"price":"1.00"
},
{
"label":"Tax",
"type":"TAX",
"price":"1.00"
}
],
"countryCode":"US",
"currencyCode":"INR",
"totalPriceStatus":"FINAL",
"totalPrice":"1.00",
"totalPriceLabel":"Total"
},
"merchantInfo":{
"merchantName":"shopgradframes"
},
"callbackIntents":[
"SHIPPING_ADDRESS",
"SHIPPING_OPTION",
"PAYMENT_AUTHORIZATION"
],
"shippingAddressRequired":false,
"shippingAddressParameters":{
"allowedCountryCodes":[
"US"
],
"phoneNumberRequired":true
},
"shippingOptionRequired":false
}
I think we can't use direct method in test environment because this may need merchant details, i have also some doubt over test token given in google blog, you can see that below:
https://developers.google.com/pay/api/web/guides/resources/sample-tokens
I also didn't understand how we can use those test token, do we have to pass it our payment gateway for processing or other stuff.
I'm trying to get PayPal's chained payments working in their sandbox env. but whenever I click on "Pay" at the very last stage after signing in I always get redirected to a page with the generic error message "Your payment can't be completed. Please return to the participating website and try again."
I've tried doing both chained and parallel payments with the same results.
I've also followed a few suggestions from around the web which inc tweaking the merchant account settings making sure certain fields were unchecked under the "blocked" options. As well checking currency and country code. Initially country code was en_GB and currency GBP, that didn't work I tried doing en_US with USD but in all cases I get the same message.
I've also tried adding an IPN url on the off chance PayPal would post some error code/message to it but got nadda! If you click "Return to test store" it goes to the cancel URL without any POST/GET parameters.
I'm using their PHP SDK from http://paypal.github.io/#adaptive-payments-tab-php-5-3
So the question, does anyone have any suggestion as to how I can find out what exactly is going wrong or other things I can try to fix it?
I had this problem in the sandbox environment because I was not including an application ID. I used APP-80W284485P519543T which one of examples indicated as the Sandbox Application ID, and then it worked.
Mobile Payments Library Developer Guide and Reference
–
Android OS
Edition
Oct 2016
5
Preface
**Important:
The Mobile Payments Library is based on the PayPal Adaptive Payments API.
As of October 6, 2016, Adaptive Payments is now a limited releas
e product. It is restricted to
select partners for approved use cases and should not be used for new integrations without guidance from PayPal**
=============================================
first implement method
private void initLibrary() {
PayPal pp = PayPal.getInstance();
if(pp == null) {
pp = PayPal.initWithAppID(this, PAYPAL_APP_ID, PayPal.ENV_SANDBOX);
pp.setLanguage("en_US"); // Sets the language for the library.
pp.setFeesPayer(PayPal.FEEPAYER_EACHRECEIVER);
// pp.setShippingEnabled(true);
pp.setDynamicAmountCalculationEnabled(false);
}
}
**paypal button click event code**
double secondary_payment = 0;
double primary_payment = 0;
PayPalAdvancedPayment advPayment = makeChainedPayment(secondary_payment,primary_payment,"primary_email","secondary_email");
Intent checkoutIntent = PayPal.getInstance().checkout(advPayment, your_current_activity);
startActivityForResult(checkoutIntent, 1);
=============================================
private PayPalAdvancedPayment makeChainedPayment(double priceSecondary, double pricePrimary, String primary_email, String secondary_email) {
PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
payment.setCurrencyType("USD");
// payment.setMerchantName("PushND");
BigDecimal bigDecimalPrimary=new BigDecimal(pricePrimary);
PayPalReceiverDetails receiverPrimary = new PayPalReceiverDetails();
receiverPrimary.setRecipient(primary_email);
//receiverPrimary.setRecipient("adaptive_receiver_1#pushnd.com");
receiverPrimary.setSubtotal(bigDecimalPrimary);
receiverPrimary.setIsPrimary(true);
payment.getReceivers().add(receiverPrimary);
PayPalReceiverDetails receiverSecondary= new PayPalReceiverDetails();
receiverSecondary.setRecipient(secondary_email);
BigDecimal bigDecimalSecond=new BigDecimal(priceSecondary);
receiverSecondary.setSubtotal(bigDecimalSecond);
payment.getReceivers().add(receiverSecondary);
return payment;
}
Using the PayPal REST api, I'm passing in this to new payments:
transactions: [
{
amount: {
total: "10.00",
currency: "USD",
details: {
subtotal: "10.00"
}
},
description: "My item description."
}
],
Snippet of the actual request
On the PayPal approve page, though, only the subtotal is displayed - nowhere does the description show up, nor do individual item listings - only the subtotal in USD shows up.
How can I make individual items with descriptions in the REST API checkout? I'm using &useraction=commit by the way.
You would need to pass over the line items in the SetExpressCheckout API call that you are making. There is a list of variable that can be passed over in the developers guide. I have checked with our engineers, and this feature has not been pushed live yet. Line items will be supported, but the feature is not yet live with the New REST API's.