In the sendbox, it runs normally, but the following errors occur in the Live : Response code: 401 Error response: "name":"UNAUTHORIZED_PAYMENT","message":"Unauthorized payment." [my request] .... APIContext apiContext = new APIContext(CLIENT_ID, CLIENT_SECRET, MODE); .... Amount amount = new Amount(); amount.setCurrency("USD"); amount.setTotal("1"); .... Item item = new Item(); item.setName("Coffee").setQuantity("1").setCurrency("USD").setPrice("1"); ItemList itemList = new ItemList(); List<Item> items = new ArrayList<Item>(); items.add(item); itemList.setItems(items); .... Transaction transaction = new Transaction(); transaction.setAmount(amount); transaction.setItemList(itemList); transaction.setDescription("description"); List<Transaction> transactions = new ArrayList<Transaction>(); transactions.add(transaction); .... CreditCard creditCard = new CreditCard(); creditCard.setNumber("****************"); creditCard.setType("mastercard"); creditCard.setExpireMonth(**); creditCard.setExpireYear(****); creditCard.setCvv2("***"); FundingInstrument fundingInstrument = new FundingInstrument(); fundingInstrument.setCreditCard(creditCard); List<FundingInstrument> fundingInstruments = new ArrayList<>(); fundingInstruments.add(fundingInstrument); .... Payer payer = new Payer(); payer.setPaymentMethod("credit_card"); payer.setFundingInstruments(fundingInstruments); .... Payment payment = new Payment(); payment.setIntent("sale"); payment.setPayer(payer); payment.setTransactions(transactions); payment.setState("created"); payment.setNoteToPayer("note"); payment.setCreateTime("2017-11-23"); .... payment.create(apiContext);
... View more