Skip to content

Migration guide for v9

Kamil Pajdzik edited this page Jul 31, 2022 · 1 revision

Changes in 9.0.0 - 2022-08-01

"⚠️" symbol highlights breaking changes.

Added

  • Add alternate_statement_descriptors, authorization_code, and level3 properties to Charge resource.
  • Add previewLines method to CreditNote resource.
  • Add transfer_data property to Subscription resource.
  • Add SOURCE_TYPE_FPX constant to Transfer resource.
  • Add new error code constants to ErrorObject: CODE_ACCOUNT_ERROR_COUNTRY_CHANGE_REQUIRES_ADDITIONAL_STEPS, CODE_ACCOUNT_INFORMATION_MISMATCH, CODE_ACSS_DEBIT_SESSION_INCOMPLETE, CODE_AUTHENTICATION_REQUIRED, CODE_BANK_ACCOUNT_BAD_ROUTING_NUMBERS, CODE_BANK_ACCOUNT_DECLINED, CODE_BANK_ACCOUNT_VERIFICATION_FAILED, CODE_BILLING_INVALID_MANDATE, CODE_CARD_DECLINE_RATE_LIMIT_EXCEEDED, CODE_CARDHOLDER_PHONE_NUMBER_REQUIRED, CODE_CHARGE_INVALID_PARAMETER, CODE_CLEARING_CODE_UNSUPPORTED, CODE_COUNTRY_CODE_INVALID, CODE_CUSTOMER_MAX_PAYMENT_METHODS, CODE_DEBIT_NOT_AUTHORIZED, CODE_INSTANT_PAYOUTS_LIMIT_EXCEEDED, CODE_INSUFFICIENT_FUNDS, CODE_INTENT_INVALID_STATE, CODE_INTENT_VERIFICATION_METHOD_MISSING, CODE_INVALID_CHARACTERS, CODE_INVOICE_NO_PAYMENT_METHOD_TYPES, CODE_INVOICE_ON_BEHALF_OF_NOT_EDITABLE, CODE_NO_ACCOUNT, CODE_PAYMENT_INTENT_ACTION_REQUIRED, CODE_PAYMENT_INTENT_KONBINI_REJECTED_CONFIRMATION_NUMBER, CODE_PAYMENT_INTENT_MANDATE_INVALID, CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_EXPIRED, CODE_PAYMENT_METHOD_BANK_ACCOUNT_ALREADY_VERIFIED, CODE_PAYMENT_METHOD_BANK_ACCOUNT_BLOCKED, CODE_PAYMENT_METHOD_BILLING_DETAILS_ADDRESS_MISSING, CODE_PAYMENT_METHOD_CURRENCY_MISMATCH, CODE_PAYMENT_METHOD_INVALID_PARAMETER, CODE_PAYMENT_METHOD_INVALID_PARAMETER_TESTMODE, CODE_PAYMENT_METHOD_MICRODEPOSIT_FAILED, CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_INVALID, CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_MISMATCH, CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_ATTEMPTS_EXCEEDED, CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_DESCRIPTOR_CODE_MISMATCH, CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_TIMEOUT, CODE_PAYMENT_METHOD_PROVIDER_DECLINE, CODE_PAYMENT_METHOD_PROVIDER_TIMEOUT, CODE_PAYMENT_METHOD_UNSUPPORTED_TYPE, CODE_PLATFORM_ACCOUNT_REQUIRED, CODE_REFER_TO_CUSTOMER, CODE_REFUND_DISPUTED_PAYMENT, CODE_RETURN_INTENT_ALREADY_PROCESSED, CODE_SETUP_INTENT_INVALID_PARAMETER, CODE_SETUP_INTENT_SETUP_ATTEMPT_EXPIRED, CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED, and TRANSFER_SOURCE_BALANCE_PARAMETERS_MISMATCH

