Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change 2.0 #5964

Open
NicolasDorier opened this issue May 1, 2024 · 1 comment
Open

Breaking change 2.0 #5964

NicolasDorier opened this issue May 1, 2024 · 1 comment

Comments

@NicolasDorier
Copy link
Member

NicolasDorier commented May 1, 2024

This is documenting the breaking changes for 2.0.

Pull payments

Payment Methods

#5809
Payment methods id name have been rewritten to be consistent between API and Backend.

  • BTC-OnChain or BTC_BitcoinLike or BTC-BitcoinLike or BTC-BTCLike -> BTC-CHAIN
  • BTC-LightningNetwork or BTC_LightningLike or BTC_OffChain or BTC_Off-Chain -> BTC-LN
  • BTC-LNURLPAY->BTC-LNURL
  • XMR-MoneroLike->XMR-CHAIN
  • ZEC-ZcashLike->ZEC-CHAIN

Note that it isn't a breaking change for input data to API, as BTCPay will automatically convert the old strings to the new format.
However, data returned by BTCPay API will return the new names.

The API needed to be changed to reflect the fact payment methods doesn't have a PaymentType anymore:

Removed routes:

  • GET /api/v1/stores/{storeId}/payment-methods/LNURL
  • GET /api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}
  • PUT /api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}
  • DELETE /api/v1/stores/{storeId}/payment-methods/LNURLPay/{cryptoCode}
  • GET /api/v1/stores/{storeId}/payment-methods/LightningNetwork
  • GET /api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}
  • PUT /api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}
  • DELETE /api/v1/stores/{storeId}/payment-methods/LightningNetwork/{cryptoCode}
  • GET /api/v1/stores/{storeId}/payment-methods/OnChain
  • GET /api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}
  • PUT /api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}
  • DELETE /api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}

Modified route:

  • GET /api/v1/stores/{storeId}/payment-methods
    • Remove the cryptoCode field
    • Rename the paymentMethod to paymentMethodId field
    • Rename the data property to config
    • Rename networkFee to paymentMethodFee
    • Rename the query parameter enabled to onlyEnabled
    • Add includeConfig parameter defaulting to false. If true, the config of the payment method will be returned and the permission btcpay.store.canmodifystoresettings is required.
  • GET /api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods
    • Remove the cryptoCode field
    • Renamed paymentMethod to paymentMethodId
    • Add a currency field

Added route:

  • PUT /api/v1/stores/{storeId}/payment-methods/{paymentMethodId}
  • DELETE /api/v1/stores/{storeId}/payment-methods/{paymentMethodId}
  • GET /api/v1/stores/{storeId}/payment-methods/{paymentMethodId}

Renamed route:

  • GET api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/preview to api/v1/stores/{storeId}/payment-methods/{paymentMethodId}/preview
  • POST api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/generate to api/v1/stores/{storeId}/payment-methods/{paymentMethodId}/generate
  • Removed properties cryptoCode and paymentMethod from their response.
  • Added property paymentMethodId, config so the format of generate is the same as the GET /api/v1/stores/{storeId}/payment-methods/{paymentMethodId}

Webhook change:

  • Rename paymentMethod field to paymentMethodId

Legacy Bitpay API:

  • Removal of the confirmed state, an invoice directly goes to the complete state.

Apps

Removal of embeddedCSS, customCSSLink for PaymentRequests, Crowdfund app and PoS app.
Instead, customizations should be done at the store's branding level through logoUrl, cssUrl, paymentSoundUrl and brandColor. (#5947)

Modal Checkout

  • When the Checkout is in modal mode, it posts the message { invoiceId, status } to the parent window. Previously, the status could be new, paid complete, invalid, expired state. These have been replaced by New, Processing, Settled, Invalid, Expired.
@dennisreimann
Copy link
Member

I think we should turn this into a 2.0 Migration page in the docs once this is done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants