You can use below parameters to customize the iyzico-button and to cover your website requirements.
<!-- You should add mentioned div to the place where the button will be displayed-->
<div id="iyzico-button"></div>
<!-- script source should be added to the page -->
<script src="https://static.iyzipay.com/plugins/v1/iyzico-buttons.min.js"></script>
new iyzico.buttons({
locale: "en_EN",
selector: "#iyzico-button",
buttonType: "pay",
style: {
color: "black",
shape: "rect",
tagline: "logo"
},
form: {
name: "iyzico-refund-form",
action: "/refund-post",
},
onSubmit: function () {
console.log("iyzico button onSubmit");
}
});
It defines the html item that is used for putting iyzico button
Parameter | Type | Default Value | Description |
---|---|---|---|
selector | String | #iyzico-button | Selects the related dom element for showing iyzico-button. It can be a class or id. The value should be unique in the page. |
The texts of a button can be changed with locale parameter
Parameter | Type | Default Value | Description |
---|---|---|---|
locale | String | tr_TR | Changes the language of button. Possible values: "tr_TR", "en_EN" |
It defines action type of button. iyzico buttons can be used for 2 purposes. Payments and Refunds. The button type should be specified according to transaction type. This attribute will basically change the text on the buttons.
Parameter | Type | Default Value | Description |
---|---|---|---|
buttonType | String | pay | Shows the related text based on the transaction type. Possible values: "pay", "refund" |
It helps customizing the visualization
Parameter | Type | Default Value | Description |
---|---|---|---|
color | String | blue | Changes the background color of button: Values: blue, orange, yellow, black |
shape | String | pill | Changes the shape of button: Values: pill, rect |
tagline | String | null | Adds the schemes logos or text under the botton. It can only be used when buttonType is pay. Values: text, logo |
color parameter's values are shown as below(blue, orange, yellow, black)
Value(color) | Type | Display |
---|---|---|
blue | String | ![]() |
orange | String | ![]() |
yellow | String | ![]() |
black | String | ![]() |
shape parameter's values are shown as below(pill, rect)
Value(shape) | Type | Display |
---|---|---|
pill | String | ![]() |
rect | String | ![]() |
tagLine parametresinin değerlere göre gösterimi aşağıdadır (text, logo)
Değer(tagLine) | Tip | Görünüm |
---|---|---|
text | String | ![]() |
logo | String | ![]() |
Changes the form attributes
Parameter | Type | Default Value | Description |
---|---|---|---|
name | String | iyzico-form | Changes the name attribute of the form |
action | String | # | Changes the action attribute of the form |
It helps to take additional actions just before submitting the form.
Parameter | Type | Default Value | Description |
---|---|---|---|
onSubmit | Function | null-form | If added, the functions under this callBack will work automatically |