Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in
  • Welcome
    • Guidelines
    • News and Events
    • Suggestions for PayPal
    • General Discussions
  • PayPal Help Community
    • Managing Account
    • Transactions
    • Wallet
    • Security and Fraud
    • Products & Services
    • Reporting
  • MTS Community
    • PayPal Upgrade Community
    • PayPal Payments Standard
    • REST APIs
    • NVP/SOAP APIs
    • SDKs
    • Sandbox Environment
    • PayPal Reporting
    • Payflow
    • Ideas for MTS
    • Client-side Integration
    • Server-side Integration
  • The Archives
    • PayPal Help Community Archives
      • Managing Account Archives
      • Transactions Archives
      • Wallet Archives
      • Security and Fraud Archives
      • Products & Services Archives
      • Reporting Archives
    • Help Community
      • PayPal Basics Archives
      • Payments Archives
      • My Money Archives
      • My Account Archives
      • Disputes and Limitations Archives
      • Products and Services Archives
      • PayPal Credit Archives
    • Merchant Community
      • Merchant Products
      • Business Tools Archives
      • Reporting Archives
      • Managing Risk and Fraud Archives
    • Help Archives
      • About Business (Archive)
      • About Payments (Archive)
      • About Settings (Archive)
      • About eBay (Archive)
      • About Protections (Archive)
      • About Products (Archive)
    • Social and Your Voice Archives
      • Off Topic (Archive)
      • My Feedback for PayPal (Archive)
    • About PayPal Archives
      • Watercooler (Archive)
      • Tax Information (Archive)
      • Fees (Archive)
      • eBay and PayPal (Archive)
      • Coupons and promotions (Archive)
    • My Account Archives
      • My account settings (Archive)
      • Account limits and verification (Archive)
      • Account balance (Archive)
      • Bank accounts and credit cards (Archive)
    • Payments Archives
      • Sending money (Archive)
      • Receiving money (Archive)
      • Refunds (Archive)
      • Donations and Fundraising (Archive)
    • Disputes and Security Archives
      • Disputes and claims (Archive)
      • Fraud, phishing and spoof (Archive)
    • My Business Archives
      • Merchant services (Archive)
      • Reporting and tracking (Archive)
      • Shipping (Archive)
    • PayPal Products Archives
      • PayPal Debit Mastercard (Archive)
      • PayPal Extras MasterCard (Archive)
      • PayPal Mobile & Other Services (Archive)
      • Student Accounts (Archive)
      • Bill Me Later (Archive)
    • Getting to know PayPal
      • My PayPal account
      • Security and protection
    • Receiving and sending money
      • Buying with PayPal
      • Selling with PayPal
    • PayPal Here UK
      • PayPal Here News and Events
      • PayPal Here Community
      • Chip and Pin Card Reader
      • PayPal Here App

The Community Forum is not available for new posts or responses; previous posts remain available to review. For comprehensive support options, please visit PayPal.com/HelpCenter
Merchant Technical Support: For technical support and related questions, please visit our Technical Support Help Center or Developer Central

If you want to report illegal content under the EU Digital Services Act, please do so here

since ‎Jul-12-2018
Country: Sweden
Type: Business
kallestad
kallestad Contributor
Contributor
1
Post
0
Kudos
0
Solutions
Your PayPal Anniversary
The Return
Active
View all
Latest Contributions by kallestad
  • Topics kallestad has Participated In
  • Latest Contributions by kallestad

Making billing plan active

by kallestad Contributor in REST APIs
‎Jul-12-2018 02:38 AM
‎Jul-12-2018 02:38 AM
Hi,   I am new to the PayPal SDK and I am trying to create a billing plan and change its status to ACTIVE. I have tried some sample Java code from the SDK tutorial but I can't get that code to work. Status remains CREATED. The code I tried can be found below. The output from running the code is reated plan with id = P-1MT21723NA428154CRJGOTXQ Plan state = CREATED Plan state = CREATED Best regards /Lasse   // Build Plan object Plan plan = new Plan(); plan.setName("T-Shirt of the Month Club Plan"); plan.setDescription("Template creation."); plan.setType("fixed"); // Payment_definitions PaymentDefinition paymentDefinition = new PaymentDefinition(); paymentDefinition.setName("Regular Payments"); paymentDefinition.setType("REGULAR"); paymentDefinition.setFrequency("MONTH"); paymentDefinition.setFrequencyInterval("1"); paymentDefinition.setCycles("12"); // Currency Currency currency = new Currency(); currency.setCurrency("USD"); currency.setValue("20"); paymentDefinition.setAmount(currency); // Charge_models ChargeModels chargeModels = new com.paypal.api.payments.ChargeModels(); chargeModels.setType("SHIPPING"); chargeModels.setAmount(currency); List<ChargeModels> chargeModelsList = new ArrayList<>(); chargeModelsList.add(chargeModels); paymentDefinition.setChargeModels(chargeModelsList); // Payment_definition List<PaymentDefinition> paymentDefinitionList = new ArrayList<>(); paymentDefinitionList.add(paymentDefinition); plan.setPaymentDefinitions(paymentDefinitionList); // Merchant_preferences MerchantPreferences merchantPreferences = new MerchantPreferences(); merchantPreferences.setSetupFee(currency); merchantPreferences.setCancelUrl("https://example.com/cancel"); merchantPreferences.setReturnUrl("https://example.com/return"); merchantPreferences.setMaxFailAttempts("0"); merchantPreferences.setAutoBillAmount("YES"); merchantPreferences.setInitialFailAmountAction("CONTINUE"); plan.setMerchantPreferences(merchantPreferences); // Create payment Plan createdPlan = plan.create(apiContext); System.out.println("Created plan with id = " + createdPlan.getId()); System.out.println("Plan state = " + createdPlan.getState()); // Set up plan activate PATCH request List<Patch> patchRequestList = new ArrayList<>(); Map<String, String> value = new HashMap<>(); value.put("state", "ACTIVE"); // Create update object to activate plan Patch patch = new Patch(); patch.setPath("/"); patch.setValue(value); patch.setOp("replace"); patchRequestList.add(patch); // Activate plan createdPlan.update(apiContext, patchRequestList); System.out.println("Plan state = " + createdPlan.getState()); ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros
Welcome to the PayPal Community!