Changeset 1725154
- Timestamp:
- 09/05/2017 08:01:48 PM (9 years ago)
- Location:
- stripe/trunk
- Files:
-
- 303 added
- 18 deleted
- 56 edited
-
assets/css/_mixins.scss (added)
-
assets/css/admin-bar.css (added)
-
assets/css/admin-bar.min.css (added)
-
assets/css/admin-bar.scss (added)
-
assets/css/admin.css (added)
-
assets/css/admin.min.css (added)
-
assets/css/admin.scss (added)
-
assets/css/chosen-sprite.png (added)
-
assets/css/chosen-sprite@2x.png (added)
-
assets/css/chosen.css (added)
-
assets/css/chosen.min.css (added)
-
assets/css/lite-admin-upgrade-link.css (deleted)
-
assets/css/lite-admin-upgrade-link.min.css (deleted)
-
assets/css/public.css (added)
-
assets/css/public.min.css (added)
-
assets/css/public.scss (added)
-
assets/css/shared-admin-main.css (deleted)
-
assets/css/shared-admin-main.min.css (deleted)
-
assets/css/shared-public-main.css (deleted)
-
assets/css/shared-public-main.min.css (deleted)
-
assets/images/icon-16x16.png (deleted)
-
assets/images/icon.png (added)
-
assets/images/loading.gif (added)
-
assets/js/admin.js (added)
-
assets/js/admin.min.js (added)
-
assets/js/lite-admin-upgrade-link.js (deleted)
-
assets/js/lite-admin-upgrade-link.min.js (deleted)
-
assets/js/public.js (added)
-
assets/js/public.min.js (added)
-
assets/js/shared-admin-main.js (deleted)
-
assets/js/shared-admin-main.min.js (deleted)
-
assets/js/shared.js (added)
-
assets/js/shared.min.js (added)
-
assets/js/vendor (added)
-
assets/js/vendor/accounting.js (added)
-
assets/js/vendor/accounting.min.js (added)
-
assets/js/vendor/chosen.jquery.js (added)
-
assets/js/vendor/chosen.jquery.min.js (added)
-
assets/js/vendor/jquery.validate.js (added)
-
assets/js/vendor/jquery.validate.min.js (added)
-
classes (deleted)
-
i18n/stripe.pot (deleted)
-
i18n/translating.txt (deleted)
-
includes (added)
-
includes/autoload.php (added)
-
includes/core (added)
-
includes/core/abstracts (added)
-
includes/core/abstracts/admin-page.php (added)
-
includes/core/abstracts/custom-field.php (added)
-
includes/core/abstracts/field.php (added)
-
includes/core/abstracts/form.php (added)
-
includes/core/admin (added)
-
includes/core/admin/assets.php (added)
-
includes/core/admin/fields (added)
-
includes/core/admin/fields/checkbox.php (added)
-
includes/core/admin/fields/editor.php (added)
-
includes/core/admin/fields/radio.php (added)
-
includes/core/admin/fields/select.php (added)
-
includes/core/admin/fields/standard.php (added)
-
includes/core/admin/menus.php (added)
-
includes/core/admin/metaboxes (added)
-
includes/core/admin/metaboxes/custom-fields.php (added)
-
includes/core/admin/metaboxes/settings.php (added)
-
includes/core/admin/metaboxes/views (added)
-
includes/core/admin/metaboxes/views/custom-fields (added)
-
includes/core/admin/metaboxes/views/custom-fields/custom-fields-payment-button-html.php (added)
-
includes/core/admin/metaboxes/views/tabs (added)
-
includes/core/admin/metaboxes/views/tabs/tab-form-display.php (added)
-
includes/core/admin/metaboxes/views/tabs/tab-overlay-display.php (added)
-
includes/core/admin/metaboxes/views/tabs/tab-payment-options.php (added)
-
includes/core/admin/metaboxes/views/tabs/tab-subscription-options.php (added)
-
includes/core/admin/notices.php (added)
-
includes/core/admin/pages (added)
-
includes/core/admin/pages.php (added)
-
includes/core/admin/pages/display.php (added)
-
includes/core/admin/pages/general.php (added)
-
includes/core/admin/pages/keys.php (added)
-
includes/core/admin/pages/main.php (added)
-
includes/core/admin/pages/system-status.php (added)
-
includes/core/admin/tables (added)
-
includes/core/admin/tables/form-list-table.php (added)
-
includes/core/admin/wp-list-table.php (added)
-
includes/core/assets.php (added)
-
includes/core/browser.php (added)
-
includes/core/cache-helper.php (added)
-
includes/core/forms (added)
-
includes/core/forms/default-form.php (added)
-
includes/core/forms/fields (added)
-
includes/core/forms/fields/payment-button.php (added)
-
includes/core/forms/preview.php (added)
-
includes/core/functions (added)
-
includes/core/functions/admin.php (added)
-
includes/core/functions/shared.php (added)
-
includes/core/installation.php (added)
-
includes/core/libraries (added)
-
includes/core/libraries/wp-session (added)
-
includes/core/libraries/wp-session/class-recursive-arrayaccess.php (added)
-
includes/core/libraries/wp-session/class-wp-session-utils.php (added)
-
includes/core/libraries/wp-session/class-wp-session.php (added)
-
includes/core/libraries/wp-session/wp-session.php (added)
-
includes/core/main.php (added)
-
includes/core/objects.php (added)
-
includes/core/payments (added)
-
includes/core/payments/charge.php (added)
-
includes/core/payments/customer.php (added)
-
includes/core/payments/details.php (added)
-
includes/core/payments/payment.php (added)
-
includes/core/payments/setup.php (added)
-
includes/core/payments/stripe-api.php (added)
-
includes/core/post-types.php (added)
-
includes/core/session.php (added)
-
includes/core/shortcodes.php (added)
-
includes/old (added)
-
includes/old/assets (added)
-
includes/old/assets/css (added)
-
includes/old/assets/css/lite-admin-upgrade-link.css (added)
-
includes/old/assets/css/lite-admin-upgrade-link.min.css (added)
-
includes/old/assets/css/shared-admin-main.css (added)
-
includes/old/assets/css/shared-admin-main.min.css (added)
-
includes/old/assets/css/shared-public-main.css (added)
-
includes/old/assets/css/shared-public-main.min.css (added)
-
includes/old/assets/js (added)
-
includes/old/assets/js/lite-admin-upgrade-link.js (added)
-
includes/old/assets/js/lite-admin-upgrade-link.min.js (added)
-
includes/old/assets/js/shared-admin-main.js (added)
-
includes/old/assets/js/shared-admin-main.min.js (added)
-
includes/old/classes (added)
-
includes/old/classes/class-mm-settings-output.php (added)
-
includes/old/classes/class-mm-settings.php (added)
-
includes/old/classes/class-stripe-checkout-lite-scripts.php (added)
-
includes/old/classes/class-stripe-checkout-lite-shortcodes.php (added)
-
includes/old/classes/class-stripe-checkout-lite-upgrade-link.php (added)
-
includes/old/classes/class-stripe-checkout-lite-upgrade.php (added)
-
includes/old/classes/class-stripe-checkout-shared-admin.php (added)
-
includes/old/classes/class-stripe-checkout-shared-functions.php (added)
-
includes/old/classes/class-stripe-checkout-shared-misc.php (added)
-
includes/old/classes/class-stripe-checkout-shared-notices.php (added)
-
includes/old/classes/class-stripe-checkout-shared-settings-extended.php (added)
-
includes/old/classes/class-stripe-checkout-shared.php (added)
-
includes/old/classes/wp-requirements.php (added)
-
includes/old/i18n (added)
-
includes/old/i18n/translating.txt (added)
-
includes/old/license.txt (added)
-
includes/old/stripe-checkout.php (added)
-
includes/old/views (added)
-
includes/old/views/admin-shared-main.php (added)
-
includes/old/views/admin-shared-notice-api.php (added)
-
includes/old/views/admin-shared-notice-install.php (added)
-
includes/old/views/admin-shared-tab-default.php (added)
-
includes/old/views/admin-shared-tab-stripe-keys.php (added)
-
includes/promos (added)
-
includes/promos/promo-loader.php (added)
-
includes/promos/views (added)
-
includes/promos/views/checkout-overlay-tab-promo.php (added)
-
includes/promos/views/form-display-tab-promo.php (added)
-
includes/promos/views/generic-tab-promo.php (added)
-
includes/promos/views/payment-options-tab-promo.php (added)
-
includes/promos/views/promo-under-box-footer.php (added)
-
includes/promos/views/promo-under-box-header.php (added)
-
includes/promos/views/sidebar.php (added)
-
includes/promos/views/subscription-tab-promo.php (added)
-
readme.txt (modified) (8 diffs)
-
stripe-checkout.php (deleted)
-
stripe.php (added)
-
uninstall.php (modified) (1 diff)
-
vendor/autoload.php (added)
-
vendor/bin (deleted)
-
vendor/composer (added)
-
vendor/composer/ClassLoader.php (added)
-
vendor/composer/LICENSE (added)
-
vendor/composer/autoload_classmap.php (added)
-
vendor/composer/autoload_namespaces.php (added)
-
vendor/composer/autoload_psr4.php (added)
-
vendor/composer/autoload_real.php (added)
-
vendor/composer/autoload_static.php (added)
-
vendor/composer/installed.json (added)
-
vendor/composer/installers (added)
-
vendor/composer/installers/CHANGELOG.md (added)
-
vendor/composer/installers/CONTRIBUTING.md (added)
-
vendor/composer/installers/LICENSE (added)
-
vendor/composer/installers/README.md (added)
-
vendor/composer/installers/_config.yml (added)
-
vendor/composer/installers/composer.json (added)
-
vendor/composer/installers/phpunit.xml.dist (added)
-
vendor/composer/installers/src (added)
-
vendor/composer/installers/src/Composer (added)
-
vendor/composer/installers/src/Composer/Installers (added)
-
vendor/composer/installers/src/Composer/Installers/AglInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php (added)
-
vendor/composer/installers/src/Composer/Installers/CraftInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/GravInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/HuradInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/Installer.php (added)
-
vendor/composer/installers/src/Composer/Installers/ItopInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MauticInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MayaInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/Plugin.php (added)
-
vendor/composer/installers/src/Composer/Installers/PortoInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/SMFInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php (added)
-
vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/TuskInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/YawikInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ZendInstaller.php (added)
-
vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php (added)
-
vendor/composer/installers/src/bootstrap.php (added)
-
vendor/composer/installers/tests (added)
-
vendor/composer/installers/tests/Composer (added)
-
vendor/composer/installers/tests/Composer/Installers (added)
-
vendor/composer/installers/tests/Composer/Installers/Test (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php (added)
-
vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php (added)
-
vendor/composer/installers/tests/bootstrap.php (added)
-
vendor/stripe/stripe-php/CHANGELOG.md (modified) (1 diff)
-
vendor/stripe/stripe-php/README.md (modified) (3 diffs)
-
vendor/stripe/stripe-php/VERSION (modified) (1 diff)
-
vendor/stripe/stripe-php/examples (added)
-
vendor/stripe/stripe-php/examples/oauth.php (added)
-
vendor/stripe/stripe-php/init.php (modified) (4 diffs)
-
vendor/stripe/stripe-php/lib/Account.php (modified) (4 diffs)
-
vendor/stripe/stripe-php/lib/ApiRequestor.php (modified) (7 diffs)
-
vendor/stripe/stripe-php/lib/ApiResource.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/ApplePayDomain.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/ApplicationFee.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/AttachedObject.php (modified) (3 diffs)
-
vendor/stripe/stripe-php/lib/BalanceTransaction.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/BitcoinReceiver.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Charge.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Collection.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/CountrySpec.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Coupon.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Customer.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Dispute.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/EphemeralKey.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/InvalidGrant.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/InvalidRequest.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/InvalidScope.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php (added)
-
vendor/stripe/stripe-php/lib/Error/OAuth/UnsupportedResponseType.php (added)
-
vendor/stripe/stripe-php/lib/Error/SignatureVerification.php (added)
-
vendor/stripe/stripe-php/lib/Event.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/FileUpload.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php (modified) (5 diffs)
-
vendor/stripe/stripe-php/lib/Invoice.php (modified) (2 diffs)
-
vendor/stripe/stripe-php/lib/InvoiceItem.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/LoginLink.php (added)
-
vendor/stripe/stripe-php/lib/OAuth.php (added)
-
vendor/stripe/stripe-php/lib/Order.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/OrderReturn.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Payout.php (added)
-
vendor/stripe/stripe-php/lib/Plan.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Product.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Recipient.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/RecipientTransfer.php (added)
-
vendor/stripe/stripe-php/lib/Refund.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/SKU.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Source.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Stripe.php (modified) (4 diffs)
-
vendor/stripe/stripe-php/lib/StripeObject.php (modified) (2 diffs)
-
vendor/stripe/stripe-php/lib/Subscription.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/SubscriptionItem.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/ThreeDSecure.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Token.php (modified) (1 diff)
-
vendor/stripe/stripe-php/lib/Transfer.php (modified) (2 diffs)
-
vendor/stripe/stripe-php/lib/Util/DefaultLogger.php (added)
-
vendor/stripe/stripe-php/lib/Util/LoggerInterface.php (added)
-
vendor/stripe/stripe-php/lib/Util/Util.php (modified) (4 diffs)
-
vendor/stripe/stripe-php/lib/Webhook.php (added)
-
vendor/stripe/stripe-php/lib/WebhookSignature.php (added)
-
vendor/stripe/stripe-php/tests/AccountTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/ApiRequestorTest.php (modified) (3 diffs)
-
vendor/stripe/stripe-php/tests/AttachedObjectTest.php (added)
-
vendor/stripe/stripe-php/tests/CardErrorTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/ChargeTest.php (modified) (7 diffs)
-
vendor/stripe/stripe-php/tests/CurlClientTest.php (modified) (2 diffs)
-
vendor/stripe/stripe-php/tests/CustomerTest.php (modified) (6 diffs)
-
vendor/stripe/stripe-php/tests/DisputeTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/EphemeralKeyTest.php (added)
-
vendor/stripe/stripe-php/tests/InvoiceTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/OAuthTest.php (added)
-
vendor/stripe/stripe-php/tests/PayoutTest.php (added)
-
vendor/stripe/stripe-php/tests/ProductTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/RecipientTest.php (modified) (3 diffs)
-
vendor/stripe/stripe-php/tests/TestCase.php (modified) (8 diffs)
-
vendor/stripe/stripe-php/tests/TransferReversalTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/TransferTest.php (modified) (2 diffs)
-
vendor/stripe/stripe-php/tests/UtilDefaultLoggerTest.php (added)
-
vendor/stripe/stripe-php/tests/UtilTest.php (modified) (1 diff)
-
vendor/stripe/stripe-php/tests/WebhookTest.php (added)
-
views (deleted)
-
wordpress_org_assets (deleted)
Legend:
- Unmodified
- Added
- Removed
-
stripe/trunk/readme.txt
r1625278 r1725154 2 2 Contributors: moonstonemedia, pderksen, nickyoung87, nekojira 3 3 Tags: stripe, payments, credit card, stripe payments, stripe checkout 4 Requires at least: 4.3 5 Tested up to: 4.7 6 Stable tag: 1.6.0 4 Requires at least: 4.7 5 Tested up to: 4.8 6 Stable tag: 2.0.0 7 Requires PHP: 5.3 7 8 License: GPLv2 or later 8 9 … … 25 26 That's it. **No other plugins required.** 26 27 27 >**[Check out our demos & P RO version](https://wpsimplepay.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description)**28 29 SSL note: Stripe requires that any page hosting a live checkout form be SSL (they should start with `https://`). [See system requirements.](https:// wpsimplepay.com/docs/getting-started/system-requirements/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description)28 >**[Check out our demos & Pro version](https://demo.wpsimplepay.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description)** 29 30 SSL note: Stripe requires that any page hosting a live checkout form be SSL (they should start with `https://`). [See system requirements.](https://docs.wpsimplepay.com/articles/system-requirements-wp-simple-pay-pro/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description) 30 31 31 32 = LITE VERSION FEATURES = … … 34 35 * Mobile responsive Stripe Checkout overlay 35 36 * Display brand or product image in overlay 36 * Optionally collect customer billing address37 * Optionally collect customer billing & addresses 37 38 * Optionally verify zip/postal code without address 38 * Support for 12 languages, 25 countries and 139 currencies 39 * Support for 12 languages, 25 countries and 135+ currencies 40 * Bitcoin payment option 39 41 * Translation ready 40 * Bitcoin and Alipay payment options41 42 * Multiple Stripe API key support 42 43 * [AffiliateWP](https://affiliatewp.com/) integration 43 44 * Specify payment success & failure pages 44 45 * Live/Test mode toggle 45 * Filters, hooks and [code snippets](https://github.com/moonstonemedia/WP-Simple-Pay-Snippet-Library) for developers46 * [Code snippets](https://github.com/moonstonemedia/WP-Simple-Pay-Snippet-Library/) & [hook reference](https://docs.wpsimplepay.com/articles/action-filter-hooks/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description) for developers 46 47 47 48 = PRO VERSION FEATURES = 48 49 49 50 * *Everything in Lite plus...* 51 * Drag & drop form design controls 50 52 * Custom fields to capture additional data 51 * Custom amounts - let customers enter a mount to pay53 * Custom amounts - let customers enter an amount to pay 52 54 * Coupon code support 55 * Tax rate support 53 56 * Stripe Subscription support 54 57 * Subscription installment plans … … 56 59 * Subscription trial periods 57 60 * [Easy Pricing Tables](https://fatcatapps.com/easypricingtables/) integration 58 * Optionally collect customer shipping address59 61 * Priority email support with a 24-hour response time during business days 60 62 61 >**[Get More with WP Simple Pay P RO for Stripe](https://wpsimplepay.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description)**63 >**[Get More with WP Simple Pay Pro](https://wpsimplepay.com/lite-vs-pro/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description)** 62 64 63 65 == Installation == 64 66 65 [Plugin installation instructions](https://wpsimplepay.com/docs/getting-started/installing-stripe-checkout-lite/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=installation) 67 The easiest way to install WP Simple Pay is to search for it via your site’s Dashboard. 68 69 = Step-by-step instructions = 70 71 1. Log in to your site’s dashboard (e.g. www.yourdomain.com/wp-admin). 72 2. Click on the “Plugins” tab in the left panel, then click “Add New”. 73 3. Search for “Stripe” or “WP Simple Pay” and find our plugin near the top. Look for the author “Moonstone Media”. 74 4. Install it by clicking the “Install Now” link. 75 5. When installation finishes, click “Activate Plugin”. 76 6. A new menu item “Simple Pay Lite” should appear in your dashboard. 77 78 If you prefer installing manually you can [download the plugin ZIP file here](https://downloads.wordpress.org/plugin/stripe.latest-stable.zip). 79 80 Additional documentation at [docs.wpsimplepay.com](https://docs.wpsimplepay.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=installation). 66 81 67 82 == Frequently Asked Questions == … … 69 84 = Where's your plugin documentation? = 70 85 71 Find our docs at [wpsimplepay.com/docs](https://wpsimplepay.com/docs/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=faq) 72 73 = What are the system requirements? = 74 75 SSL is required on live checkout pages, and we recommend staying current with both PHP and WP for security reasons and PCI-DSS compliance. [See system requirements.](https://wpsimplepay.com/docs/getting-started/system-requirements/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=description) 86 Find our docs at [docs.wpsimplepay.com](https://docs.wpsimplepay.com/?utm_source=wordpress.org&utm_medium=link&utm_campaign=simple-pay-lite-readme&utm_content=faq). 76 87 77 88 = Can I get notified by email of new releases? = … … 79 90 [Subscribe here](https://www.getdrip.com/forms/6606935/submissions/new) to be notified by email of major features or updates. 80 91 81 = How do I contribute to WP Simple Pay Lite? =92 = How do I contribute to WP Simple Pay? = 82 93 83 94 We'd love your help! Here's a few things you can do: 84 95 85 * [Rate our plugin](https://wordpress.org/support/ view/plugin-reviews/stripe?postform#postform) and help spread the word!96 * [Rate our plugin](https://wordpress.org/support/plugin/stripe/reviews/#new-post) and help spread the word! 86 97 * Help answer questions in our [community support forum](https://wordpress.org/support/plugin/stripe). 87 98 * Report bugs (with steps to reproduce) or submit pull requests [on GitHub](https://github.com/moonstonemedia/WP-Simple-Pay-Lite-for-Stripe). … … 90 101 == Screenshots == 91 102 92 1. Desktop checkout overlay 93 2. Mobile checkout overlay 103 1. Desktop checkout overlay example 104 2. Mobile checkout overlay example 94 105 3. Settings: Stripe keys 95 106 4. Settings: Site-wide defaults 107 5. Settings: Payment confirmation details 108 6. Payment forms listing 109 7. Payment form settings: One-time amount 110 8. Payment form settings: Payment button 111 9. Payment form settings: Stripe Checkout overlay display 96 112 97 113 == Changelog == 114 115 = 2.0.0 - September 5, 2017 = 116 117 * Feature: Payment form settings overhauled to match WP Simple Pay Pro v3 update. 118 * Feature: Payment forms can be optionally saved as drafts and previewed. 119 * Feature: Button added to post editor for quickly adding payment forms to pages. 120 * Feature: Shortcodes for payment forms have been notably simplified. 121 * Feature: Shipping information can now be captured in the Stripe Checkout overlay. 122 * Feature: Added currency formatting options to settings. 123 * Feature: Payment details can now be edited using the standard post editor. 124 * Feature: Admin bar now indicates if in test mode. 125 * Fix: Removed support for Alipay since it is no longer supported through Stripe Checkout. 126 * Dev: Removed POT file since WordPress has better ways of handling translations now. 127 * Dev: Now using custom post type to hold individual form settings and to match Pro v3 update. 128 * Dev: Add official PHP version requirement check from wordpress.org to readme.txt header. 129 * Dev: Tested up to WordPress 4.8. 130 * Dev: Updated to Stripe PHP library v5.2.0. 98 131 99 132 = 1.6.0 - March 29, 2017 = … … 346 379 347 380 * Initial release. 381 382 == Upgrade Notice == 383 384 = 2.0.0 = 385 386 The payment form builder has been completely redone, but should be much simpler. 387 388 Your existing payment forms using the legacy <code>[stripe]</code> shortcode should continue to work, but it is highly recommended to use the new settings going forward. -
stripe/trunk/uninstall.php
r1516951 r1725154 1 1 <?php 2 2 3 /** 4 * Fired when the plugin is uninstalled. 5 */ 6 7 // If uninstall, not called from WordPress, then exit. 3 // Exit if not uninstalling from WordPress. 8 4 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 9 5 exit; 10 6 } 11 7 8 global $wpdb; 9 10 $general = get_option( 'simpay_settings_general' ); 11 12 // Check save settings option before removing everything 13 if ( ! isset( $general['general_misc']['save_settings'] ) ) { 14 15 16 // First remove the payment confirmation pages 17 $success_page = $general['general']['success_page']; 18 $failure_page = $general['general']['failure_page']; 19 20 wp_delete_post( $success_page, true ); 21 wp_delete_post( $failure_page, true ); 22 23 // Remove main options 24 delete_option( 'simpay_settings' ); 25 26 // Remove misc options 27 delete_option( 'simpay_dismiss_ssl' ); 28 delete_option( 'simpay_preview_form_id' ); 29 30 // Remove settings options 31 delete_option( 'simpay_settings_general' ); 32 delete_option( 'simpay_settings_keys' ); 33 delete_option( 'simpay_settings_display' ); 34 delete_option( 'simpay_settings_shipping_billing' ); 35 36 // Delete form posts. 37 $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'simple-pay' );" ); 38 39 // Delete forms postmeta. 40 $wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;" ); 41 42 } 43 44 // Check if we need to remove legacy settings 12 45 $settings = get_option( 'sc_settings' ); 13 46 -
stripe/trunk/vendor/stripe/stripe-php/CHANGELOG.md
r1625278 r1725154 1 ### 5.2.0 2017-08-29 2 3 * Add support for `InvalidClient` OAuth error 4 5 ### 5.1.3 2017-08-14 6 7 * Allow `address_kana` and `address_kanji` to be updated for custom accounts 8 9 ### 5.1.2 2017-08-01 10 11 * Fix documented return type of `autoPagingIterator()` (was missing namespace) 12 13 ### 5.1.1 2017-07-03 14 15 * Fix order returns to use the right URL `/v1/order_returns` 16 17 ### 5.1.0 2017-06-30 18 19 * Add support for OAuth 20 21 ### 5.0.0 2017-06-27 22 23 * `pay` on invoice now takes params as well as opts 24 25 ### 4.13.0 2017-06-19 26 27 * Add support for ephemeral keys 28 29 ### 4.12.0 2017-06-05 30 31 * Clients can implement `getUserAgentInfo()` to add additional user agent information 32 33 ### 4.11.0 2017-06-05 34 35 * Implement `Countable` for `AttachedObject` (`metadata` and `additional_owners`) 36 37 ### 4.10.0 2017-05-25 38 39 * Add support for login links 40 41 ### 4.9.1 2017-05-10 42 43 * Fix docs to include arrays on `$id` parameter for retrieve methods 44 45 ### 4.9.0 2017-04-28 46 47 * Support for checking webhook signatures 48 49 ### 4.8.1 2017-04-24 50 51 * Allow nested field `payout_schedule` to be updated 52 53 ### 4.8.0 2017-04-20 54 55 * Add `\Stripe\Stripe::setLogger()` to support an external PSR-3 compatible logger 56 57 ### 4.7.0 2017-04-10 58 59 * Add support for payouts and recipient transfers 60 61 ### 4.6.0 2017-04-06 62 63 * Please see 4.7.0 instead (no-op release) 64 1 65 ### 4.5.1 2017-03-22 2 66 -
stripe/trunk/vendor/stripe/stripe-php/README.md
r1625278 r1725154 67 67 ```php 68 68 Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249'); 69 $myCard = array('number' => '4242424242424242', 'exp_month' => 8, 'exp_year' => 2018); 70 $charge = Stripe_Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd')); 69 $charge = Stripe_Charge::create(array('source' => 'tok_XXXXXXXX', 'amount' => 2000, 'currency' => 'usd')); 71 70 echo $charge; 72 71 ``` … … 105 104 106 105 Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See `testDefaultOptions()` in `tests/CurlClientTest.php` for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent. 106 107 ### Configuring a Logger 108 109 The library does minimal logging, but it can be configured 110 with a [`PSR-3` compatible logger][psr3] so that messages 111 end up there instead of `error_log`: 112 113 ```php 114 \Stripe\Stripe::setLogger($logger); 115 ``` 107 116 108 117 ### SSL / TLS compatibility issues … … 152 161 153 162 See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for `CURLOPT_SSLVERSION`: none (default), `CURL_SSLVERSION_TLSv1` and `CURL_SSLVERSION_TLSv1_2`. 163 164 [psr3]: http://www.php-fig.org/psr/psr-3/ -
stripe/trunk/vendor/stripe/stripe-php/VERSION
r1625278 r1725154 1 4.5.1 1 5.2.0 -
stripe/trunk/vendor/stripe/stripe-php/init.php
r1519517 r1725154 6 6 // Utilities 7 7 require(dirname(__FILE__) . '/lib/Util/AutoPagingIterator.php'); 8 require(dirname(__FILE__) . '/lib/Util/LoggerInterface.php'); 9 require(dirname(__FILE__) . '/lib/Util/DefaultLogger.php'); 8 10 require(dirname(__FILE__) . '/lib/Util/RequestOptions.php'); 9 11 require(dirname(__FILE__) . '/lib/Util/Set.php'); … … 23 25 require(dirname(__FILE__) . '/lib/Error/Permission.php'); 24 26 require(dirname(__FILE__) . '/lib/Error/RateLimit.php'); 27 require(dirname(__FILE__) . '/lib/Error/SignatureVerification.php'); 28 29 // OAuth errors 30 require(dirname(__FILE__) . '/lib/Error/OAuth/OAuthBase.php'); 31 require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidClient.php'); 32 require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidGrant.php'); 33 require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidRequest.php'); 34 require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidScope.php'); 35 require(dirname(__FILE__) . '/lib/Error/OAuth/UnsupportedGrantType.php'); 36 require(dirname(__FILE__) . '/lib/Error/OAuth/UnsupportedResponseType.php'); 25 37 26 38 // Plumbing … … 52 64 require(dirname(__FILE__) . '/lib/Customer.php'); 53 65 require(dirname(__FILE__) . '/lib/Dispute.php'); 66 require(dirname(__FILE__) . '/lib/EphemeralKey.php'); 54 67 require(dirname(__FILE__) . '/lib/Event.php'); 55 68 require(dirname(__FILE__) . '/lib/FileUpload.php'); 56 69 require(dirname(__FILE__) . '/lib/Invoice.php'); 57 70 require(dirname(__FILE__) . '/lib/InvoiceItem.php'); 71 require(dirname(__FILE__) . '/lib/LoginLink.php'); 58 72 require(dirname(__FILE__) . '/lib/Order.php'); 59 73 require(dirname(__FILE__) . '/lib/OrderReturn.php'); 74 require(dirname(__FILE__) . '/lib/Payout.php'); 60 75 require(dirname(__FILE__) . '/lib/Plan.php'); 61 76 require(dirname(__FILE__) . '/lib/Product.php'); 62 77 require(dirname(__FILE__) . '/lib/Recipient.php'); 78 require(dirname(__FILE__) . '/lib/RecipientTransfer.php'); 63 79 require(dirname(__FILE__) . '/lib/Refund.php'); 64 80 require(dirname(__FILE__) . '/lib/SKU.php'); … … 70 86 require(dirname(__FILE__) . '/lib/Transfer.php'); 71 87 require(dirname(__FILE__) . '/lib/TransferReversal.php'); 88 89 // OAuth 90 require(dirname(__FILE__) . '/lib/OAuth.php'); 91 92 // Webhooks 93 require(dirname(__FILE__) . '/lib/Webhook.php'); 94 require(dirname(__FILE__) . '/lib/WebhookSignature.php'); -
stripe/trunk/vendor/stripe/stripe-php/lib/Account.php
r1463408 r1725154 22 22 * @property mixed $legal_entity 23 23 * @property bool $managed 24 * @property mixed $payout_schedule 25 * @property mixed $payout_statement_descriptor 26 * @property bool $payouts_enabled 24 27 * @property mixed $product_description 25 28 * @property mixed $statement_descriptor … … 28 31 * @property string $timezone 29 32 * @property mixed $tos_acceptance 30 * @property mixed $transfer_schedule31 * @property bool $transfers_enabled32 33 * @property mixed $verification 33 34 * @property mixed $keys … … 47 48 48 49 /** 49 * @param string|null $id 50 * @param array|string|null $id The ID of the account to retrieve, or an 51 * options array containing an `id` key. 50 52 * @param array|string|null $opts 51 53 * … … 129 131 return self::_all($params, $opts); 130 132 } 133 134 public function deauthorize($clientId = null, $opts = null) 135 { 136 $params = array( 137 'client_id' => $clientId, 138 'stripe_user_id' => $this->id, 139 ); 140 OAuth::deauthorize($params, $opts); 141 } 131 142 } -
stripe/trunk/vendor/stripe/stripe-php/lib/ApiRequestor.php
r1625278 r1725154 85 85 * @throws Error\Api otherwise. 86 86 */ 87 public function handle ApiError($rbody, $rcode, $rheaders, $resp)87 public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) 88 88 { 89 89 if (!is_array($resp) || !isset($resp['error'])) { … … 93 93 } 94 94 95 $error = $resp['error']; 96 $msg = isset($error['message']) ? $error['message'] : null; 97 $param = isset($error['param']) ? $error['param'] : null; 98 $code = isset($error['code']) ? $error['code'] : null; 95 $errorData = $resp['error']; 96 97 $error = null; 98 if (is_string($errorData)) { 99 $error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData); 100 } 101 if (!$error) { 102 $error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData); 103 } 104 105 throw $error; 106 } 107 108 private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) 109 { 110 $msg = isset($errorData['message']) ? $errorData['message'] : null; 111 $param = isset($errorData['param']) ? $errorData['param'] : null; 112 $code = isset($errorData['code']) ? $errorData['code'] : null; 99 113 100 114 switch ($rcode) { … … 103 117 // for API versions earlier than 2015-09-08 104 118 if ($code == 'rate_limit') { 105 thrownew Error\RateLimit($msg, $param, $rcode, $rbody, $resp, $rheaders);119 return new Error\RateLimit($msg, $param, $rcode, $rbody, $resp, $rheaders); 106 120 } 107 121 108 122 // intentional fall-through 109 123 case 404: 110 thrownew Error\InvalidRequest($msg, $param, $rcode, $rbody, $resp, $rheaders);124 return new Error\InvalidRequest($msg, $param, $rcode, $rbody, $resp, $rheaders); 111 125 case 401: 112 thrownew Error\Authentication($msg, $rcode, $rbody, $resp, $rheaders);126 return new Error\Authentication($msg, $rcode, $rbody, $resp, $rheaders); 113 127 case 402: 114 thrownew Error\Card($msg, $param, $code, $rcode, $rbody, $resp, $rheaders);128 return new Error\Card($msg, $param, $code, $rcode, $rbody, $resp, $rheaders); 115 129 case 403: 116 thrownew Error\Permission($msg, $rcode, $rbody, $resp, $rheaders);130 return new Error\Permission($msg, $rcode, $rbody, $resp, $rheaders); 117 131 case 429: 118 thrownew Error\RateLimit($msg, $param, $rcode, $rbody, $resp, $rheaders);132 return new Error\RateLimit($msg, $param, $rcode, $rbody, $resp, $rheaders); 119 133 default: 120 throw new Error\Api($msg, $rcode, $rbody, $resp, $rheaders); 121 } 134 return new Error\Api($msg, $rcode, $rbody, $resp, $rheaders); 135 } 136 } 137 138 private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) 139 { 140 $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; 141 142 switch ($errorCode) { 143 case 'invalid_client': 144 return new Error\OAuth\InvalidClient($errorCode, $description, $rcode, $rbody, $resp, $rheaders); 145 case 'invalid_grant': 146 return new Error\OAuth\InvalidGrant($errorCode, $description, $rcode, $rbody, $resp, $rheaders); 147 case 'invalid_request': 148 return new Error\OAuth\InvalidRequest($errorCode, $description, $rcode, $rbody, $resp, $rheaders); 149 case 'invalid_scope': 150 return new Error\OAuth\InvalidScope($errorCode, $description, $rcode, $rbody, $resp, $rheaders); 151 case 'unsupported_grant_type': 152 return new Error\OAuth\UnsupportedGrantType($errorCode, $description, $rcode, $rbody, $resp, $rheaders); 153 case 'unsupported_response_type': 154 return new Error\OAuth\UnsupportedResponseType($errorCode, $description, $rcode, $rbody, $resp, $rheaders); 155 } 156 157 return null; 122 158 } 123 159 … … 138 174 } 139 175 140 private static function _defaultHeaders($apiKey) 141 { 142 $appInfo = Stripe::getAppInfo(); 143 176 private static function _defaultHeaders($apiKey, $clientInfo = null) 177 { 144 178 $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; 145 179 146 180 $langVersion = phpversion(); 147 181 $uname = php_uname(); 148 149 $httplib = 'unknown';150 $ssllib = 'unknown';151 152 if (function_exists('curl_version')) {153 $curlVersion = curl_version();154 $httplib = 'curl ' . $curlVersion['version'];155 $ssllib = $curlVersion['ssl_version'];156 }157 182 158 183 $appInfo = Stripe::getAppInfo(); … … 163 188 'publisher' => 'stripe', 164 189 'uname' => $uname, 165 'httplib' => $httplib,166 'ssllib' => $ssllib,167 190 ); 191 if ($clientInfo) { 192 $ua = array_merge($clientInfo, $ua); 193 } 168 194 if ($appInfo !== null) { 169 195 $uaString .= ' ' . self::_formatAppInfo($appInfo); … … 194 220 } 195 221 222 // Clients can supply arbitrary additional keys to be included in the 223 // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() 224 // method 225 $clientUAInfo = null; 226 if (method_exists($this->httpClient(), 'getUserAgentInfo')) { 227 $clientUAInfo = $this->httpClient()->getUserAgentInfo(); 228 } 229 196 230 $absUrl = $this->_apiBase.$url; 197 231 $params = self::_encodeObjects($params); 198 $defaultHeaders = $this->_defaultHeaders($myApiKey );232 $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo); 199 233 if (Stripe::$apiVersion) { 200 234 $defaultHeaders['Stripe-Version'] = Stripe::$apiVersion; … … 273 307 274 308 if ($rcode < 200 || $rcode >= 300) { 275 $this->handle ApiError($rbody, $rcode, $rheaders, $resp);309 $this->handleErrorResponse($rbody, $rcode, $rheaders, $resp); 276 310 } 277 311 return $resp; -
stripe/trunk/vendor/stripe/stripe-php/lib/ApiResource.php
r1625278 r1725154 100 100 . "method calls. (HINT: an example call to create a charge " 101 101 . "would be: \"Stripe\\Charge::create(array('amount' => 100, " 102 . "'currency' => 'usd', 'card' => array('number' => " 103 . "4242424242424242, 'exp_month' => 5, 'exp_year' => 2015)))\")"; 102 . "'currency' => 'usd', 'source' => 'tok_1234'))\")"; 104 103 throw new Error\Api($message); 105 104 } -
stripe/trunk/vendor/stripe/stripe-php/lib/ApplePayDomain.php
r1516951 r1725154 21 21 22 22 /** 23 * @param string $id The ID of the domain to retrieve. 23 * @param array|string $id The ID of the domain to retrieve, or an options 24 * array containing an `id` key. 24 25 * @param array|string|null $opts 25 26 * -
stripe/trunk/vendor/stripe/stripe-php/lib/ApplicationFee.php
r1463408 r1725154 22 22 23 23 /** 24 * @param string $id The ID of the application fee to retrieve. 24 * @param array|string $id The ID of the application fee to retrieve, or an 25 * options array containing an `id` key. 25 26 * @param array|string|null $opts 26 27 * -
stripe/trunk/vendor/stripe/stripe-php/lib/AttachedObject.php
r1463408 r1725154 2 2 3 3 namespace Stripe; 4 5 use Countable; 4 6 5 7 /** … … 10 12 * @package Stripe 11 13 */ 12 class AttachedObject extends StripeObject 14 class AttachedObject extends StripeObject implements Countable 13 15 { 14 16 /** … … 29 31 } 30 32 } 33 34 /** 35 * Counts the number of elements in the AttachedObject instance. 36 * 37 * @return int the number of elements 38 */ 39 public function count() 40 { 41 return count($this->_values); 42 } 31 43 } -
stripe/trunk/vendor/stripe/stripe-php/lib/BalanceTransaction.php
r1463408 r1725154 35 35 36 36 /** 37 * @param string $id The ID of the balance transaction to retrieve. 37 * @param array|string $id The ID of the balance transaction to retrieve, 38 * or an options array containing an `id` key. 38 39 * @param array|string|null $opts 39 40 * -
stripe/trunk/vendor/stripe/stripe-php/lib/BitcoinReceiver.php
r1463408 r1725154 38 38 39 39 /** 40 * @param string $id The ID of the Bitcoin Receiver to retrieve. 40 * @param array|string $id The ID of the bitcoin receiver to retrieve, or 41 * an options array containing an `id` key. 41 42 * @param array|string|null $opts 42 43 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Charge.php
r1625278 r1725154 42 42 { 43 43 /** 44 * @param string $id The ID of the charge to retrieve. 44 * @param array|string $id The ID of the charge to retrieve, or an options 45 * array containing an `id` key. 45 46 * @param array|string|null $options 46 47 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Collection.php
r1519517 r1725154 57 57 58 58 /** 59 * @return AutoPagingIterator An iterator that can be used to iterate59 * @return Util\AutoPagingIterator An iterator that can be used to iterate 60 60 * across all objects across all pages. As page boundaries are 61 61 * encountered, the next page will be fetched automatically for -
stripe/trunk/vendor/stripe/stripe-php/lib/CountrySpec.php
r1463408 r1725154 22 22 23 23 /** 24 * @param string $country The ISO country code of the country we retrieve the CountrySpec for. 24 * @param array|string $country The ISO country code of the country we 25 * retrieve the country specfication for, or an options array 26 * containing an `id` containing that code. 25 27 * @param array|string|null $opts 26 28 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Coupon.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the coupon to retrieve. 13 * @param array|string $id The ID of the coupon to retrieve, or an options 14 * array containing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Customer.php
r1463408 r1725154 28 28 { 29 29 /** 30 * @param string $id The ID of the customer to retrieve. 30 * @param array|string $id The ID of the customer to retrieve, or an 31 * options array containing an `id` key. 31 32 * @param array|string|null $opts 32 33 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Dispute.php
r1463408 r1725154 26 26 { 27 27 /** 28 * @param string $id The ID of the dispute to retrieve. 28 * @param array|string $id The ID of the dispute to retrieve, or an options 29 * array containing an `id` key. 29 30 * @param array|string|null $options 30 31 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Event.php
r1463408 r1725154 21 21 { 22 22 /** 23 * @param string $id The ID of the event to retrieve. 23 * @param array|string $id The ID of the event to retrieve, or an options 24 * array containing an `id` key. 24 25 * @param array|string|null $opts 25 26 * -
stripe/trunk/vendor/stripe/stripe-php/lib/FileUpload.php
r1463408 r1725154 28 28 29 29 /** 30 * @param string $id The ID of the file upload to retrieve. 30 * @param array|string $id The ID of the file upload to retrieve, or an 31 * options array containing an `id key. 31 32 * @param array|string|null $opts 32 33 * -
stripe/trunk/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php
r1365533 r1725154 12 12 * @param boolean $hasFile Whether or not $params references a file (via an @ prefix or 13 13 * CurlFile) 14 * @throws Error\Api &Error\ApiConnection14 * @throws \Stripe\Error\Api & \Stripe\Error\ApiConnection 15 15 * @return array($rawBody, $httpStatusCode, $httpHeader) 16 16 */ -
stripe/trunk/vendor/stripe/stripe-php/lib/HttpClient/CurlClient.php
r1516951 r1725154 36 36 37 37 protected $defaultOptions; 38 39 protected $userAgentInfo; 38 40 39 41 /** … … 53 55 { 54 56 $this->defaultOptions = $defaultOptions; 57 $this->initUserAgentInfo(); 58 } 59 60 public function initUserAgentInfo() 61 { 62 $curlVersion = curl_version(); 63 $this->userAgentInfo = array( 64 'httplib' => 'curl ' . $curlVersion['version'], 65 'ssllib' => $curlVersion['ssl_version'], 66 ); 55 67 } 56 68 … … 58 70 { 59 71 return $this->defaultOptions; 72 } 73 74 public function getUserAgentInfo() 75 { 76 return $this->userAgentInfo; 60 77 } 61 78 … … 115 132 $opts[CURLOPT_HTTPGET] = 1; 116 133 if (count($params) > 0) { 117 $encoded = self::encode($params);134 $encoded = Util\Util::urlEncode($params); 118 135 $absUrl = "$absUrl?$encoded"; 119 136 } 120 137 } elseif ($method == 'post') { 121 138 $opts[CURLOPT_POST] = 1; 122 $opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : self::encode($params);139 $opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::urlEncode($params); 123 140 } elseif ($method == 'delete') { 124 141 $opts[CURLOPT_CUSTOMREQUEST] = 'DELETE'; 125 142 if (count($params) > 0) { 126 $encoded = self::encode($params);143 $encoded = Util\Util::urlEncode($params); 127 144 $absUrl = "$absUrl?$encoded"; 128 145 } … … 239 256 return dirname(__FILE__) . '/../../data/ca-certificates.crt'; 240 257 } 241 242 /**243 * @param array $arr An map of param keys to values.244 * @param string|null $prefix245 *246 * Only public for testability, should not be called outside of CurlClient247 *248 * @return string A querystring, essentially.249 */250 public static function encode($arr, $prefix = null)251 {252 if (!is_array($arr)) {253 return $arr;254 }255 256 $r = array();257 foreach ($arr as $k => $v) {258 if (is_null($v)) {259 continue;260 }261 262 if ($prefix) {263 if ($k !== null && (!is_int($k) || is_array($v))) {264 $k = $prefix."[".$k."]";265 } else {266 $k = $prefix."[]";267 }268 }269 270 if (is_array($v)) {271 $enc = self::encode($v, $k);272 if ($enc) {273 $r[] = $enc;274 }275 } else {276 $r[] = urlencode($k)."=".urlencode($v);277 }278 }279 280 return implode("&", $r);281 }282 258 } -
stripe/trunk/vendor/stripe/stripe-php/lib/Invoice.php
r1463408 r1725154 22 22 23 23 /** 24 * @param string $id The ID of the invoice to retrieve. 24 * @param array|string $id The ID of the invoice to retrieve, or an options 25 * array containing an `id` key. 25 26 * @param array|string|null $opts 26 27 * … … 83 84 * @return Invoice The paid invoice. 84 85 */ 85 public function pay($ opts = null)86 public function pay($params = null, $opts = null) 86 87 { 87 88 $url = $this->instanceUrl() . '/pay'; 88 list($response, $opts) = $this->_request('post', $url, null, $opts);89 list($response, $opts) = $this->_request('post', $url, $params, $opts); 89 90 $this->refreshFrom($response, $opts); 90 91 return $this; -
stripe/trunk/vendor/stripe/stripe-php/lib/InvoiceItem.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the invoice item to retrieve. 13 * @param array|string $id The ID of the invoice item to retrieve, or an 14 * options array containing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Order.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the Order to retrieve. 13 * @param array|string $id The ID of the order to retrieve, or an options 14 * array containing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/OrderReturn.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the OrderReturn to retrieve. 13 * This is a special case because the order returns endpoint has an 14 * underscore in it. The parent `className` function strips underscores. 15 * 16 * @return string The name of the class. 17 */ 18 public static function className() 19 { 20 return 'order_return'; 21 } 22 23 /** 24 * @param array|string $id The ID of the order return to retrieve, or an 25 * options array containing an `id` field. 14 26 * @param array|string|null $opts 15 27 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Plan.php
r1519517 r1725154 24 24 { 25 25 /** 26 * @param string $id The ID of the plan to retrieve. 26 * @param array|string $id The ID of the plan to retrieve, or an options 27 * array containing an `id` key. 27 28 * @param array|string|null $opts 28 29 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Product.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the Product to retrieve. 13 * @param array|string $id The ID of the product to retrieve, or an options 14 * array contianing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Recipient.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the recipient to retrieve. 13 * @param array|string $id The ID of the recipient to retrieve, or an 14 * options array containing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Refund.php
r1463408 r1725154 24 24 25 25 /** 26 * @param string $id The ID of the refund to retrieve. 26 * @param array|string $id The ID of the refund to retrieve, or an options 27 * array containing an `id` key. 27 28 * @param array|string|null $options 28 29 * -
stripe/trunk/vendor/stripe/stripe-php/lib/SKU.php
r1463408 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the SKU to retrieve. 13 * @param array|string $id The ID of the SKU to retrieve, or an options 14 * array containing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Source.php
r1625278 r1725154 11 11 { 12 12 /** 13 * @param string $id The ID of the Source to retrieve. 13 * @param array|string $id The ID of the source to retrieve, or an options 14 * array containing an `id` key. 14 15 * @param array|string|null $opts 15 16 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Stripe.php
r1625278 r1725154 13 13 public static $apiKey; 14 14 15 // @var string The Stripe client_id to be used for Connect requests. 16 public static $clientId; 17 15 18 // @var string The base URL for the Stripe API. 16 19 public static $apiBase = 'https://api.stripe.com'; 20 21 // @var string The base URL for the OAuth API. 22 public static $connectBase = 'https://connect.stripe.com'; 17 23 18 24 // @var string The base URL for the Stripe API uploads endpoint. … … 31 37 public static $appInfo = null; 32 38 33 const VERSION = '4.5.1'; 39 // @var Util\LoggerInterface|null The logger to which the library will 40 // produce messages. 41 public static $logger = null; 42 43 const VERSION = '5.2.0'; 34 44 35 45 /** … … 42 52 43 53 /** 54 * @return string The client_id used for Connect requests. 55 */ 56 public static function getClientId() 57 { 58 return self::$clientId; 59 } 60 61 /** 62 * @return Util\LoggerInterface The logger to which the library will 63 * produce messages. 64 */ 65 public static function getLogger() 66 { 67 if (self::$logger == null) { 68 return new Util\DefaultLogger(); 69 } 70 return self::$logger; 71 } 72 73 /** 74 * @param Util\LoggerInterface $logger The logger to which the library 75 * will produce messages. 76 */ 77 public static function setLogger($logger) 78 { 79 self::$logger = $logger; 80 } 81 82 /** 44 83 * Sets the API key to be used for requests. 45 84 * … … 49 88 { 50 89 self::$apiKey = $apiKey; 90 } 91 92 /** 93 * Sets the client_id to be used for Connect requests. 94 * 95 * @param string $clientId 96 */ 97 public static function setClientId($clientId) 98 { 99 self::$clientId = $clientId; 51 100 } 52 101 -
stripe/trunk/vendor/stripe/stripe-php/lib/StripeObject.php
r1625278 r1725154 28 28 self::$permanentAttributes = new Util\Set(array('_opts', 'id')); 29 29 self::$nestedUpdatableAttributes = new Util\Set(array( 30 'metadata', 'legal_entity', 'address', 'dob', ' transfer_schedule', 'verification',31 'tos_acceptance', 'personal_address', 30 'metadata', 'legal_entity', 'address', 'dob', 'payout_schedule', 'transfer_schedule', 'verification', 31 'tos_acceptance', 'personal_address', 'address_kana', 'address_kanji', 32 32 // will make the array into an AttachedObject: weird, but works for now 33 33 'additional_owners', 0, 1, 2, 3, 4, // Max 3, but leave the 4th so errors work properly … … 132 132 . "probably as a result of a save(). The attributes currently " 133 133 . "available on this object are: $attrs"; 134 error_log($message);134 Stripe::getLogger()->error($message); 135 135 return $nullval; 136 136 } else { 137 137 $class = get_class($this); 138 error_log("Stripe Notice: Undefined property of $class instance: $k");138 Stripe::getLogger()->error("Stripe Notice: Undefined property of $class instance: $k"); 139 139 return $nullval; 140 140 } -
stripe/trunk/vendor/stripe/stripe-php/lib/Subscription.php
r1463408 r1725154 22 22 23 23 /** 24 * @param string $id The ID of the subscription to retrieve. 24 * @param array|string $id The ID of the subscription to retrieve, or an 25 * options array containing an `id` key. 25 26 * @param array|string|null $opts 26 27 * -
stripe/trunk/vendor/stripe/stripe-php/lib/SubscriptionItem.php
r1516951 r1725154 22 22 23 23 /** 24 * @param string $id The ID of the subscription item to retrieve. 24 * @param array|string $id The ID of the subscription item to retrieve, or 25 * an options array containing an `id` key. 25 26 * @param array|string|null $opts 26 27 * -
stripe/trunk/vendor/stripe/stripe-php/lib/ThreeDSecure.php
r1549989 r1725154 14 14 15 15 /** 16 * @param string $id The ID of the 3DS auth to retrieve. 16 * @param array|string $id The ID of the 3DS auth to retrieve, or an 17 * options array contianing an `id` key. 17 18 * @param array|string|null $options 18 19 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Token.php
r1463408 r1725154 21 21 { 22 22 /** 23 * @param string $id The ID of the token to retrieve. 23 * @param array|string $id The ID of the token to retrieve, or an options 24 * array containing an `id` key. 24 25 * @param array|string|null $opts 25 26 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Transfer.php
r1463408 r1725154 10 10 * @property int $amount 11 11 * @property int $amount_reversed 12 * @property mixed $application_fee13 12 * @property string $balance_transaction 14 13 * @property int $created 15 14 * @property string $currency 16 15 * @property int $date 17 * @property mixed $description18 16 * @property mixed $destination 19 17 * @property mixed $destination_payment 20 * @property mixed $failure_code21 * @property mixed $failure_message22 * @property mixed $fraud_details23 * @property mixed $invoice24 18 * @property bool $livemode 25 19 * @property mixed $metadata 26 * @property mixed $recipient27 20 * @property mixed $reversals 28 21 * @property bool $reversed 29 22 * @property mixed $source_transaction 30 * @property string $source_type31 * @property mixed $statement_descriptor32 * @property string $status33 * @property string $type34 23 * 35 24 * @package Stripe … … 38 27 { 39 28 /** 40 * @param string $id The ID of the transfer to retrieve. 29 * @param array|string $id The ID of the transfer to retrieve, or an 30 * options array containing an `id` key. 41 31 * @param array|string|null $opts 42 32 * -
stripe/trunk/vendor/stripe/stripe-php/lib/Util/Util.php
r1519517 r1725154 8 8 { 9 9 private static $isMbstringAvailable = null; 10 private static $isHashEqualsAvailable = null; 10 11 11 12 /** … … 76 77 'customer' => 'Stripe\\Customer', 77 78 'dispute' => 'Stripe\\Dispute', 79 'ephemeral_key' => 'Stripe\\EphemeralKey', 78 80 'list' => 'Stripe\\Collection', 81 'login_link' => 'Stripe\\LoginLink', 79 82 'invoice' => 'Stripe\\Invoice', 80 83 'invoiceitem' => 'Stripe\\InvoiceItem', … … 86 89 'order' => 'Stripe\\Order', 87 90 'order_return' => 'Stripe\\OrderReturn', 91 'payout' => 'Stripe\\Payout', 88 92 'plan' => 'Stripe\\Plan', 89 93 'product' => 'Stripe\\Product', 90 94 'recipient' => 'Stripe\\Recipient', 95 'recipient_transfer' => 'Stripe\\RecipientTransfer', 91 96 'refund' => 'Stripe\\Refund', 92 97 'sku' => 'Stripe\\SKU', … … 142 147 } 143 148 } 149 150 /** 151 * Compares two strings for equality. The time taken is independent of the 152 * number of characters that match. 153 * 154 * @param string $a one of the strings to compare. 155 * @param string $b the other string to compare. 156 * @return bool true if the strings are equal, false otherwise. 157 */ 158 public static function secureCompare($a, $b) 159 { 160 if (self::$isHashEqualsAvailable === null) { 161 self::$isHashEqualsAvailable = function_exists('hash_equals'); 162 } 163 164 if (self::$isHashEqualsAvailable) { 165 return hash_equals($a, $b); 166 } else { 167 if (strlen($a) != strlen($b)) { 168 return false; 169 } 170 171 $result = 0; 172 for ($i = 0; $i < strlen($a); $i++) { 173 $result |= ord($a[$i]) ^ ord($b[$i]); 174 } 175 return ($result == 0); 176 } 177 } 178 179 /** 180 * @param array $arr A map of param keys to values. 181 * @param string|null $prefix 182 * 183 * @return string A querystring, essentially. 184 */ 185 public static function urlEncode($arr, $prefix = null) 186 { 187 if (!is_array($arr)) { 188 return $arr; 189 } 190 191 $r = array(); 192 foreach ($arr as $k => $v) { 193 if (is_null($v)) { 194 continue; 195 } 196 197 if ($prefix) { 198 if ($k !== null && (!is_int($k) || is_array($v))) { 199 $k = $prefix."[".$k."]"; 200 } else { 201 $k = $prefix."[]"; 202 } 203 } 204 205 if (is_array($v)) { 206 $enc = self::urlEncode($v, $k); 207 if ($enc) { 208 $r[] = $enc; 209 } 210 } else { 211 $r[] = urlencode($k)."=".urlencode($v); 212 } 213 } 214 215 return implode("&", $r); 216 } 144 217 } -
stripe/trunk/vendor/stripe/stripe-php/tests/AccountTest.php
r1463408 r1725154 296 296 $account->legal_entity->additional_owners[1] = array('first_name' => 'Jane'); 297 297 $account->save(); 298 $this->assertSame(2, count($account->legal_entity->additional_owners)); 298 299 $this->assertSame('Jane', $account->legal_entity->additional_owners[1]->first_name); 299 300 } 301 302 public function testLoginLinkCreation() 303 { 304 $accountId = 'acct_EXPRESS'; 305 $mockExpress = array( 306 'id' => $accountId, 307 'object' => 'account', 308 'login_links' => array( 309 'object' => 'list', 310 'data' => array(), 311 'has_more' => false, 312 'url' => "/v1/accounts/$accountId/login_links" 313 ) 314 ); 315 316 $this->mockRequest('GET', "/v1/accounts/$accountId", array(), $mockExpress); 317 318 $mockLoginLink = array( 319 'object' => 'login_link', 320 'created' => 1493820886, 321 'url' => "https://connect.stripe.com/$accountId/AAAAAAAA" 322 ); 323 324 $this->mockRequest('POST', "/v1/accounts/$accountId/login_links", array(), $mockLoginLink); 325 326 $account = Account::retrieve($accountId); 327 $loginLink = $account->login_links->create(); 328 $this->assertSame('login_link', $loginLink->object); 329 $this->assertSame('Stripe\LoginLink', get_class($loginLink)); 330 } 331 332 public function testDeauthorize() 333 { 334 Stripe::setClientId('ca_test'); 335 336 $accountId = 'acct_test_deauth'; 337 $mockAccount = array( 338 'id' => $accountId, 339 'object' => 'account', 340 ); 341 342 $this->mockRequest('GET', "/v1/accounts/$accountId", array(), $mockAccount); 343 344 $this->mockRequest( 345 'POST', 346 '/oauth/deauthorize', 347 array( 348 'client_id' => 'ca_test', 349 'stripe_user_id' => $accountId, 350 ), 351 array( 352 'stripe_user_id' => $accountId, 353 ), 354 200, 355 Stripe::$connectBase 356 ); 357 358 $account = Account::retrieve($accountId); 359 $account->deauthorize(); 360 361 Stripe::setClientId(null); 362 } 300 363 } -
stripe/trunk/vendor/stripe/stripe-php/tests/ApiRequestorTest.php
r1495935 r1725154 51 51 Stripe::setAppInfo('MyTestApp', '1.2.34', 'https://mytestapp.example'); 52 52 $apiKey = 'sk_test_notarealkey'; 53 54 $headers = $method->invoke(null, $apiKey); 53 $clientInfo = array('httplib' => 'testlib 0.1.2'); 54 55 $headers = $method->invoke(null, $apiKey, $clientInfo); 55 56 56 57 $ua = json_decode($headers['X-Stripe-Client-User-Agent']); … … 59 60 $this->assertSame($ua->application->url, 'https://mytestapp.example'); 60 61 62 $this->assertSame($ua->httplib, 'testlib 0.1.2'); 63 61 64 $this->assertSame( 62 65 $headers['User-Agent'], … … 66 69 $this->assertSame($headers['Authorization'], 'Bearer ' . $apiKey); 67 70 } 71 72 public function testErrorInvalidRequest() 73 { 74 $this->mockRequest( 75 'POST', 76 '/v1/charges', 77 array(), 78 array( 79 'error' => array( 80 'type' => 'invalid_request_error', 81 'message' => 'Missing id', 82 'param' => 'id', 83 ), 84 ), 85 400 86 ); 87 88 try { 89 Charge::create(); 90 $this->fail("Did not raise error"); 91 } catch (Error\InvalidRequest $e) { 92 $this->assertSame('Missing id', $e->getMessage()); 93 $this->assertSame('id', $e->getStripeParam()); 94 } catch (\Exception $e) { 95 $this->fail("Unexpected exception: " . get_class($e)); 96 } 97 } 98 99 public function testErrorAuthentication() 100 { 101 $this->mockRequest( 102 'POST', 103 '/v1/charges', 104 array(), 105 array( 106 'error' => array( 107 'type' => 'invalid_request_error', 108 'message' => 'You did not provide an API key.', 109 ), 110 ), 111 401 112 ); 113 114 try { 115 Charge::create(); 116 $this->fail("Did not raise error"); 117 } catch (Error\Authentication $e) { 118 $this->assertSame('You did not provide an API key.', $e->getMessage()); 119 } catch (\Exception $e) { 120 $this->fail("Unexpected exception: " . get_class($e)); 121 } 122 } 123 124 public function testErrorCard() 125 { 126 $this->mockRequest( 127 'POST', 128 '/v1/charges', 129 array(), 130 array( 131 'error' => array( 132 'type' => 'card_error', 133 'message' => 'Your card was declined.', 134 'code' => 'card_declined', 135 'decline_code' => 'generic_decline', 136 'charge' => 'ch_declined_charge', 137 ), 138 ), 139 402 140 ); 141 142 try { 143 Charge::create(); 144 $this->fail("Did not raise error"); 145 } catch (Error\Card $e) { 146 $this->assertSame('Your card was declined.', $e->getMessage()); 147 $this->assertSame('card_declined', $e->getStripeCode()); 148 $this->assertSame('generic_decline', $e->getDeclineCode()); 149 } catch (\Exception $e) { 150 $this->fail("Unexpected exception: " . get_class($e)); 151 } 152 } 153 154 public function testErrorOAuthInvalidRequest() 155 { 156 $this->mockRequest( 157 'POST', 158 '/oauth/token', 159 array(), 160 array( 161 'error' => 'invalid_request', 162 'error_description' => 'No grant type specified', 163 ), 164 400, 165 Stripe::$connectBase 166 ); 167 168 try { 169 OAuth::token(); 170 $this->fail("Did not raise error"); 171 } catch (Error\OAuth\InvalidRequest $e) { 172 $this->assertSame('invalid_request', $e->getErrorCode()); 173 $this->assertSame('No grant type specified', $e->getMessage()); 174 } catch (\Exception $e) { 175 $this->fail("Unexpected exception: " . get_class($e)); 176 } 177 } 178 179 public function testErrorOAuthInvalidClient() 180 { 181 $this->mockRequest( 182 'POST', 183 '/oauth/token', 184 array(), 185 array( 186 'error' => 'invalid_client', 187 'error_description' => 'No authentication was provided. Send your secret API key using the Authorization header, or as a client_secret POST parameter.', 188 ), 189 401, 190 Stripe::$connectBase 191 ); 192 193 try { 194 OAuth::token(); 195 $this->fail("Did not raise error"); 196 } catch (Error\OAuth\InvalidClient $e) { 197 $this->assertSame('invalid_client', $e->getErrorCode()); 198 $this->assertSame('No authentication was provided. Send your secret API key using the Authorization header, or as a client_secret POST parameter.', $e->getMessage()); 199 } catch (\Exception $e) { 200 $this->fail("Unexpected exception: " . get_class($e)); 201 } 202 } 203 204 public function testErrorOAuthInvalidGrant() 205 { 206 $this->mockRequest( 207 'POST', 208 '/oauth/token', 209 array(), 210 array( 211 'error' => 'invalid_grant', 212 'error_description' => 'This authorization code has already been used. All tokens issued with this code have been revoked.', 213 ), 214 400, 215 Stripe::$connectBase 216 ); 217 218 try { 219 OAuth::token(); 220 $this->fail("Did not raise error"); 221 } catch (Error\OAuth\InvalidGrant $e) { 222 $this->assertSame('invalid_grant', $e->getErrorCode()); 223 $this->assertSame('This authorization code has already been used. All tokens issued with this code have been revoked.', $e->getMessage()); 224 } catch (\Exception $e) { 225 $this->fail("Unexpected exception: " . get_class($e)); 226 } 227 } 68 228 } -
stripe/trunk/vendor/stripe/stripe-php/tests/CardErrorTest.php
r1625278 r1725154 9 9 self::authorizeFromEnv(); 10 10 11 $card = array(12 'number' => '4000000000000002',13 'exp_month' => '3',14 'exp_year' => '2020'15 );16 17 11 $charge = array( 18 12 'amount' => 100, 19 13 'currency' => 'usd', 20 ' card' => $card14 'source' => 'tok_chargeDeclined' 21 15 ); 22 16 -
stripe/trunk/vendor/stripe/stripe-php/tests/ChargeTest.php
r1365533 r1725154 16 16 self::authorizeFromEnv(); 17 17 18 $card = array(19 'number' => '4242424242424242',20 'exp_month' => 5,21 'exp_year' => date('Y') + 122 );23 24 18 $c = Charge::create( 25 19 array( 26 20 'amount' => 100, 27 21 'currency' => 'usd', 28 'card' => $card22 'card' => 'tok_visa' 29 23 ) 30 24 ); … … 37 31 self::authorizeFromEnv(); 38 32 39 $card = array(40 'number' => '4242424242424242',41 'exp_month' => 5,42 'exp_year' => date('Y') + 143 );44 45 33 $c = Charge::create( 46 34 array( 47 35 'amount' => 100, 48 36 'currency' => 'usd', 49 'card' => $card37 'card' => 'tok_visa' 50 38 ), 51 39 array( … … 62 50 self::authorizeFromEnv(); 63 51 64 $card = array(65 'number' => '4242424242424242',66 'exp_month' => 5,67 'exp_year' => date('Y') + 168 );69 70 52 $c = Charge::create( 71 53 array( 72 54 'amount' => 100, 73 55 'currency' => 'usd', 74 'card' => $card56 'card' => 'tok_visa' 75 57 ) 76 58 ); … … 84 66 self::authorizeFromEnv(); 85 67 86 $card = array(87 'number' => '4242424242424242',88 'exp_month' => 5,89 'exp_year' => date('Y') + 190 );91 92 68 $charge = Charge::create( 93 69 array( 94 70 'amount' => 100, 95 71 'currency' => 'usd', 96 'card' => $card72 'card' => 'tok_visa' 97 73 ) 98 74 ); … … 109 85 self::authorizeFromEnv(); 110 86 111 $card = array(112 'number' => '4242424242424242',113 'exp_month' => 5,114 'exp_year' => date('Y') + 1115 );116 117 87 $charge = Charge::create( 118 88 array( 119 89 'amount' => 100, 120 90 'currency' => 'usd', 121 'card' => $card91 'card' => 'tok_visa' 122 92 ) 123 93 ); … … 135 105 self::authorizeFromEnv(); 136 106 137 $card = array(138 'number' => '4242424242424242',139 'exp_month' => 5,140 'exp_year' => date('Y') + 1141 );142 143 107 $charge = Charge::create( 144 108 array( 145 109 'amount' => 100, 146 110 'currency' => 'usd', 147 'card' => $card111 'card' => 'tok_visa' 148 112 ) 149 113 ); … … 183 147 self::authorizeFromEnv(); 184 148 185 $card = array(186 'number' => '4242424242424242',187 'exp_month' => 5,188 'exp_year' => date('Y') + 1189 );190 191 149 $charge = Charge::create( 192 150 array( 193 151 'amount' => 100, 194 152 'currency' => 'usd', 195 'card' => $card153 'card' => 'tok_visa' 196 154 ) 197 155 ); -
stripe/trunk/vendor/stripe/stripe-php/tests/CurlClientTest.php
r1516951 r1725154 22 22 $this->assertSame(0, $curl->getTimeout()); 23 23 $this->assertSame(0, $curl->getConnectTimeout()); 24 } 25 26 public function testUserAgentInfo() 27 { 28 $curl = new CurlClient(); 29 $uaInfo = $curl->getUserAgentInfo(); 30 $this->assertNotNull($uaInfo); 31 $this->assertNotNull($uaInfo['httplib']); 32 $this->assertNotNull($uaInfo['ssllib']); 24 33 } 25 34 … … 49 58 } 50 59 51 public function testEncode()52 {53 $a = array(54 'my' => 'value',55 'that' => array('your' => 'example'),56 'bar' => 1,57 'baz' => null58 );59 60 $enc = CurlClient::encode($a);61 $this->assertSame('my=value&that%5Byour%5D=example&bar=1', $enc);62 63 $a = array('that' => array('your' => 'example', 'foo' => null));64 $enc = CurlClient::encode($a);65 $this->assertSame('that%5Byour%5D=example', $enc);66 67 $a = array('that' => 'example', 'foo' => array('bar', 'baz'));68 $enc = CurlClient::encode($a);69 $this->assertSame('that=example&foo%5B%5D=bar&foo%5B%5D=baz', $enc);70 71 $a = array(72 'my' => 'value',73 'that' => array('your' => array('cheese', 'whiz', null)),74 'bar' => 1,75 'baz' => null76 );77 78 $enc = CurlClient::encode($a);79 $expected = 'my=value&that%5Byour%5D%5B%5D=cheese'80 . '&that%5Byour%5D%5B%5D=whiz&bar=1';81 $this->assertSame($expected, $enc);82 83 // Ignores an empty array84 $enc = CurlClient::encode(array('foo' => array(), 'bar' => 'baz'));85 $expected = 'bar=baz';86 $this->assertSame($expected, $enc);87 88 $a = array('foo' => array(array('bar' => 'baz'), array('bar' => 'bin')));89 $enc = CurlClient::encode($a);90 $this->assertSame('foo%5B0%5D%5Bbar%5D=baz&foo%5B1%5D%5Bbar%5D=bin', $enc);91 }92 93 60 public function testSslOption() 94 61 { -
stripe/trunk/vendor/stripe/stripe-php/tests/CustomerTest.php
r1463408 r1725154 69 69 $customer = self::createTestCustomer(); 70 70 71 $customer->metadata['test'] = 'foo bar'; 72 $customer->save(); 73 74 $updatedCustomer = Customer::retrieve($customer->id); 75 $this->assertSame('foo bar', $updatedCustomer->metadata['test']); 71 $customer->metadata['test1'] = 'foo'; 72 $customer->metadata['test2'] = 'bar'; 73 $customer->save(); 74 75 $updatedCustomer = Customer::retrieve($customer->id); 76 $this->assertSame(2, count($updatedCustomer->metadata)); 77 $this->assertSame('foo', $updatedCustomer->metadata['test1']); 78 $this->assertSame('bar', $updatedCustomer->metadata['test2']); 76 79 } 77 80 … … 84 87 85 88 $updatedCustomer = Customer::retrieve($customer->id); 86 $this->assertSame(0, count($updatedCustomer->metadata ->keys()));89 $this->assertSame(0, count($updatedCustomer->metadata)); 87 90 } 88 91 … … 147 150 public function testCustomerAddCard() 148 151 { 149 $token = Token::create( 150 array("card" => array( 151 "number" => "4242424242424242", 152 "exp_month" => 5, 153 "exp_year" => date('Y') + 3, 154 "cvc" => "314" 155 )) 156 ); 157 158 $customer = $this->createTestCustomer(); 159 $createdCard = $customer->sources->create(array("card" => $token->id)); 152 $customer = $this->createTestCustomer(); 153 $createdCard = $customer->sources->create(array("card" => 'tok_visa')); 160 154 $customer->save(); 161 155 … … 184 178 public function testCustomerDeleteCard() 185 179 { 186 $token = Token::create( 187 array("card" => array( 188 "number" => "4242424242424242", 189 "exp_month" => 5, 190 "exp_year" => date('Y') + 3, 191 "cvc" => "314" 192 )) 193 ); 194 195 $customer = $this->createTestCustomer(); 196 $createdCard = $customer->sources->create(array("card" => $token->id)); 180 $customer = $this->createTestCustomer(); 181 $createdCard = $customer->sources->create(array("card" => 'tok_visa')); 197 182 $customer->save(); 198 183 … … 213 198 { 214 199 self::authorizeFromEnv(); 215 $token = Token::create( 216 array("card" => array( 217 "number" => "4242424242424242", 218 "exp_month" => 5, 219 "exp_year" => date('Y') + 3, 220 "cvc" => "314" 221 )) 222 ); 223 224 $customer = $this->createTestCustomer(); 225 $createdSource = $customer->sources->create(array("source" => $token->id)); 200 201 $customer = $this->createTestCustomer(); 202 $createdSource = $customer->sources->create(array("source" => 'tok_visa')); 226 203 $customer->save(); 227 204 … … 251 228 { 252 229 self::authorizeFromEnv(); 253 $token = Token::create( 254 array("card" => array( 255 "number" => "4242424242424242", 256 "exp_month" => 5, 257 "exp_year" => date('Y') + 3, 258 "cvc" => "314" 259 )) 260 ); 261 262 $customer = $this->createTestCustomer(); 263 $createdSource = $customer->sources->create(array("source" => $token->id)); 230 231 $customer = $this->createTestCustomer(); 232 $createdSource = $customer->sources->create(array("source" => 'tok_visa')); 264 233 $customer->save(); 265 234 -
stripe/trunk/vendor/stripe/stripe-php/tests/DisputeTest.php
r1625278 r1725154 14 14 private function createDisputedCharge() 15 15 { 16 $card = array(17 'number' => '4000000000000259',18 'exp_month' => 5,19 'exp_year' => date('Y') + 120 );21 22 16 $c = Charge::create( 23 17 array( 24 18 'amount' => 100, 25 19 'currency' => 'usd', 26 ' card' => $card20 'source' => 'tok_createDispute' 27 21 ) 28 22 ); -
stripe/trunk/vendor/stripe/stripe-php/tests/InvoiceTest.php
r1625278 r1725154 54 54 $this->assertGreaterThan(0, count($invoices)); 55 55 } 56 57 public function testPay() 58 { 59 $response = array( 60 'id' => 'in_foo', 61 'object' => 'invoice', 62 'paid' => false, 63 ); 64 $this->mockRequest( 65 'GET', 66 '/v1/invoices/in_foo', 67 array(), 68 $response 69 ); 70 71 $response['paid'] = true; 72 $this->mockRequest( 73 'POST', 74 '/v1/invoices/in_foo/pay', 75 array('source' => 'src_bar'), 76 $response 77 ); 78 79 $invoice = Invoice::retrieve('in_foo'); 80 $invoice->pay(array('source' => 'src_bar')); 81 $this->assertTrue($invoice->paid); 82 } 56 83 } -
stripe/trunk/vendor/stripe/stripe-php/tests/ProductTest.php
r1439283 r1725154 143 143 $this->assertSame($order->metadata->foo, "bar"); 144 144 145 $order->pay(array( 146 'source' => array( 147 'object' => 'card', 148 'number' => '4242424242424242', 149 'exp_month' => '05', 150 'exp_year' => '2017' 151 ), 152 )); 145 $order->pay(array('source' => 'tok_visa')); 153 146 $this->assertSame($order->status, 'paid'); 154 147 -
stripe/trunk/vendor/stripe/stripe-php/tests/RecipientTest.php
r1365533 r1725154 37 37 public function testRecipientAddCard() 38 38 { 39 $token = Token::create(40 array("card" => array(41 "number" => "4000056655665556",42 "exp_month" => 5,43 "exp_year" => date('Y') + 3,44 "cvc" => "314"45 ))46 );47 48 39 $recipient = $this->createTestRecipient(); 49 $createdCard = $recipient->cards->create(array("card" => $token->id));40 $createdCard = $recipient->cards->create(array("card" => 'tok_visa_debit')); 50 41 $recipient->save(); 51 42 … … 57 48 public function testRecipientUpdateCard() 58 49 { 59 $token = Token::create(60 array("card" => array(61 "number" => "4000056655665556",62 "exp_month" => 5,63 "exp_year" => date('Y') + 3,64 "cvc" => "314"65 ))66 );67 68 50 $recipient = $this->createTestRecipient(); 69 $createdCard = $recipient->cards->create(array("card" => $token->id));51 $createdCard = $recipient->cards->create(array("card" => 'tok_visa_debit')); 70 52 $recipient->save(); 71 53 … … 84 66 public function testRecipientDeleteCard() 85 67 { 86 $token = Token::create(87 array("card" => array(88 "number" => "4000056655665556",89 "exp_month" => 5,90 "exp_year" => date('Y') + 3,91 "cvc" => "314"92 ))93 );94 95 68 $recipient = $this->createTestRecipient(); 96 $createdCard = $recipient->cards->create(array("card" => $token->id));69 $createdCard = $recipient->cards->create(array("card" => 'tok_visa_debit')); 97 70 $recipient->save(); 98 71 -
stripe/trunk/vendor/stripe/stripe-php/tests/TestCase.php
r1365533 r1725154 26 26 { 27 27 ApiRequestor::setHttpClient(HttpClient\CurlClient::instance()); 28 29 // Peg the API version so that it can be varied independently of the 30 // one set on the test account. 31 Stripe::setApiVersion('2017-04-06'); 32 28 33 $this->mock = null; 29 34 $this->call = 0; 30 35 } 31 36 32 protected function mockRequest($method, $path, $params = array(), $return = array('id' => 'myId'), $rcode = 200 )37 protected function mockRequest($method, $path, $params = array(), $return = array('id' => 'myId'), $rcode = 200, $base = 'https://api.stripe.com') 33 38 { 34 39 $mock = $this->setUpMockRequest(); 35 40 $mock->expects($this->at($this->call++)) 36 41 ->method('request') 37 ->with(strtolower($method), 'https://api.stripe.com'. $path, $this->anything(), $params, false)42 ->with(strtolower($method), $base . $path, $this->anything(), $params, false) 38 43 ->willReturn(array(json_encode($return), $rcode, array())); 39 44 } … … 61 66 'currency' => 'usd', 62 67 'description' => 'Charge for test@example.com', 63 'card' => array( 64 'number' => '4242424242424242', 65 'exp_month' => 5, 66 'exp_year' => date('Y') + 3, 67 ), 68 ) 69 ); 70 } 71 72 /** 73 * Create a valid test charge. 74 */ 75 protected static function createTestTransfer(array $attributes = array()) 68 'card' => 'tok_visa', 69 ) 70 ); 71 } 72 73 /** 74 * Create a valid test transfer. 75 */ 76 protected static function createTestTransfer(array $attributes = array(), $opts = null) 76 77 { 77 78 self::authorizeFromEnv(); … … 85 86 'description' => 'Transfer to test@example.com', 86 87 'recipient' => $recipient->id 87 ) 88 ), 89 $opts 88 90 ); 89 91 } … … 98 100 return Customer::create( 99 101 $attributes + array( 100 'card' => array( 101 'number' => '4242424242424242', 102 'exp_month' => 5, 103 'exp_year' => date('Y') + 3, 104 ), 102 'card' => 'tok_visa', 105 103 ) 106 104 ); … … 120 118 'tax_id' => '000000000', 121 119 'bank_account' => array( 122 'country' => 'US',120 'country' => 'US', 123 121 'routing_number' => '110000000', 124 'account_number' => '000123456789'122 'account_number' => '000123456789' 125 123 ), 126 124 ) … … 140 138 'country' => 'US', 141 139 'email' => self::generateRandomEmail(), 140 ) 141 ); 142 } 143 144 /** 145 * Create a test account 146 */ 147 protected static function createTestManagedAccount(array $attributes = array()) 148 { 149 self::authorizeFromEnv(); 150 151 return Account::create( 152 $attributes + array( 153 'managed' => true, 154 'country' => 'US', 155 'external_account' => array( 156 'object' => 'bank_account', 157 'country' => 'US', 158 'currency' => 'usd', 159 'routing_number' => '110000000', 160 'account_number' => '000123456789' 161 ), 162 'legal_entity' => array( 163 'type' => 'individual', 164 'personal_id_number' => '000000000', 165 'type' => 'individual', 166 'dob' => array('year' => '1980', 'month' => '01', 'day' => '01'), 167 'first_name' => 'John', 168 'last_name' => 'Doe', 169 'address' => array( 170 'line1' => '1234 Main Street', 171 'postal_code' => '94110', 172 'city' => 'San Francisco' 173 ), 174 'personal_address' => array( 175 'line1' => '1234 Main Street', 176 'postal_code' => '94110', 177 'city' => 'San Francisco' 178 ) 179 ), 180 'tos_acceptance' => array('date' => time(), 'ip' => '127.0.0.1') 142 181 ) 143 182 ); … … 189 228 190 229 /** 191 * Gener eate a semi-random string230 * Generate a semi-random string 192 231 */ 193 232 protected static function generateRandomString($length = 24) … … 205 244 * Generate a semi-random email. 206 245 */ 207 protected static function generateRandomEmail( $domain = 'bar.com')208 { 209 return self::generateRandomString().'@'.$domain;246 protected static function generateRandomEmail() 247 { 248 return 'dev-platform-bots+php-'.self::generateRandomString(12).'@stripe.com'; 210 249 } 211 250 -
stripe/trunk/vendor/stripe/stripe-php/tests/TransferReversalTest.php
r1365533 r1725154 5 5 class TransferReversalTest extends TestCase 6 6 { 7 // The resource that was traditionally called "transfer" became a "payout" 8 // in API version 2017-04-06. We're testing traditional transfers here, so 9 // we force the API version just prior anywhere that we need to. 10 private $opts = array('stripe_version' => '2017-02-14'); 7 11 8 12 public function testList() 9 13 { 10 $transfer = self::createTestTransfer( );14 $transfer = self::createTestTransfer(array(), $this->opts); 11 15 $all = $transfer->reversals->all(); 12 16 $this->assertSame(false, $all['has_more']); -
stripe/trunk/vendor/stripe/stripe-php/tests/TransferTest.php
r1365533 r1725154 5 5 class TransferTest extends TestCase 6 6 { 7 // The resource that was traditionally called "transfer" became a "payout" 8 // in API version 2017-04-06. We're testing traditional transfers here, so 9 // we force the API version just prior anywhere that we need to. 10 private $opts = array('stripe_version' => '2017-02-14'); 11 7 12 public function testCreate() 8 13 { 9 $recipient = self::createTestRecipient(); 10 11 self::authorizeFromEnv(); 12 $transfer = Transfer::create(array( 13 'amount' => 100, 14 'currency' => 'usd', 15 'recipient' => $recipient->id 16 )); 17 $this->assertSame('pending', $transfer->status); 14 $transfer = self::createTestTransfer(array(), $this->opts); 15 $this->assertSame('transfer', $transfer->object); 18 16 } 19 17 20 18 public function testRetrieve() 21 19 { 22 $recipient = self::createTestRecipient(); 23 24 self::authorizeFromEnv(); 25 $transfer = Transfer::create(array( 26 'amount' => 100, 27 'currency' => 'usd', 28 'recipient' => $recipient->id 29 )); 30 $reloaded = Transfer::retrieve($transfer->id); 20 $transfer = self::createTestTransfer(array(), $this->opts); 21 $reloaded = Transfer::retrieve($transfer->id, $this->opts); 31 22 $this->assertSame($reloaded->id, $transfer->id); 32 }33 34 /**35 * @expectedException Stripe\Error\InvalidRequest36 */37 public function testCancel()38 {39 $recipient = self::createTestRecipient();40 41 self::authorizeFromEnv();42 $transfer = Transfer::create(array(43 'amount' => 100,44 'currency' => 'usd',45 'recipient' => $recipient->id46 ));47 $reloaded = Transfer::retrieve($transfer->id);48 $this->assertSame($reloaded->id, $transfer->id);49 50 $reloaded->cancel();51 23 } 52 24 53 25 public function testTransferUpdateMetadata() 54 26 { 55 $recipient = self::createTestRecipient(); 56 57 self::authorizeFromEnv(); 58 $transfer = Transfer::create(array( 59 'amount' => 100, 60 'currency' => 'usd', 61 'recipient' => $recipient->id 62 )); 27 $transfer = self::createTestTransfer(array(), $this->opts); 63 28 64 29 $transfer->metadata['test'] = 'foo bar'; 65 30 $transfer->save(); 66 31 67 $updatedTransfer = Transfer::retrieve($transfer->id );32 $updatedTransfer = Transfer::retrieve($transfer->id, $this->opts); 68 33 $this->assertSame('foo bar', $updatedTransfer->metadata['test']); 69 34 } … … 71 36 public function testTransferUpdateMetadataAll() 72 37 { 73 $recipient = self::createTestRecipient(); 74 75 self::authorizeFromEnv(); 76 $transfer = Transfer::create(array( 77 'amount' => 100, 78 'currency' => 'usd', 79 'recipient' => $recipient->id 80 )); 38 $transfer = self::createTestTransfer(array(), $this->opts); 81 39 82 40 $transfer->metadata = array('test' => 'foo bar'); 83 41 $transfer->save(); 84 42 85 $updatedTransfer = Transfer::retrieve($transfer->id );43 $updatedTransfer = Transfer::retrieve($transfer->id, $this->opts); 86 44 $this->assertSame('foo bar', $updatedTransfer->metadata['test']); 87 45 } 88 89 public function testRecipientUpdateMetadata()90 {91 $recipient = self::createTestRecipient();92 93 $recipient->metadata['test'] = 'foo bar';94 $recipient->save();95 96 $updatedRecipient = Recipient::retrieve($recipient->id);97 $this->assertSame('foo bar', $updatedRecipient->metadata['test']);98 }99 100 public function testRecipientUpdateMetadataAll()101 {102 $recipient = self::createTestRecipient();103 104 $recipient->metadata = array('test' => 'foo bar');105 $recipient->save();106 107 $updatedRecipient = Recipient::retrieve($recipient->id);108 $this->assertSame('foo bar', $updatedRecipient->metadata['test']);109 }110 46 } -
stripe/trunk/vendor/stripe/stripe-php/tests/UtilTest.php
r1365533 r1725154 43 43 $this->assertSame(Util\Util::utf8($x), $x); 44 44 } 45 46 public function testUrlEncode() 47 { 48 $a = array( 49 'my' => 'value', 50 'that' => array('your' => 'example'), 51 'bar' => 1, 52 'baz' => null 53 ); 54 55 $enc = Util\Util::urlEncode($a); 56 $this->assertSame('my=value&that%5Byour%5D=example&bar=1', $enc); 57 58 $a = array('that' => array('your' => 'example', 'foo' => null)); 59 $enc = Util\Util::urlEncode($a); 60 $this->assertSame('that%5Byour%5D=example', $enc); 61 62 $a = array('that' => 'example', 'foo' => array('bar', 'baz')); 63 $enc = Util\Util::urlEncode($a); 64 $this->assertSame('that=example&foo%5B%5D=bar&foo%5B%5D=baz', $enc); 65 66 $a = array( 67 'my' => 'value', 68 'that' => array('your' => array('cheese', 'whiz', null)), 69 'bar' => 1, 70 'baz' => null 71 ); 72 73 $enc = Util\Util::urlEncode($a); 74 $expected = 'my=value&that%5Byour%5D%5B%5D=cheese' 75 . '&that%5Byour%5D%5B%5D=whiz&bar=1'; 76 $this->assertSame($expected, $enc); 77 78 // Ignores an empty array 79 $enc = Util\Util::urlEncode(array('foo' => array(), 'bar' => 'baz')); 80 $expected = 'bar=baz'; 81 $this->assertSame($expected, $enc); 82 83 $a = array('foo' => array(array('bar' => 'baz'), array('bar' => 'bin'))); 84 $enc = Util\Util::urlEncode($a); 85 $this->assertSame('foo%5B0%5D%5Bbar%5D=baz&foo%5B1%5D%5Bbar%5D=bin', $enc); 86 } 45 87 }
Note: See TracChangeset
for help on using the changeset viewer.