贝宝(Paypal)针对产品的订阅类型扣除两次付款

时间:2019-01-31 10:31:34

标签: paypal magento2 subscription paypal-subscriptions recurring-billing

我已经在 Magento 2.2.5 CE 中创建了虚拟(订阅)类型的产品。

当我尝试购买订阅类型产品(重复付款类型)时,PayPal返回三个IPN。 我已将其用作参考Handling Recurring Payments (我已经过时了,但我们会尽快升级)

我通过Paypal Express下订单时,PayPal会扣除相同金额的两倍。我认为PayPal首先将我的订单视为simple sale order,然后在创建recurring profile并扣除定期付款之后。我之所以得出这样的结论,是因为需要调试日志 IPN 消息


IPN邮件类型

  
      
  • 'txn_type'= 购物车/(有时是express_checkout)
  •   
  • 'txn_type'= 已创建的定期付款配置文件
  •   
  • 'txn_type'= 定期付款
  •   

日志

    [2019-01-31 07:24:01] main.DEBUG: array (
      'url' => 'https://api-3t.sandbox.paypal.com/nvp',
      'SetExpressCheckout' => 
      array (
        'PAYMENTACTION' => 'Sale',
        'AMT' => '49.99',
        'CURRENCYCODE' => 'USD',
        'RETURNURL' => 'https://recurring_products.com/paypal/express/return/',
        'CANCELURL' => 'https://recurring_products.com/paypal/express/cancel/',
        'INVNUM' => '1000049131',
        'SOLUTIONTYPE' => 'Mark',
        'NOSHIPPING' => 1,
        'GIROPAYCANCELURL' => 'https://recurring_products.com/paypal/express/cancel/',
        'GIROPAYSUCCESSURL' => 'https://recurring_products.com/checkout/onepage/success/',
        'BANKTXNPENDINGURL' => 'https://recurring_products.com/checkout/onepage/success/',
        'SHIPPINGAMT' => '0.00',
        'ITEMAMT' => '49.99',
        'TAXAMT' => '0.00',
        'L_NUMBER0' => NULL,
        'L_NAME0' => 'Monthly',
        'L_QTY0' => 1,
        'L_AMT0' => '49.99',
        'L_BILLINGTYPE0' => 'RecurringPayments',
        'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => 'Digital',
        'L_BILLINGAGREEMENTDESCRIPTION0' => 'Monthly Subscription',
        'METHOD' => 'SetExpressCheckout',
        'VERSION' => '72.0',
        'USER' => '****',
        'PWD' => '****',
        'SIGNATURE' => '****',
        'BUTTONSOURCE' => 'Magento_Cart_Community',
      ),
      'response' => 
      array (
        'TOKEN' => 'EC-xxxxxxxxxxxxxxxxx',
        'TIMESTAMP' => '2019-01-31T07:24:01Z',
        'CORRELATIONID' => 'xxxxxxxxxxxx',
        'ACK' => 'Success',
        'VERSION' => '72.0',
        'BUILD' => '88888888',
      ),
    ) [] []
    [2019-01-31 07:24:36] main.DEBUG: array (
      'url' => 'https://api-3t.sandbox.paypal.com/nvp',
      'GetExpressCheckoutDetails' => 
      array (
        'TOKEN' => 'EC-xxxxxxxxxxxxxxxxx',
        'METHOD' => 'GetExpressCheckoutDetails',
        'VERSION' => '72.0',
        'USER' => '****',
        'PWD' => '****',
        'SIGNATURE' => '****',
        'BUTTONSOURCE' => 'Magento_Cart_Community',
      ),
      'response' => 
      array (
        'TOKEN' => 'EC-xxxxxxxxxxxxxxxxx',
        'BILLINGAGREEMENTACCEPTEDSTATUS' => '1',
        'CHECKOUTSTATUS' => 'PaymentActionNotInitiated',
        'TIMESTAMP' => '2019-01-31T07:24:36Z',
        'CORRELATIONID' => '633419f321d4a',
        'ACK' => 'Success',
        'VERSION' => '72.0',
        'BUILD' => '88888888',
        'EMAIL' => 'sample.user@example.com',
        'PAYERID' => 'zzzzzzzzzzzzzzz',
        'PAYERSTATUS' => 'verified',
        'FIRSTNAME' => 'test',
        'LASTNAME' => 'buyer',
        'COUNTRYCODE' => 'US',
        'ADDRESSSTATUS' => 'Confirmed',
        'CURRENCYCODE' => 'USD',
        'AMT' => '49.99',
        'ITEMAMT' => '49.99',
        'SHIPPINGAMT' => '0.00',
        'HANDLINGAMT' => '0.00',
        'TAXAMT' => '0.00',
        'INVNUM' => '1000049131',
        'NOTIFYURL' => 'http://recurring_products.com/paypal/ipn',
        'INSURANCEAMT' => '0.00',
        'SHIPDISCAMT' => '0.00',
        'INSURANCEOPTIONOFFERED' => 'false',
        'L_NAME0' => 'Monthly',
        'L_QTY0' => '1',
        'L_TAXAMT0' => '0.00',
        'L_AMT0' => '49.99',
        'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
        'PAYMENTREQUEST_0_AMT' => '49.99',
        'PAYMENTREQUEST_0_ITEMAMT' => '49.99',
        'PAYMENTREQUEST_0_SHIPPINGAMT' => '0.00',
        'PAYMENTREQUEST_0_HANDLINGAMT' => '0.00',
        'PAYMENTREQUEST_0_TAXAMT' => '0.00',
        'PAYMENTREQUEST_0_INVNUM' => '1000049131',
        'PAYMENTREQUEST_0_NOTIFYURL' => 'http://recurring_products.com/paypal/ipn',
        'PAYMENTREQUEST_0_INSURANCEAMT' => '0.00',
        'PAYMENTREQUEST_0_SHIPDISCAMT' => '0.00',
        'PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID' => 'business.paypal@example.com',
        'PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED' => 'false',
        'L_PAYMENTREQUEST_0_NAME0' => 'Monthly',
        'L_PAYMENTREQUEST_0_QTY0' => '1',
        'L_PAYMENTREQUEST_0_TAXAMT0' => '0.00',
        'L_PAYMENTREQUEST_0_AMT0' => '49.99',
        'PAYMENTREQUESTINFO_0_ERRORCODE' => '0',
      ),
    ) [] []
    [2019-01-31 07:24:38] main.DEBUG: array (
      'url' => 'https://api-3t.sandbox.paypal.com/nvp',
      'CreateRecurringPaymentsProfile' => 
      array (
        'TOKEN' => 'EC-xxxxxxxxxxxxxxxxx',
        'PROFILESTARTDATE' => '2019-01-30 23:24:36',
        'PROFILEREFERENCE' => '44-ddddddddddddddddddddddddddddddd',
        'DESC' => 'Monthly Subscription',
        'AUTOBILLAMT' => 'AddToNextBilling',
        'BILLINGPERIOD' => 'Month',
        'BILLINGFREQUENCY' => '1',
        'AMT' => '49.99',
        'CURRENCYCODE' => 'USD',
        'METHOD' => 'CreateRecurringPaymentsProfile',
        'VERSION' => '72.0',
        'USER' => '****',
        'PWD' => '****',
        'SIGNATURE' => '****',
        'BUTTONSOURCE' => 'Magento_Cart_Community',
      ),
      'response' => 
      array (
        'PROFILEID' => 'I-WWWWWWWW',
        'PROFILESTATUS' => 'ActiveProfile',
        'TIMESTAMP' => '2019-01-31T07:24:38Z',
        'CORRELATIONID' => '666666666666',
        'ACK' => 'Success',
        'VERSION' => '72.0',
        'BUILD' => '44444444',
      ),
    ) [] []
    [2019-01-31 07:24:41] main.DEBUG: array (
      'url' => 'https://api-3t.sandbox.paypal.com/nvp',
      'DoExpressCheckoutPayment' => 
      array (
        'TOKEN' => 'EC-xxxxxxxxxxxxxxxxx',
        'PAYERID' => 'zzzzzzzzzzzzzzz',
        'PAYMENTACTION' => 'Sale',
        'AMT' => '49.99',
        'CURRENCYCODE' => 'USD',
        'BUTTONSOURCE' => 'Magento_Cart_Community',
        'NOTIFYURL' => 'https://recurring_products.com/paypal/ipn/',
        'RETURNFMFDETAILS' => 1,
        'SHIPPINGAMT' => '0.00',
        'ITEMAMT' => '49.99',
        'TAXAMT' => '0.00',
        'L_NUMBER0' => NULL,
        'L_NAME0' => 'Monthly',
        'L_QTY0' => 1,
        'L_AMT0' => '49.99',
        'BUSINESS' => NULL,
        'EMAIL' => 'sample.user@example.com',
        'FIRSTNAME' => 'test',
        'LASTNAME' => 'buyer',
        'MIDDLENAME' => NULL,
        'SALUTATION' => NULL,
        'SUFFIX' => NULL,
        'COUNTRYCODE' => 'US',
        'STATE' => NULL,
        'CITY' => NULL,
        'STREET' => '',
        'ZIP' => NULL,
        'PHONENUM' => NULL,
        'ADDROVERRIDE' => 1,
        'METHOD' => 'DoExpressCheckoutPayment',
        'VERSION' => '72.0',
        'USER' => '****',
        'PWD' => '****',
        'SIGNATURE' => '****',
      ),
      'response' => 
      array (
        'TOKEN' => 'EC-xxxxxxxxxxxxxxxxx',
        'SUCCESSPAGEREDIRECTREQUESTED' => 'false',
        'TIMESTAMP' => '2019-01-31T07:24:41Z',
        'CORRELATIONID' => '5555555555555',
        'ACK' => 'Success',
        'VERSION' => '72.0',
        'BUILD' => '88888888',
        'TRANSACTIONID' => '00000000000000000',
        'TRANSACTIONTYPE' => 'cart',
        'PAYMENTTYPE' => 'instant',
        'ORDERTIME' => '2019-01-31T07:24:41Z',
        'AMT' => '49.99',
        'FEEAMT' => '1.75',
        'TAXAMT' => '0.00',
        'CURRENCYCODE' => 'USD',
        'PAYMENTSTATUS' => 'Completed',
        'PENDINGREASON' => 'None',
        'REASONCODE' => 'None',
        'PROTECTIONELIGIBILITY' => 'Eligible',
        'INSURANCEOPTIONSELECTED' => 'false',
        'SHIPPINGOPTIONISDEFAULT' => 'false',
        'PAYMENTINFO_0_TRANSACTIONID' => '00000000000000000',
        'PAYMENTINFO_0_TRANSACTIONTYPE' => 'cart',
        'PAYMENTINFO_0_PAYMENTTYPE' => 'instant',
        'PAYMENTINFO_0_ORDERTIME' => '2019-01-31T07:24:41Z',
        'PAYMENTINFO_0_AMT' => '49.99',
        'PAYMENTINFO_0_FEEAMT' => '1.75',
        'PAYMENTINFO_0_TAXAMT' => '0.00',
        'PAYMENTINFO_0_CURRENCYCODE' => 'USD',
        'PAYMENTINFO_0_PAYMENTSTATUS' => 'Completed',
        'PAYMENTINFO_0_PENDINGREASON' => 'None',
        'PAYMENTINFO_0_REASONCODE' => 'None',
        'PAYMENTINFO_0_PROTECTIONELIGIBILITY' => 'Eligible',
        'PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE' => 'ItemNotReceivedEligible,UnauthorizedPaymentEligible',
        'PAYMENTINFO_0_SELLERPAYPALACCOUNTID' => 'business.paypal@example.com',
        'PAYMENTINFO_0_SECUREMERCHANTACCOUNTID' => '2222222222222',
        'PAYMENTINFO_0_ERRORCODE' => '0',
        'PAYMENTINFO_0_ACK' => 'Success',
      ),
    ) [] []

更新

我已经在贝宝(Paypal)中签入,也收到了双重付款。 贝宝夏季页面参考屏幕截图

enter image description here

0 个答案:

没有答案