Does PayPal include payment integration options that do not require showing PayPal to the user?

后端 未结 6 1705
慢半拍i
慢半拍i 2021-02-06 17:14

We are looking to replace our usage of Authorize.net. I\'ve spent a good deal of time looking into the PayPal documentation but can\'t find a clear answer to my question:

<
6条回答
  •  迷失自我
    2021-02-06 17:59

    You can definitely use Paypal as a stand alone credit card processing. The paypal account has to be set up for paypal pro.

    You can download the API DLLs from the paypal dev site.

    paypal_base.dll
    log4net.dll
    

    Here is an example function on how to use it for VB.NET but you can convert to C# relatively easily:

    Imports com.paypal.sdk.services
    Imports com.paypal.soap.api
    Imports com.paypal.sdk.profiles
    
      Private Function processCC() As Boolean
    
    
        Dim caller As New CallerServices
        Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile
    
        profile.APIUsername = AppSettings("APIUsername")
        profile.APIPassword = AppSettings("APIPassword")
        profile.APISignature = AppSettings("APISignature")
        profile.Environment = AppSettings("Environment")
    
        caller.APIProfile = profile
    
        Dim pp_Request As New DoDirectPaymentRequestType
        pp_Request.Version = "51.0"
    
        pp_Request.DoDirectPaymentRequestDetails = New DoDirectPaymentRequestDetailsType
    
        pp_Request.DoDirectPaymentRequestDetails.IPAddress = Request.ServerVariables("REMOTE_ADDR") 
        pp_Request.DoDirectPaymentRequestDetails.MerchantSessionId = Session.SessionID
        pp_Request.DoDirectPaymentRequestDetails.PaymentAction = PaymentActionCodeType.Sale
    
        pp_Request.DoDirectPaymentRequestDetails.CreditCard = New CreditCardDetailsType
    
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CreditCardNumber = Request("ccNumber")
    
        Select Case Request("ccType")
            Case "visa"
                pp_Request.DoDirectPaymentRequestDetails.CreditCard.CreditCardType = CreditCardTypeType.Visa
            Case "mastercard"
                pp_Request.DoDirectPaymentRequestDetails.CreditCard.CreditCardType = CreditCardTypeType.MasterCard
            Case "amex"
                pp_Request.DoDirectPaymentRequestDetails.CreditCard.CreditCardType = CreditCardTypeType.Amex
            Case "discover"
                pp_Request.DoDirectPaymentRequestDetails.CreditCard.CreditCardType = CreditCardTypeType.Discover
        End Select
    
    
    
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CVV2 = Request("CVV2")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.ExpMonth = Request("expMonth")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.ExpMonthSpecified = True
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.ExpYear = Request("expYear")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.ExpYearSpecified = True
    
    
    
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner = New PayerInfoType
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Payer = Request("email")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.PayerID = ""
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.PayerStatus = PayPalUserStatusCodeType.unverified
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.PayerCountry = CountryCodeType.US
    
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address = New AddressType()
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.Street1 = Request("address1")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.Street2 = Request("address2")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.CityName = Request("city")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.StateOrProvince = Request("state")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.PostalCode = Request("zipcode")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.CountryName = "USA"
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.Country = CountryCodeType.US
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.Address.CountrySpecified = True
    
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.PayerName = New PersonNameType()
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.PayerName.FirstName = Request("firstname")
        pp_Request.DoDirectPaymentRequestDetails.CreditCard.CardOwner.PayerName.LastName = Request("lastname")
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails = New PaymentDetailsType()
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.OrderTotal = New BasicAmountType()
    
    
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.OrderTotal.currencyID = CurrencyCodeType.USD
    
        Dim myOrder As Order = CType(Session("currentOrder"), Order)
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.OrderTotal.Value = FormatNumber(myOrder.grandTotal, 2)
    
        'pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.ShippingTotal = New BasicAmountType()
        'pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.ShippingTotal.currencyID = CurrencyCodeType.USD
        'pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.ShippingTotal.Value = FormatNumber(myOrder.orderShippingTotal, 2)
    
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.ItemTotal = New BasicAmountType()
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.ItemTotal.currencyID = CurrencyCodeType.USD
        pp_Request.DoDirectPaymentRequestDetails.PaymentDetails.ItemTotal.Value = FormatNumber(myOrder.orderSubTotal, 2)
    
    
        '// Execute the API operation and obtain the response.
        Dim pp_response As New DoDirectPaymentResponseType()
        pp_response = CType(caller.Call("DoDirectPayment", pp_Request), DoDirectPaymentResponseType)
    
        Session("myResponse") = pp_response
    
        Dim rtn As Boolean = False
    
        Select Case pp_response.Ack
            Case AckCodeType.Failure
                rtn = False
            Case AckCodeType.FailureWithWarning
                rtn = False
            Case AckCodeType.Success
                Return True
            Case AckCodeType.SuccessWithWarning
                rtn = True
            Case AckCodeType.Warning
                rtn = False
    
        End Select
    
        Return rtn
    
    End Function
    

提交回复
热议问题