@@ -297,13 +297,19 @@ public function withDevice(
297297 * are:
298298 * - `account_creation`
299299 * - `account_login`
300+ * - `credit_application`
300301 * - `email_change`
302+ * - `fund_transfer`
301303 * - `password_reset`
302304 * - `payout_change`
303305 * - `purchase`
304306 * - `recurring_purchase`
305307 * - `referral`
306308 * - `survey`
309+ * @param string|null $party The party submitting the transaction. The valid values
310+ * are:
311+ * - `agent`
312+ * - `customer`
307313 *
308314 * @return MinFraud A new immutable MinFraud object. This object is a clone of
309315 * the original with additional data.
@@ -317,13 +323,15 @@ public function withEvent(
317323 ?string $ time = null ,
318324 ?string $ transactionId = null ,
319325 ?string $ type = null ,
326+ ?string $ party = null ,
320327 ): self {
321328 if (\count ($ values ) !== 0 ) {
322329 if (\func_num_args () !== 1 ) {
323330 throw new \InvalidArgumentException (
324331 'You may only provide the $values array or named arguments, not both. ' ,
325332 );
326333 }
334+ $ party = $ this ->remove ($ values , 'party ' );
327335 $ shopId = $ this ->remove ($ values , 'shop_id ' );
328336 $ time = $ this ->remove ($ values , 'time ' );
329337 $ transactionId = $ this ->remove ($ values , 'transaction_id ' );
@@ -332,6 +340,13 @@ public function withEvent(
332340 $ this ->verifyEmpty ($ values );
333341 }
334342
343+ if ($ party !== null ) {
344+ if (!\in_array ($ party , ['agent ' , 'customer ' ], true )) {
345+ $ this ->maybeThrowInvalidInputException ("$ party is not a valid party " );
346+ }
347+ $ values ['party ' ] = $ party ;
348+ }
349+
335350 if ($ shopId !== null ) {
336351 $ values ['shop_id ' ] = $ shopId ;
337352 }
@@ -354,7 +369,9 @@ public function withEvent(
354369 if (!\in_array ($ type , [
355370 'account_creation ' ,
356371 'account_login ' ,
372+ 'credit_application ' ,
357373 'email_change ' ,
374+ 'fund_transfer ' ,
358375 'password_reset ' ,
359376 'payout_change ' ,
360377 'purchase ' ,
@@ -753,6 +770,18 @@ public function withShipping(
753770 * @param bool|null $wasAuthorized The authorization outcome from the payment
754771 * processor. If the transaction has not yet been
755772 * approved or denied, do not include this field.
773+ * @param string|null $method The payment method associated with the transaction.
774+ * The valid values are:
775+ * - `bank_debit`
776+ * - `bank_redirect`
777+ * - `bank_transfer`
778+ * - `buy_now_pay_later`
779+ * - `card`
780+ * - `crypto`
781+ * - `digital_wallet`
782+ * - `gift_card`
783+ * - `real_time_payment`
784+ * - `rewards`
756785 *
757786 * @return MinFraud A new immutable MinFraud object. This object is
758787 * a clone of the original with additional data.
@@ -762,6 +791,7 @@ public function withPayment(
762791 ?string $ declineCode = null ,
763792 ?string $ processor = null ,
764793 ?bool $ wasAuthorized = null ,
794+ ?string $ method = null ,
765795 ): self {
766796 if (\count ($ values ) !== 0 ) {
767797 if (\func_num_args () !== 1 ) {
@@ -771,6 +801,7 @@ public function withPayment(
771801 }
772802
773803 $ declineCode = $ this ->remove ($ values , 'decline_code ' );
804+ $ method = $ this ->remove ($ values , 'method ' );
774805 $ processor = $ this ->remove ($ values , 'processor ' );
775806 $ wasAuthorized = $ this ->remove ($ values , 'was_authorized ' , ['boolean ' ]);
776807
@@ -781,6 +812,24 @@ public function withPayment(
781812 $ values ['decline_code ' ] = $ declineCode ;
782813 }
783814
815+ if ($ method !== null ) {
816+ if (!\in_array ($ method , [
817+ 'bank_debit ' ,
818+ 'bank_redirect ' ,
819+ 'bank_transfer ' ,
820+ 'buy_now_pay_later ' ,
821+ 'card ' ,
822+ 'crypto ' ,
823+ 'digital_wallet ' ,
824+ 'gift_card ' ,
825+ 'real_time_payment ' ,
826+ 'rewards ' ,
827+ ], true )) {
828+ $ this ->maybeThrowInvalidInputException ("$ method is not a valid payment method " );
829+ }
830+ $ values ['method ' ] = $ method ;
831+ }
832+
784833 if ($ processor !== null ) {
785834 if (!\in_array ($ processor , [
786835 'adyen ' ,
0 commit comments