Dzień dobry
Niestety wszystkie tematy na tym forum z pytaniami o integrację z PayU były powiązane z błędem w przekazywaniu danych, a ja mam problem już na samym początku. Raczkuję w PHP od niedawna i nie mam zielonego pojęcia co zrobić z kodem (jak i większością instrukcji) ze strony
http://developers.payu.com/pl/restapi.html#overview.
W punkcie 2.1 napisali "W celu utworzenia nowego zamówienia należy za pomocą metody POST wyśłać komunikat OrderCreateRequest na endpoint /api/v2_1/orders." Czy ktoś mógłby wytłumaczyć na czym polega wysyłanie tego komunikatu? Jest na to jakaś gotowa funkcja?
Dalej nie wiem gdzie wkleić i w jakim rozszerzeniu zapisać (PHP jak myślę) kod:
curl -X POST
<a href="https://secure.payu.com/api/v2_1/orders" target="_blank">https://secure.payu.com/api/v2_1/orders
</a> \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 3e5cac39-7e38-4139-8fd6-30adc06a61bd" \
-d '{
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "145227",
"description": "RTV market",
"currencyCode": "PLN",
"totalAmount": "21000",
"buyer": {
"email": "john.doe@example.com",
"phone": "654111654",
"firstName": "John",
"lastName": "Doe",
"language": "pl"
},
"settings":{
"invoiceDisabled":"true"
},
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "15000",
"quantity": "1"
},
{
"name": "HDMI cable",
"unitPrice": "6000",
"quantity": "1"
}
]
}'
O ile wiem jak uzupełnić podany formularz:
<form method="POST" action="https://secure.payu.com/api/v2_1/orders"> <input type="hidden" name="customerIp" value="123.123.123.123"> <input type="hidden" name="merchantPosId" value="145227"> <input type="hidden" name="description" value="Opis zamówienia"> <input type="hidden" name="totalAmount" value="1000"> <input type="hidden" name="currencyCode" value="PLN"> <input type="hidden" name="products[0].name" value="Produkt 1"> <input type="hidden" name="products[0].unitPrice" value="1000"> <input type="hidden" name="products[0].quantity" value="1"> <input type="hidden" name="notifyUrl" value="http://shop.url/notify"> <input type="hidden" name="continueUrl" value="http://shop.url/continue"> <input type="hidden" name="OpenPayu-Signature" type="hidden" value="sender=145227;algorithm=SHA-256;signature=565f9f4dda43c8e24ccab4472133d680e2aa58e1f58bea845c4cf2926965144d"> <button type="submit" formtarget="_blank">Płacę z PayU
</button>
to nie mam pojęcia co zrobić z tym pierwszym kodem. Czy ktoś już to robił i mógłby pomóc? Z tego co widzę, jest napisane że należy umieścić to w sekcji :body", ale przecież nie umieszczę tego tam tak samo z siebie. Pomógłby ktoś? (IMG:
style_emoticons/default/smile.gif)