Class LnUrlPay

  • All Implemented Interfaces:
    LnUrlService

    public class LnUrlPay
    extends java.lang.Object
    implements LnUrlService
    An lnurl pay request service
    • Constructor Detail

      • LnUrlPay

        protected LnUrlPay​(long maxSendable,
                           long minSendable,
                           java.net.URI callback,
                           int commentAllowed,
                           java.util.Collection<LnUrlPay.Metadata> metadata,
                           LnUrlPayerData payerData,
                           java.lang.String nostrPubkey,
                           boolean allowNostr)
      • LnUrlPay

        protected LnUrlPay​(long maxSendable,
                           long minSendable,
                           java.net.URI callback,
                           int commentAllowed,
                           java.util.Collection<LnUrlPay.Metadata> metadata,
                           LnUrlPayerData payerData)
      • LnUrlPay

        protected LnUrlPay​(java.util.Map<java.lang.String,​java.lang.Object> data)
    • Method Detail

      • isAssignableTo

        protected static boolean isAssignableTo​(java.util.Map<java.lang.String,​java.lang.Object> data)
      • isCommentAllowed

        public boolean isCommentAllowed()
      • getMaxCommentLength

        public int getMaxCommentLength()
      • canSend

        public boolean canSend​(long amount)
      • getMaxSendable

        public long getMaxSendable()
      • getMinSendable

        public long getMinSendable()
      • isNostrAllowed

        public boolean isNostrAllowed()
      • getNostrPubkey

        public java.lang.String getNostrPubkey()
      • getCallback

        public java.net.URI getCallback()
      • getCallback

        public java.net.URI getCallback​(long amount,
                                        @Nullable
                                        java.lang.String comment,
                                        @Nullable
                                        LnUrlPayerData payerData)
      • getCallback

        public java.net.URI getCallback​(long amount,
                                        @Nullable
                                        java.lang.String comment,
                                        @Nullable
                                        LnUrlPayerData payerData,
                                        @Nullable
                                        java.lang.String nostrZapRequest)
      • fetchInvoice

        public org.ngengine.platform.AsyncTask<LnUrlPaymentResponse> fetchInvoice​(long amount,
                                                                                  @Nullable
                                                                                  java.lang.String comment,
                                                                                  @Nullable
                                                                                  LnUrlPayerData payerData)
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fetchInvoice

        public org.ngengine.platform.AsyncTask<LnUrlPaymentResponse> fetchInvoice​(long amount,
                                                                                  @Nullable
                                                                                  java.lang.String comment,
                                                                                  @Nullable
                                                                                  LnUrlPayerData payerData,
                                                                                  @Nullable
                                                                                  java.lang.String nostrZapRequest)
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fetchInvoice

        public org.ngengine.platform.AsyncTask<LnUrlPaymentResponse> fetchInvoice​(long amount,
                                                                                  @Nullable
                                                                                  java.lang.String comment,
                                                                                  @Nullable
                                                                                  LnUrlPayerData payerData,
                                                                                  @Nullable
                                                                                  java.time.Duration timeout,
                                                                                  @Nullable
                                                                                  java.util.Map<java.lang.String,​java.lang.String> headers)
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fetchInvoice

        public org.ngengine.platform.AsyncTask<LnUrlPaymentResponse> fetchInvoice​(long amount,
                                                                                  @Nullable
                                                                                  java.lang.String comment,
                                                                                  @Nullable
                                                                                  LnUrlPayerData payerData,
                                                                                  @Nullable
                                                                                  java.time.Duration timeout,
                                                                                  @Nullable
                                                                                  java.util.Map<java.lang.String,​java.lang.String> headers,
                                                                                  @Nullable
                                                                                  java.lang.String nostrZapRequest)
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getName

        public java.lang.String getName()
        Description copied from interface: LnUrlService
        A human readable name for the service. Used for debugging and logging purposes.
        Specified by:
        getName in interface LnUrlService
        Returns:
        the name of the service
      • toMap

        public java.util.Map<java.lang.String,​java.lang.Object> toMap()
        Description copied from interface: LnUrlService
        Return the serializable representation of this service
        Specified by:
        toMap in interface LnUrlService
        Returns:
        the service data, the same way it was received from the LNURL endpoint.