Skip to content

Commit

Permalink
Merge pull request #418 from recurly/paypal-logo
Browse files Browse the repository at this point in the history
Adds support for logo assignment in PayPal flow
  • Loading branch information
jpgnotgif authored Jan 16, 2018
2 parents 0bd4242 + 4201b74 commit 617e326
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/recurly/paypal/strategy/direct.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ export class DirectStrategy extends PayPalStrategy {
this.emit('ready');
}

start () {
// TODO: More parameters here
get payload () {
let payload = { description: this.config.display.displayName };
if (this.config.display.amount) payload.amount = this.config.display.amount;
if (this.config.display.logoImageUrl) payload.logoImageUrl = this.config.display.logoImageUrl;
if (this.config.display.headerImageUrl) payload.headerImageUrl = this.config.display.headerImageUrl;
return payload;
}

start () {
const { payload } = this;
const frame = this.recurly.Frame({ path: '/paypal/start', payload });
frame.once('error', cause => this.error('paypal-tokenize-error', { cause }));
frame.once('done', token => this.emit('token', token));
Expand Down
6 changes: 5 additions & 1 deletion lib/recurly/paypal/strategy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const DISPLAY_OPTIONS = [
'shippingAddressOverride',
'shippingAddressEditable',
'billingAgreementDescription',
'landingPageType'
'landingPageType',

// Not compatible with Braintree options due to lack of support
'logoImageUrl',
'headerImageUrl'
];
const DEFAULTS = {
display: {
Expand Down

0 comments on commit 617e326

Please sign in to comment.