Paypal rest API'sini kullanıyorum ancak bir hata alıyorum. Sonra bu hata gösterir ben $payment->create($apiContext);
0 - https://api.sandbox.paypal.com/v1/payments/payment adresine erişirken Http yanıt kodu 400 aldım
arayana kadar
function makePaymentUsingPayPal($total, $currency, $paymentDesc, $returnUrl, $cancelUrl) {
// set billing address
$addr = new Address();
$addr->setLine1('fh52 N Main ST');
$addr->setCity('Johnstownfhf');
$addr->setCountry_code('UK');
$addr->setPostal_code('35345');
$addr->setState('DF');
// set credit card information
$card = new CreditCard();
$card->setNumber('4111111111111111');
$card->setType('visa');
$card->setExpire_month('12');
$card->setExpire_year('2015');
$card->setCvv2('123');
$card->setFirst_name('dgdg');
$card->setLast_name('dgdgdShopper');
$card->setBilling_address($addr);
$fi = new FundingInstrument();
$fi->setCredit_card($card);
$payer = new Payer();
$payer->setPaymentMethod("paypal");
//$payer = new Payer();
//$payer->setPayment_method('credit_card');
//$payer->setFunding_instruments(array($fi));
// Specify the payment amount.
$amountDetails = new Details();
$amountDetails->setSubtotal('57.41');
$amountDetails->setTax('0.06');
$amountDetails->setShipping('0.06');
$amount = new Amount();
$amount->setCurrency('USD');
$amount->setTotal('5.47');
$amount->setDetails($amountDetails);
// ###Transaction
// A transaction defines the contract of a
// payment - what is the payment for and who
// is fulfilling it. Transaction is created with
// a `Payee` and `Amount` types
$transaction = new Transaction();
$transaction->setAmount($amount);
$transaction->setDescription('sdgdfg This is the payment transaction description.');
$redirectUrls = new RedirectUrls();
$redirectUrls->setReturnUrl($returnUrl);
$redirectUrls->setCancelUrl($cancelUrl);
$payment = new Payment();
$payment->setRedirectUrls($redirectUrls);
$payment->setIntent("buy");
$payment->setPayer($payer);
$payment->setTransactions(array($transaction));
//print_r($payment);exit;
$payment->create($apiContext);
// return $payment;
}
her şeyi iyi çalışır: İşte benim kodudur
0 - Got Http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment .
Aynı sorunu yaşıyorum, birisi bunu anladı mı? –