Payment/W/Strategy/CapturePreauthorized.php
protected function _handle() {
		$o = $this->o(); /** @var O|DFO $o */
		// 2016-12-30
		// Мы не должны считать исключительной ситуацией повторное получение
		// ранее уже полученного оповещения.
		// В документации к Stripe, например, явно сказано:
		// «Webhook endpoints may occasionally receive the same event more than once.
		// We advise you to guard against duplicated event receipts
		// by making your event processing idempotent.»
		// https://stripe.com/docs/webhooks#best-practices
		if (!$o->canInvoice()) {
			$this->softFailure('The order does not allow an invoice to be created.');
		}
		else {
			$o->setCustomerNoteNotify(true)->setIsInProcess(true);
			/** @var Invoice $i */
			df_db_transaction()->addObject($i = $this->invoice())->addObject($o)->save(); 
			df_mail_invoice($i);
			// 2017-09-13
			// We do not set a response here, because PayPal clones require a specific response on success.
		}
	}
protected function _handle() {
		$o = $this->o(); /** @var O|DFO $o */
		// 2016-12-30
		// Мы не должны считать исключительной ситуацией повторное получение
		// ранее уже полученного оповещения.
		// В документации к Stripe, например, явно сказано:
		// «Webhook endpoints may occasionally receive the same event more than once.
		// We advise you to guard against duplicated event receipts
		// by making your event processing idempotent.»
		// https://stripe.com/docs/webhooks#best-practices
		if (!$o->canInvoice()) {
			$this->softFailure('The order does not allow an invoice to be created.');
		}
		else {
			$o->setCustomerNoteNotify(true)->setIsInProcess(true);
			/** @var Invoice $i */
			df_db_transaction()->addObject($i = $this->invoice())->addObject($o)->save(); 
			df_mail_invoice($i);
			// 2017-09-13
			// We do not set a response here, because PayPal clones require a specific response on success.
		}
	}
protected function _handle ( ) { $ o = $ this -> o ( ) ; /** @var O|DFO $o */ // 2016-12-30 // Мы не должны считать исключительной ситуацией повторное получение // ранее уже полученного оповещения. // В документации к Stripe, например, явно сказано: // «Webhook endpoints may occasionally receive the same event more than once. // We advise you to guard against duplicated event receipts // by making your event processing idempotent.» // https://stripe.com/docs/webhooks#best-practices if ( ! $ o -> canInvoice ( ) ) { $ this -> softFailure ( 'The order does not allow an invoice to be created.' ) ; } else { $ o -> setCustomerNoteNotify ( true ) -> setIsInProcess ( true ) ; /** @var Invoice $i */ df_db_transaction ( ) -> addObject ( $ i = $ this -> invoice ( ) ) -> addObject ( $ o ) -> save ( ) ; df_mail_invoice ( $ i ) ; // 2017-09-13 // We do not set a response here, because PayPal clones require a specific response on success. } }
2017-01-07
@override
@see \Df\Payment\W\Strategy::_handle()
@used-by \Df\Payment\W\Strategy::handle()
2017 - 01 - 07