⚠️ Changed

  • Change type of source property on Charge resource to no longer accept an instance of AlipayAccount or BitcoinReceiver.
  • Change type of default_source property on Customer resource to no longer accept an instance of AlipayAccount or BitcoinReceiver.
  • Change return type of allSources, createSource, deleteSource, retrieveSource, and updateSource methods on Customer resource and CustomerService service. They no longer return an instance of AlipayAccount or BitcoinReceiver.
  • Change type of default_source property on Invoice resource to no longer accept an instance of AlipayAccount or BitcoinReceiver.
  • Change type of source property on PaymentIntent resource to no longer accept an instance of AlipayAccount or BitcoinReceiver.
  • Change type of default_source property on Subscription resource to no longer accept an instance of AlipayAccount or BitcoinReceiver.
  • Updated certificate bundle (#1314)
  • Add params parameter to close method in Dispute resource.
    • No changes are necessary if the method was invoked like below:
    $dispute->close();
    • Following adjustment has to be made if opts parameter was used:
    // If "params" parameter is not used, change
    $dispute->close([/* opts */]);
    // to
    $dispute->close(null, [/* opts */]);

Fixed

  • Fix return type of allLineItems method in SessionService.

⚠️ Removed

  • Remove deprecated AlipayAccount, BitcoinReceiver, BitcoinTransaction, Recipient, RecipientTransfer, and ThreeDSecure resources.
  • Remove CAPABILITY_CARD_PAYMENTS, CAPABILITY_LEGACY_PAYMENTS, CAPABILITY_PLATFORM_PAYMENTS, CAPABILITY_TRANSFERS, CAPABILITY_STATUS_ACTIVE, CAPABILITY_STATUS_INACTIVE, and CAPABILITY_STATUS_PENDING constants from Account resource. Please use up-to-date values from https://stripe.com/docs/connect/account-capabilities.
  • Remove AssociatedObjects array property from EphemeralKey resource. The field was undocumented and unsupported.
  • Remove details method from Card resource. The endpoint was deprecated and no longer exists.
  • Remove recipient property from Card resource. The property was deprecated.
  • Remove ability to list Card resources for a particular Recipient.
  • Remove sources property from Card resource. The property was deprecated.
  • Remove FAILURE_REASON constant from Refund resource. The value was deprecated.
  • Remove Recipient resource. The resource was deprecated.
  • Remove OrderItem resource. The resource was deprecated.
  • Remove all method from LineItem.
  • Remove cancel method from Transfer and TransferService. This method is deprecated.
  • Remove allTransactions method from SourceService service. Please use allSourceTransactions method instead.
    // change
    $stripe->sources->allTransactions("src_12345");
    // to
    $stripe->sources->allSourceTransactions("src_12345");
  • Remove persons method from Account resource. Please use allPersons method instead.
    // change
    Account::persons("acct_1234")
    // to
    Account::allPersons("acct_1234")
  • Remove sourceTransactions method from Source resource. Please use allSourceTransactions method instead.
    // change
    Source::sourceTransactions("src_12345");
    // to
    Source::allSourceTransactions("src_12345");
  • Remove usageRecordSummaries method from SubscriptionItem resource. Please use allUsageRecordSummaries method instead.
    // change
    SubscriptionItem::usageRecordSummaries("sub_12345");
    // to
    SubscriptionItem::allUsageRecordSummaries("sub_12345");
  • Remove SOURCE_TYPE_ALIPAY_ACCOUNT and SOURCE_TYPE_FINANCING constants from Transfer resource. The values were deprecated and are no longer in use.
  • Remove deprecated error code constants from ErrorObject: CODE_ACCOUNT_ALREADY_EXISTS, CODE_ORDER_CREATION_FAILED, CODE_ORDER_REQUIRED_SETTINGS, CODE_ORDER_STATUS_INVALID, CODE_ORDER_UPSTREAM_TIMEOUT, and CODE_UPSTREAM_ORDER_CREATION_FAILED.
  • Remove deprecated event constants from Webhook: ISSUER_FRAUD_RECORD_CREATED, ORDER_PAYMENT_FAILED, ORDER_PAYMENT_SUCCEEDED, ORDER_UPDATED, ORDER_RETURN_CREATED, PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED, PING, PROMOTION_CODE_DELETED, and TREASURY_RECEIVED_CREDIT_REVERSED. The events are deprecated and no longer sent by Stripe.