diff --git a/lib/recurly/element/element.js b/lib/recurly/element/element.js index eead73297..07c0a0ef8 100644 --- a/lib/recurly/element/element.js +++ b/lib/recurly/element/element.js @@ -347,7 +347,6 @@ export default class Element extends Emitter { */ messageName (name) { return `element:${this.id}:${name}`; - // element:21940812094ankfjankfawfwa:name } /** @@ -409,6 +408,7 @@ export default class Element extends Emitter { this.emit('submit', this); } + // deprecated notifyCoBadgeResult (body) { this.emit('coBadge', { coBadgeSupport: body.coBadgeSupport, supportedBrands: body.supportedBrands }); } diff --git a/packages/public-api-fixture-server/fixtures/tokens/checkout-session-token.json b/packages/public-api-fixture-server/fixtures/tokens/checkout-session-token.json new file mode 100644 index 000000000..2c730f279 --- /dev/null +++ b/packages/public-api-fixture-server/fixtures/tokens/checkout-session-token.json @@ -0,0 +1,288 @@ +{ + "type": "checkout_session", + "id": "ANVq-oGYqYD4Qe5CNbXmvA", + "cancelUrl": null, + "cart": { + "coupons": [], + "currencies": [ + { + "code": "USD" + } + ], + "currency": { + "code": "USD" + }, + "giftCards": [], + "lineItems": [], + "subscriptions": [ + { + "addOns": [], + "planId": "basic", + "quantity": "1", + "quantityMutable": true, + "ephemeralId": "t-k9lRX0Xv7DFyXBThpA8YI" + } + ] + }, + "confirmUrl": "", + "finishUrl": null, + "flags": [ + "accept_coupons" + ], + "iconUrl": null, + "locale": "en-US", + "logoUrl": null, + "paymentMethods": [ + { + "currencies": [ + { + "cardTypes": [ + "american_express", + "discover", + "diners_club", + "master", + "visa", + "jcb", + "union_pay", + "cartes_bancaires" + ], + "code": "USD" + }, + { + "cardTypes": [ + "american_express", + "discover", + "diners_club", + "master", + "visa", + "jcb", + "union_pay", + "elo", + "hipercard" + ], + "code": "BRL" + }, + { + "cardTypes": [ + "american_express", + "discover", + "diners_club", + "master", + "visa", + "jcb", + "union_pay", + "cartes_bancaires", + "bancontact" + ], + "code": "EUR" + }, + { + "cardTypes": [ + "american_express", + "discover", + "diners_club", + "master", + "visa", + "jcb", + "union_pay", + "cartes_bancaires" + ], + "code": "CHF" + } + ], + "gateways": [], + "type": "credit_card" + }, + { + "currencies": [ + { + "cardTypes": [], + "code": "USD" + }, + { + "cardTypes": [], + "code": "BRL" + }, + { + "cardTypes": [], + "code": "EUR" + }, + { + "cardTypes": [], + "code": "CHF" + } + ], + "gateways": [ + { + "code": "stripe-gateway-code", + "type": "stripe", + "credentials": { + "publishableKey": "pk_test_12345" + }, + "currencies": [ + { + "code": "USD" + } + ] + }, + { + "code": "test-adyen-code", + "type": "adyen", + "credentials": { + "clientKey": "test_12345" + }, + "currencies": [ + { + "code": "USD" + }, + { + "code": "BRL" + }, + { + "code": "EUR" + }, + { + "code": "CHF" + } + ] + }, + { + "code": "test-adyen-code", + "type": "adyen", + "credentials": { + "clientKey": "test_12345" + }, + "currencies": [ + { + "code": "USD" + }, + { + "code": "BRL" + }, + { + "code": "EUR" + }, + { + "code": "CHF" + } + ] + } + ], + "type": "apple_pay" + }, + { + "currencies": [ + { + "cardTypes": [], + "code": "USD" + }, + { + "cardTypes": [], + "code": "BRL" + }, + { + "cardTypes": [], + "code": "EUR" + }, + { + "cardTypes": [], + "code": "CHF" + } + ], + "gateways": [], + "type": "google_pay" + }, + { + "currencies": [ + { + "cardTypes": [], + "code": "BRL" + } + ], + "gateways": [ + { + "code": "test-adyen-code", + "type": "adyen", + "credentials": { + "clientKey": "test_12345" + }, + "currencies": [ + { + "code": "BRL" + } + ] + } + ], + "type": "boleto" + }, + { + "currencies": [ + { + "cardTypes": [], + "code": "EUR" + } + ], + "gateways": [ + { + "code": "test-adyen-code", + "type": "adyen", + "credentials": { + "clientKey": "test_12345" + }, + "currencies": [ + { + "code": "EUR" + } + ] + } + ], + "type": "ideal" + }, + { + "currencies": [ + { + "cardTypes": [], + "code": "EUR" + }, + { + "cardTypes": [], + "code": "CHF" + } + ], + "gateways": [ + { + "code": "test-adyen-code", + "type": "adyen", + "credentials": { + "clientKey": "test_12345" + }, + "currencies": [ + { + "code": "EUR" + }, + { + "code": "CHF" + } + ] + } + ], + "type": "sofort" + }, + { + "currencies": [], + "gateways": [], + "type": "bacs" + } + ], + "prefersColorScheme": null, + "primaryColor": "#2676a5", + "site": { + "addressRequirement": "full", + "name": "Test site", + "defaultCurrency": "USD" + }, + "purchases": [], + "privacyPolicyUrl": "", + "tosUrl": "https://recurly.com/legal/terms/", + "updatedAt": "2024-08-28T19:17:11Z" +} diff --git a/packages/public-api-fixture-server/fixtures/tokens/index.js b/packages/public-api-fixture-server/fixtures/tokens/index.js index 878562808..9e35186e5 100644 --- a/packages/public-api-fixture-server/fixtures/tokens/index.js +++ b/packages/public-api-fixture-server/fixtures/tokens/index.js @@ -59,20 +59,20 @@ const CREATE_INVALID = { module.exports = function tokens () { const params = this.method === 'GET' ? this.query : this.request.body; const { type } = params; - let token; if (type === 'iban_bank_account') { - token = IBAN_BANK_ACCOUNT_TOKENS[params.iban]; + return IBAN_BANK_ACCOUNT_TOKENS[params.iban]; } else if (type === 'bacs_bank_account') { - token = BACS_BANK_ACCOUNT_TOKENS[params.account_number]; + return BACS_BANK_ACCOUNT_TOKENS[params.account_number]; } else if (type === 'three_d_secure_action_result') { - token = THREE_D_SECURE_TOKENS[params.three_d_secure_action_token_id]; + return THREE_D_SECURE_TOKENS[params.three_d_secure_action_token_id]; } else if (type === 'becs_bank_account') { - token = BECS_BANK_ACCOUNT_TOKENS[params.account_number]; + return BECS_BANK_ACCOUNT_TOKENS[params.account_number]; } else if ('account_number' in params) { - token = BANK_ACCOUNT_TOKENS[params.account_number]; + return BANK_ACCOUNT_TOKENS[params.account_number]; + } else if (type === 'checkout_session') { + return require('./checkout-session-token.json'); } - if (token) return token; - else return CREATE_INVALID; + return CREATE_INVALID; };