Exemple #1
0
 $customerData = trim(Configuration::get('GOPAY_CUSTOMER_DATA'));
 if ($customerData == '1') {
     $firstName = $customer->firstname;
     $lastName = $customer->lastname;
     $city = $address->city;
     $street = $address->address1;
     $postalCode = $address->postcode;
     $email = $customer->email;
     $phoneNumber = $address->phone;
     $countryId = $address->id_country;
     $country = new Country($countryId);
     $convertedCountryCode = GopayTools::getConvertedCountryCode($country->iso_code);
 }
 if (isset($order)) {
     // vytvoreni platby
     $paymentSessionId = GopaySoap::createCustomerEshopPayment($goId, $productNameConcat, $amount, $orderId, $successUrl, $failedUrl, $gopaySecret, $paymentChannels, $firstName, $lastName, $city, $street, $postalCode, $convertedCountryCode, $email, $phoneNumber);
     if ($paymentSessionId > 0) {
         $encryptedSignature = GopayHelper::encrypt(GopayHelper::hash(GopayHelper::concatPaymentSession($goId, $paymentSessionId, $gopaySecret)), $gopaySecret);
     } else {
         $gpErrors = 'paymentCreationFailed';
     }
 } else {
     $gpErrors = 'undefinedOrderFaultyState';
 }
 if (empty($gpErrors)) {
     $redirectUrl = "{$gwUrl}?sessionInfo.paymentSessionId={$paymentSessionId}&sessionInfo.eshopGoId={$goId}&sessionInfo.encryptedSignature={$encryptedSignature}";
     if (isset($param)) {
         $redirectUrl .= "{$param}";
     }
     Tools::redirectLink($redirectUrl);
 } else {