@@ -770,6 +770,18 @@ public function withShipping(
770770 * @param bool|null $wasAuthorized The authorization outcome from the payment
771771 * processor. If the transaction has not yet been
772772 * 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`
773785 *
774786 * @return MinFraud A new immutable MinFraud object. This object is
775787 * a clone of the original with additional data.
@@ -779,6 +791,7 @@ public function withPayment(
779791 ?string $ declineCode = null ,
780792 ?string $ processor = null ,
781793 ?bool $ wasAuthorized = null ,
794+ ?string $ method = null ,
782795 ): self {
783796 if (\count ($ values ) !== 0 ) {
784797 if (\func_num_args () !== 1 ) {
@@ -788,6 +801,7 @@ public function withPayment(
788801 }
789802
790803 $ declineCode = $ this ->remove ($ values , 'decline_code ' );
804+ $ method = $ this ->remove ($ values , 'method ' );
791805 $ processor = $ this ->remove ($ values , 'processor ' );
792806 $ wasAuthorized = $ this ->remove ($ values , 'was_authorized ' , ['boolean ' ]);
793807
@@ -798,6 +812,24 @@ public function withPayment(
798812 $ values ['decline_code ' ] = $ declineCode ;
799813 }
800814
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+
801833 if ($ processor !== null ) {
802834 if (!\in_array ($ processor , [
803835 'adyen ' ,
0 commit comments