8 use Braintree\Transaction;
26 $response = Helper\SubjectReader::readResponse($subject);
28 throw new \InvalidArgumentException(
'Response object does not exist');
42 return Helper\SubjectReader::readPayment($subject);
54 if (!isset($subject[
'object']) || !is_object($subject[
'object'])) {
55 throw new \InvalidArgumentException(
'Response object does not exist.');
58 if (!isset($subject[
'object']->transaction)
59 || !$subject[
'object']->transaction instanceof Transaction
61 throw new \InvalidArgumentException(
'The object is not a class \Braintree\Transaction.');
64 return $subject[
'object']->transaction;
75 return Helper\SubjectReader::readAmount($subject);
86 if (!isset($subject[
'customer_id'])) {
87 throw new \InvalidArgumentException(
'The "customerId" field does not exists');
90 return (
int) $subject[
'customer_id'];
102 throw new \InvalidArgumentException(
'The "public_hash" field does not exists');
117 throw new \InvalidArgumentException(
'Transaction has\'t paypal attribute');
131 return $subject[
'store_id'] ??
null;
readCustomerId(array $subject)
readStoreId(array $subject)
readPublicHash(array $subject)
readTransaction(array $subject)
readPayment(array $subject)
readAmount(array $subject)
readPayPal(Transaction $transaction)
readResponseObject(array $subject)