How to place an order as guest in eBay Sandbox - paypal

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.

Related

How to set category for PayPal Smart Buttons?

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.

How to enable PayPal for Google Pay online

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.

Paypal adaptive payment method for Paypal account verification

Any one can help for Paypal adaptive payment method for Paypal account verification. When we go to live mode and generate Live APP Id it is showing error:
{
"responseEnvelope": {
"timestamp": "2015-09-18T02:23:23.202-07:00",
"ack": "Failure",
"correlationId": "4321940d358d5",
"build": "18018453"
},
"error": [
{
"errorId": "560022",
"domain": "PLATFORM",
"subdomain": "Application",
"severity": "Error",
"category": "Application",
"message": "The X-PAYPAL-APPLICATION-ID header contains an invalid value",
"parameter": [
"X-PAYPAL-APPLICATION-ID"
]
}
]
}
I have found answer of Paypal adaptive payment and check paypal valid email or not.
When create an App, need to fill complete information of APP and if you want to check only Paypal email exist or not. Deselect 'Chained Payments' within your App Submission.
Paypal can allow you to use GrtVerifiedStatus. However, please ensure to set the 'matchCriteria' parameter to 'NAME' as the permission to use 'NONE' is highly restricted.

PayPal REST API 500 internal service error only in live

I am using the Paypal PHP REST API SDK, but I can reproduce the problem using curl too. I am able to get a token without a problem. This only occurs when I'm submitting a live payment. I can switch to sandbox and submit an identical payment successfully.
As you can see below this is a very basic payment. I don't see how there could possibly be a problem with the information being submitted.
I have no shortage of debug IDs since this happens every time, but here is the last one I got: 049eee254433f
{
"intent":"sale",
"payer":{
"payment_method":"credit_card",
"funding_instruments":[
{
"credit_card":{
"type":"visa",
"number":"(removed)",
"cvv2":"(removed)",
"expire_month":"1",
"expire_year":"2016",
"first_name":"(removed)",
"last_name":"(removed)"
}
}
]
},
"transactions":[
{
"amount":{
"total":"11.98",
"currency":"USD"
}
}
]
}
The issue, according to the debug ID, is that you are not sending the billing address along with the card information. The option to include/not include the billing address with your request is based upon your merchant account setup. In order to rectify the above error, please provide the billing address in your request.
https://developer.paypal.com/webapps/developer/docs/api/#creditcard-object

PayPal Item(s) w/ Description on Review Page

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.