Skip to content

Added Header Image Support #55

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

pincombe
Copy link

added Header Image support to PayPal Express Gateway. Supply a link to an image upto 750px x 90px to display using checkout process

…o an image upto 750px x 90px to display using checkout process
@cfreear
Copy link
Contributor

cfreear commented May 1, 2013

Looks like your commit is failing on Travis because you have used tabs instead of spaces for indentation. Omnipay conforms to PSR-2 so if you change each of your tabs to four (4) spaces it should pass.

@pincombe
Copy link
Author

pincombe commented May 1, 2013

I was going to say I didn't know how to push my changes but it seems to have done it automatically. Sorry i'm a terrible at contributing. Hopefully i'll get better with more experience.

@cfreear
Copy link
Contributor

cfreear commented May 1, 2013

Haha no worries, Omnipay is the first project I've contributed to so it's been a learning curve for me too!

Looks like Travis is failing now because you have moved your get/set encapsulation methods from PayPal\Message\AbstractRequest to PayPal\ExpressGateway but you are using $this->getHeaderImage() in ExpressAuthorizeRequest where $this refers to the request object not the gateway object.

Moving it back to AbstractRequest is your best bet as ExpressAuthorizeRequest extends this class.

@pincombe
Copy link
Author

pincombe commented May 1, 2013

Ok i've moved the functions into ExpressAuthorizeRequest they will only be used during that stage of the payment process. Sorry If messing things up. I'm happy to keep changing things until your happy with the changes.

@cfreear
Copy link
Contributor

cfreear commented May 1, 2013

Oops, I'm so sorry, I've just noticed @adrianmacneil asked you to move it to the gateway in your previous pull request #54 so reverting to your previous commit is probably best but in doing that, instead of setting headerImage in your request you will need to set it when you create your gateway in your code that uses Omnipay. Something like:

$gateway = GatewayFactory::create('PayPal_Express');
$gateway->setUsername('test');
//set other gateway parameters like password, landingPage etc.
$gateway->setHeaderImage('http://www.mysite.com/assets/images/headerimage.jpg');

//set $transaction and $card etc.

$response = $gateway->authorize($transaction);

instead of setting it as part of the $transaction array.

Sorry again for messing you around, let me know if any of that isn't clear.

@pincombe
Copy link
Author

pincombe commented May 1, 2013

No its cool man you understand things better than I do. I'll sort that change out and resubmit. :)

@amacneil amacneil closed this in dad0dce May 2, 2013
@pincombe
Copy link
Author

pincombe commented May 2, 2013

Thx for sorting it. Sorry i did such a poor job. Hopefully i'll do better next time :)

@amacneil
Copy link
Member

amacneil commented May 2, 2013

No worries!

barryvdh pushed a commit that referenced this pull request Feb 13, 2016
100% test coverage for AbstractResponse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants