Пример #1
0
 public static function createPayer()
 {
     $payer = new Payer();
     $payer->setPayment_method(self::$paymentMethod);
     $payer->setPayer_info(PayerInfoTest::createPayerInfo());
     $payer->setFunding_instruments(array(FundingInstrumentTest::createFundingInstrument()));
     return $payer;
 }
Пример #2
0
 public static function createNewPayment()
 {
     $payer = new Payer();
     $payer->setPaymentMethod("credit_card");
     $payer->setFundingInstruments(array(FundingInstrumentTest::createFundingInstrument()));
     $transaction = new Transaction();
     $transaction->setAmount(AmountTest::createAmount());
     $transaction->setDescription("This is the payment description.");
     $redirectUrls = new RedirectUrls();
     $redirectUrls->setReturnUrl("http://localhost/return");
     $redirectUrls->setCancelUrl("http://localhost/cancel");
     $payment = new Payment();
     $payment->setIntent("sale");
     $payment->setRedirectUrls($redirectUrls);
     $payment->setPayer($payer);
     $payment->setTransactions(array($transaction));
     return $payment;
 }