Sandbox account payment error code 1
killsb
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Aug-28-2019
11:55 PM
I used c# and sdk to create an order and then paid, I determined that the test account is a sandbox account (and using chrome private incognito mode), always failing to pay
below is create order c# code
public class CreateOrderSample
{
//2. Set up your server to receive a call from the client
/*
Method to create order
@Param debug true = print response data
@RETURN HttpResponse response received from API
@throws IOException Exceptions from API if any
*/
public async static Task CreateOrder(bool debug = false)
{
var request = new OrdersCreateRequest();
request.Prefer("return=representation");
request.RequestBody(BuildRequestBody());
//3. Call PayPal to set up the transaction
var response = await PayPalClient.client().Execute(request);
if (debug)
{
var result = response.Result();
Console.WriteLine("Status: {0}", result.Status);
Console.WriteLine("Order Id: {0}", result.Id);
Console.WriteLine("Intent: {0}", result.CheckoutPaymentIntent);
Console.WriteLine("Links:");
foreach (LinkDescription link in result.Links)
{
Console.WriteLine("\t{0}: {1}\tCall Type: {2}", link.Rel, link.Href, link.Method);
}
AmountWithBreakdown amount = result.PurchaseUnits[0].AmountWithBreakdown;
Console.WriteLine("Total Amount: {0} {1}", amount.CurrencyCode, amount.Value);
}
return response;
}
/*
Method to generate sample create order body with AUTHORIZE intent
@RETURN OrderRequest with created order request
*/
private static OrderRequest BuildRequestBody()
{
OrderRequest orderRequest = new OrderRequest()
{
CheckoutPaymentIntent = "CAPTURE",
// CheckoutPaymentIntent = "AUTHORIZE",
/*ApplicationContext = new ApplicationContext
{
BrandName = "KillSB AI LLC",
LandingPage = "BILLING",
UserAction = "CONTINUE",
ShippingPreference = "NO_SHIPPING"
},*/
PurchaseUnits = new List
{
new PurchaseUnitRequest{
//ReferenceId = "PUHF",
//Description = "SOFTWARE",
// CustomId = "CUST-HighFashions",
// SoftDescriptor = "HighFashions",
AmountWithBreakdown = new AmountWithBreakdown
{
CurrencyCode = "USD",
Value = "0.10",
/* AmountBreakdown = new AmountBreakdown
{
ItemTotal = new Money
{
CurrencyCode = "USD",
Value = "0.10"
}
}*/
},
/* Items = new List
{
new Item
{
Name = "zeus http proxy",
Description = "1 month, 100g flow",
//Category = "DIGITAL_GOODS",
Category = "PHYSICAL_GOODS",
// Category = "SOFTWARE",
Quantity = "1",
UnitAmount = new Money
{
CurrencyCode = "USD",
Value = "0.10"
}
}
}*/
}
}
};
return orderRequest;
}
/*
This driver function invokes the createOrder function
to create a sample order.
*/
}`
I use the response result approve of the created order to perform the payment test.
Status: CREATED
Order Id: XXXXXXXXXXX7E0293413N
Intent: AUTHORIZE
Links:
self: <a href="https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXX7E0293413N" target="_blank">https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXX7E0293413N</a> Call Type: GET
approve(usedthis): <a href="https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXX7E0293413N" target="_blank">https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXX7E0293413N</a> Call Type: GET
update: <a href="https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXX7E0293413N" target="_blank">https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXX7E0293413N</a> Call Type: PATCH
authorize: <a href="https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXX7E0293413N" target="_blank">https://api.sandbox.paypal.com/v2/checkout/orders/XXXXXXXXXXX7E0293413N</a> /authorize Call Type: POST
Can be purchased successfully using js sdk.
Chrome crawled http communication record
Please note
{"error":"Error: buildURL :: expected url\n at Object.assert (<a href="https://www.sandbox.paypal.com/webapps/hermes/static/js/main.js:1:118242)\n" target="_blank">https://www.sandbox.paypal.com/webapps/hermes/static/js/main.js:1:118242)\n</a> at Object.buildURL (<a href="https://www.sandbox.paypal.com/webapps/hermes/static/js/main.js:1:120138)\n" target="_blank">https://www.sandbox.paypal.com/webapps/hermes/static/js/main.js:1:120138)\n</a> at <a href="https://www.sandbox.paypal.com/webapps/hermes/static/js/main.js:1:1441669\n" target="_blank">https://www.sandbox.paypal.com/webapps/hermes/static/js/main.js:1:1441669\n</a> at <a href="https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:104073\n" target="_blank">https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:104073\n</a> at p.$digest (<a href="https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:109622)\n" target="_blank">https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:109622)\n</a> at <a href="https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:111183\n" target="_blank">https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:111183\n</a> at i (<a href="https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:59222)\n" target="_blank">https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:59222)\n</a> at <a href="https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:60669","message":"buildURL" target="_blank">https://www.paypalobjects.com/js/xo/hermes/1.9.0/framework.js:1:60669","message":"buildURL</a> :: expected url","cause":"state_change_checkout_review_to_checkout_end","state":"checkout.review","url":"<a href="https://www.sandbox.paypal.com/webapps/hermes?flow=1-P%26ulReturn=true%26token=07044327MV547340J%26country.x=C2%26locale.x=zh_XC%26arc=1#/checkout/review","pageID" target="_blank">https://www.sandbox.paypal.com/webapps/hermes?flow=1-P%26ulReturn=true%26token=07044327MV547340J%26country.x=C2%26locale.x=zh_XC%26arc=1#/checkout/review","pageID</a>"
{"level":"info","event":"checkout_genericError_rendering","timestamp":1565705780618,"payload":{"pageID":"1ae0a88d","client_elapsed":13353,"req_elapsed":16447,"site_cntry":"C2"}},{"level":"info","event":"checkout_fpti","timestamp":1565705780626,"payload":{"landing_page":"error_page","int_error_code":"1","int_error_description":"UkVUUlk=","pageID":"1ae0a88d","client_elapsed":13362,"req_elapsed":16456,"site_cntry":"C2"}}
0 REPLIES 0
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Paypal 4X credit : translated message & currency error in PayPal Payments Standard
- Need help to integrate PayPal Standard Checkout with Shopify in PayPal Payments Standard
- Platform Marketplace integration approval in Sandbox Environment
- [UNPROCESSABLE_ENTITY], but payment went through in PayPal Payments Standard
- Assistance Required: Locating Existing APP ID for Adaptive Payments in PayPal Business Account in NVP/SOAP APIs