Example #1
0
 /**
  * Creates Pay-In Card Web object
  * @return \MangoPay\PayIn
  */
 protected function getJohnsPayInCardWeb()
 {
     if (self::$JohnsPayInCardWeb === null) {
         $wallet = $this->getJohnsWallet();
         $user = $this->getJohn();
         $payIn = new \MangoPay\PayIn();
         $payIn->AuthorId = $user->Id;
         $payIn->CreditedUserId = $user->Id;
         $payIn->DebitedFunds = new \MangoPay\Money();
         $payIn->DebitedFunds->Currency = 'EUR';
         $payIn->DebitedFunds->Amount = 1000;
         $payIn->Fees = new \MangoPay\Money();
         $payIn->Fees->Currency = 'EUR';
         $payIn->Fees->Amount = 5;
         $payIn->CreditedWalletId = $wallet->Id;
         $payIn->PaymentDetails = $this->getPayInPaymentDetailsCard();
         $payIn->ExecutionDetails = $this->getPayInExecutionDetailsWeb();
         self::$JohnsPayInCardWeb = $this->_api->PayIns->Create($payIn);
     }
     return self::$JohnsPayInCardWeb;
 }