Skip to content

Commit 2bd1b6a

Browse files
authored
Update README.md
Added instruction for customize paypal payment page
1 parent 232b84f commit 2bd1b6a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,34 @@ public function getCancel()
135135
return view('checkout.cancel');
136136
}
137137
```
138+
### Customize Paypal payment page
139+
140+
First we need to create a new WebProfile for obtain the id, then in the future we can simply set this id to the payment object.
141+
142+
```php
143+
public function createWebProfile(){
144+
145+
$flowConfig = PayPal::FlowConfig();
146+
$presentation = PayPal::Presentation();
147+
$inputFields = PayPal::InputFields();
148+
$webProfile = PayPal::WebProfile();
149+
$flowConfig->setLandingPageType("Billing"); //Set the page type
150+
151+
$presentation->setLogoImage("https://www.example.com/images/logo.jpg")->setBrandName("Example ltd"); //NB: Paypal recommended to use https for the logo's address and the size set to 190x60.
152+
153+
$inputFields->setAllowNote(true)->setNoShipping(1)->setAddressOverride(0);
154+
155+
$webProfile->setName("Example " . uniqid())
156+
->setFlowConfig($flowConfig)
157+
// Parameters for style and presentation.
158+
->setPresentation($presentation)
159+
// Parameters for input field customization.
160+
->setInputFields($inputFields);
161+
162+
$createProfileResponse = $webProfile->create($this->_apiContext);
163+
164+
return $createProfileResponse->getId(); //The new webprofile's id
165+
}
166+
```
167+
168+
Now set the WebProfile's id to the payment object `$payment->setExperienceProfileId("XP-ABCD-EFGH-ILMN-OPQR");`

0 commit comments

Comments
 (0)