Interface PaymentService

    • Method Detail

      • authorize

        PaymentTransactionEntryModel authorize​(java.lang.String merchantTransactionCode,
                                               java.math.BigDecimal amount,
                                               java.util.Currency currency,
                                               AddressModel deliveryAddress,
                                               java.lang.String subscriptionID)
        authorize payment
        Parameters:
        merchantTransactionCode - the transaction code
        amount - the amount
        currency - the currency
        deliveryAddress - the delivery address (paymentAddress is used if null)
        subscriptionID - the subscriptionID
        Returns:
        Payment Transaction Entry
      • authorize

        PaymentTransactionEntryModel authorize​(java.lang.String merchantTransactionCode,
                                               java.math.BigDecimal amount,
                                               java.util.Currency currency,
                                               AddressModel deliveryAddress,
                                               java.lang.String subscriptionID,
                                               java.lang.String cv2,
                                               java.lang.String paymentProvider)
        authorize payment
        Parameters:
        merchantTransactionCode - the transaction code
        amount - the amount
        currency - the currency
        deliveryAddress - the delivery address (paymentAddress is used if null)
        subscriptionID - the subscriptionID
        cv2 - card verification value
        paymentProvider - code of payment provider
        Returns:
        Payment Transaction Entry
      • authorize

        PaymentTransactionEntryModel authorize​(java.lang.String merchantTransactionCode,
                                               java.math.BigDecimal amount,
                                               java.util.Currency currency,
                                               AddressModel deliveryAddress,
                                               AddressModel paymentAddress,
                                               CardInfo card)
        authorize payment
        Parameters:
        merchantTransactionCode - the transaction code
        amount - the amount
        currency - the currency
        deliveryAddress - the delivery address (paymentAddress is used if null)
        paymentAddress - the payment address
        card - the card
        Returns:
        Payment Transaction Entry
      • authorize

        PaymentTransactionEntryModel authorize​(PaymentTransactionModel transaction,
                                               java.math.BigDecimal amount,
                                               java.util.Currency currency,
                                               AddressModel deliveryAddress,
                                               java.lang.String subscriptionID,
                                               java.lang.String paymentProvider)
        authorize payment
        Parameters:
        transaction - the payment transaction
        amount - the amount
        currency - the currency
        deliveryAddress - the delivery address (paymentAddress is used if null)
        subscriptionID - the subscriptionID
        paymentProvider - code of payment provider
        Returns:
        Payment Transaction Entry
      • authorize

        PaymentTransactionEntryModel authorize​(PaymentTransactionModel transaction,
                                               java.math.BigDecimal amount,
                                               java.util.Currency currency,
                                               AddressModel deliveryAddress,
                                               java.lang.String subscriptionID)
        authorize payment
        Parameters:
        transaction - the payment transaction
        amount - the amount
        currency - the currency
        deliveryAddress - the delivery address (paymentAddress is used if null)
        subscriptionID - the subscriptionID
        Returns:
        Payment Transaction Entry
      • authorize

        PaymentTransactionEntryModel authorize​(PaymentTransactionModel transaction,
                                               java.math.BigDecimal amount,
                                               java.util.Currency currency,
                                               AddressModel deliveryAddress,
                                               AddressModel paymentAddress,
                                               CardInfo card)
        authorize payment
        Parameters:
        transaction - the payment transaction
        amount - the amount
        currency - the currency
        deliveryAddress - the delivery address (paymentAddress is used if null)
        paymentAddress - the payment address
        card - the card
        Returns:
        Payment Transaction Entry
      • refundFollowOn

        PaymentTransactionEntryModel refundFollowOn​(PaymentTransactionModel transaction,
                                                    java.math.BigDecimal amount)
        Refund transaction
        Parameters:
        transaction - payment transaction
        amount - amount to refund
        Returns:
        payment transaction entry
      • refundStandalone

        PaymentTransactionEntryModel refundStandalone​(java.lang.String merchantTransactionCode,
                                                      java.math.BigDecimal amount,
                                                      java.util.Currency currency,
                                                      AddressModel paymentAddress,
                                                      CardInfo card)
        Refund value to a card (no transaction is obligatory)
        Parameters:
        merchantTransactionCode - any code to locate transaction
        amount - amount to refund
        currency - currency, used for refunding
        paymentAddress - address to refund
        card - card to refund
        Returns:
        payment transaction entry
      • refundStandalone

        default PaymentTransactionEntryModel refundStandalone​(java.lang.String merchantTransactionCode,
                                                              java.math.BigDecimal amount,
                                                              java.util.Currency currency,
                                                              AddressModel paymentAddress,
                                                              CardInfo card,
                                                              java.lang.String providerName,
                                                              java.lang.String subscriptionId)
        Refund value to a card (no transaction is obligatory)
        Parameters:
        merchantTransactionCode - any code to locate transaction
        amount - amount to refund
        currency - currency, used for refunding
        paymentAddress - address to refund
        card - card to refund
        providerName - name of the payment provider
        subscriptionId - subscription identifier
        Returns:
        payment transaction entry
      • partialCapture

        PaymentTransactionEntryModel partialCapture​(PaymentTransactionModel transaction,
                                                    java.math.BigDecimal amount)
        Take a partial capture of authorized transaction
        Parameters:
        transaction - authorized transaction
        amount - value to capture
        Returns:
        payment transaction entry
      • attachPaymentInfo

        void attachPaymentInfo​(PaymentTransactionModel paymentTransactionModel,
                               UserModel userModel,
                               CardInfo cardInfo,
                               java.math.BigDecimal amount)
        Attaches PaymentInfo to the assigned PaymentTransactionModel instance.
        Parameters:
        paymentTransactionModel - the payment transaction
        userModel - the user
        cardInfo - the card info
        amount - the amount expressed as BigDecimal
      • createSubscription

        NewSubscription createSubscription​(PaymentTransactionModel transaction,
                                           AddressModel paymentAddress,
                                           CardInfo card)
        Creates a subscription at the payment provider side and stores sensitive data there. Future payment authorization and refundStandalone calls will not have to provide the sensitive information, subscriptionID would be sufficient. Call this method after a successful authorize txn and provide THE SAME billing and card info. Please note: the card and billing info is not saved in the returning PaymentTransactionEntryModel from authorize method call ON PURPOSE.
        Parameters:
        transaction - a previous recent successful authorize payment transaction
        paymentAddress - the same billing address as for the authorize txn
        card - the same card as for the authorize txn
        Returns:
        instance of NewSubscription
      • createSubscription

        NewSubscription createSubscription​(java.lang.String merchantTransactionCode,
                                           java.lang.String paymentProvider,
                                           java.util.Currency currency,
                                           AddressModel paymentAddress,
                                           CardInfo card)
        Creates a subscription at the payment provider side and stores sensitive data there. Future payment authorization and refundStandalone calls will not have to provide the sensitive information, subscriptionID would be sufficient. This method does not need an authorized payment transaction, the authorization is expected to be done implicitly by the payment provider.
        Parameters:
        merchantTransactionCode - the transactionCode
        paymentProvider - the paymentProvider who will hold the subscription. You might also have just one payment provider in your implementation.
        currency - the default customer's currency
        paymentAddress - the same billing address as for the authorize txn
        card - the same card as for the authorize txn
        Returns:
        new subscription object (instance of NewSubscription)
      • updateSubscription

        PaymentTransactionEntryModel updateSubscription​(java.lang.String merchantTransactionCode,
                                                        java.lang.String subscriptionID,
                                                        java.lang.String paymentProvider,
                                                        AddressModel paymentAddress,
                                                        CardInfo card)
        Updates the data of the subscription at the payment provider.
        Parameters:
        merchantTransactionCode - the transactionCode
        subscriptionID - the subscription ID
        paymentProvider - the paymentProvider who holds the subscription. You get this value from the PaymentTransactionModel of the createSubscription command. You might also have just one payment provider in your implementation.
        paymentAddress - the new billing address, could be null
        card - the updated card, could be null
        Returns:
        instance of PaymentTransactionEntryModel
      • getSubscriptionData

        PaymentTransactionEntryModel getSubscriptionData​(java.lang.String merchantTransactionCode,
                                                         java.lang.String subscriptionID,
                                                         java.lang.String paymentProvider,
                                                         BillingInfo billingInfo,
                                                         CardInfo card)
        Gets the stored card info or payment address
        Parameters:
        merchantTransactionCode - the transactionCode
        subscriptionID - the subscription ID
        paymentProvider - the paymentProvider who holds the subscription. You get this value from the PaymentTransactionModel of the createSubscription command. You might also have just one payment provider in your implementation.
        billingInfo - the billing address is returned in this DTO
        card - the card information is returned in this DTO
        Returns:
        instance of PaymentTransactionEntryModel
      • deleteSubscription

        PaymentTransactionEntryModel deleteSubscription​(java.lang.String merchantTransactionCode,
                                                        java.lang.String subscriptionID,
                                                        java.lang.String paymentProvider)
        Deletes the subscription at the payment provider. Warning: Deleting a customer profile is permanent. You cannot recover a deleted customer profile.
        Parameters:
        merchantTransactionCode - the transactionCode
        subscriptionID - the subscription ID
        paymentProvider - the paymentProvider who holds the subscription. You get this value from the PaymentTransactionModel of the createSubscription command. You might also have just one payment provider in your implementation.
        Returns:
        instance of PaymentTransactionEntryModel