Я хочу, чтобы мои клиенты могли приобрести определенные услуги в моем приложении Java с помощью PayPal.
Я использовал SDK. После того, как я введу свой ClientId и SecretID, я получаю ссылку на одобрение. Если я открою это, официальное окно PayPal фактически откроется. Однако, когда я нажимаю на «оплату», я перенаправлен, и ничего не происходит. С моей учетной записи не было вычтено ни одного денег, а также ничего не было введено в бизнес -аккаунт.
У кого -нибудь есть рабочий код?
заранее! Order order = null;
// Construct a request object and set desired parameters
// Here, OrdersCreateRequest() creates a POST request to /v2/checkout/orders
OrderRequest orderRequest = new OrderRequest();
orderRequest.checkoutPaymentIntent("CAPTURE");
List
purchaseUnits = new ArrayList();
purchaseUnits.add(new PurchaseUnitRequest().amountWithBreakdown(new AmountWithBreakdown().currencyCode("EUR").value("0.01")));
orderRequest.purchaseUnits(purchaseUnits);
OrdersCreateRequest request = new OrdersCreateRequest().requestBody(orderRequest);
try {
// Call API with your client and get a response for your call
HttpResponse response = Credentials.client.execute(request); // Here are the keys
// If call returns body in response, you can get the de-serialized version by
// calling result() on the response
order = response.result();
System.out.println("Order ID: " + order.id());
order.links().forEach(link -> System.out.println(link.rel() + " => " + link.method() + ":" + link.href()));
} catch (IOException ioe) {
if (ioe instanceof HttpException) {
// Something went wrong server-side
HttpException he = (HttpException) ioe;
System.out.println(he.getMessage());
he.headers().forEach(x -> System.out.println(x + " :" + he.headers().header(x)));
} else {
System.out.println(ioe);
}
}
< /code>
Я перенаправляюсь, но деньги не были переданы. Я использовал выплату SDK, но теперь я получаю эту ошибку: < /p>
"{" name ":" Authorization_error "," Сообщение ":" Ошибка авторизации произошло. "," debug_id ":" 578ce67e544c5 "," information_link ":" https://developer.paypal.com/docs/api/p ... ch/#errors "," Ссылки ": []}"
Я также проверял. Флажок выбран.
Подробнее здесь: https://stackoverflow.com/questions/777 ... ss-account