@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @param string $url an URL |
| 45 | 45 | */ |
| 46 | - public function set_payment_server_url( $url ) { |
|
| 46 | + public function set_payment_server_url($url) { |
|
| 47 | 47 | $this->payment_server_url = $url; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | return $this->merchant_reference; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function set_merchant_reference( $merchant_reference ) { |
|
| 56 | + public function set_merchant_reference($merchant_reference) { |
|
| 57 | 57 | $this->merchant_reference = $merchant_reference; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return $this->payment_amount; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public function set_payment_amount( $payment_amount ) { |
|
| 66 | + public function set_payment_amount($payment_amount) { |
|
| 67 | 67 | $this->payment_amount = $payment_amount; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | return $this->currency_code; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function set_currency_code( $currency_code ) { |
|
| 76 | + public function set_currency_code($currency_code) { |
|
| 77 | 77 | $this->currency_code = $currency_code; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | return $this->ship_before_date; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public function set_ship_before_date( DateTime $date ) { |
|
| 86 | + public function set_ship_before_date(DateTime $date) { |
|
| 87 | 87 | $this->ship_before_date = $date; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | return $this->skin_code; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function set_skin_code( $skin_code ) { |
|
| 96 | + public function set_skin_code($skin_code) { |
|
| 97 | 97 | $this->skin_code = $skin_code; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $this->merchant_account; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - public function set_merchant_account( $merchant_account ) { |
|
| 106 | + public function set_merchant_account($merchant_account) { |
|
| 107 | 107 | $this->merchant_account = $merchant_account; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return $this->shopper_locale; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - public function set_shopper_locale( $shopper_locale ) { |
|
| 116 | + public function set_shopper_locale($shopper_locale) { |
|
| 117 | 117 | $this->shopper_locale = $shopper_locale; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | return $this->order_data; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - public function set_order_data( $order_data ) { |
|
| 126 | + public function set_order_data($order_data) { |
|
| 127 | 127 | $this->order_data = $order_data; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return $this->session_validity; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - public function set_session_validity( DateTime $session_validity = null ) { |
|
| 136 | + public function set_session_validity(DateTime $session_validity = null) { |
|
| 137 | 137 | $this->session_validity = $session_validity; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | return $this->shopper_email; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - public function set_shopper_email( $email ) { |
|
| 146 | + public function set_shopper_email($email) { |
|
| 147 | 147 | $this->shopper_email = $email; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | return $this->shopper_reference; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - public function set_shopper_reference( $reference ) { |
|
| 156 | + public function set_shopper_reference($reference) { |
|
| 157 | 157 | $this->shopper_reference = $reference; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | return $this->shared_secret; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - public function set_shared_secret( $shared_secret ) { |
|
| 166 | + public function set_shared_secret($shared_secret) { |
|
| 167 | 167 | $this->shared_secret = $shared_secret; |
| 168 | 168 | } |
| 169 | 169 | |
@@ -171,20 +171,20 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | public function get_signature() { |
| 173 | 173 | $data = array( |
| 174 | - Pronamic_WP_Util::amount_to_cents( $this->get_payment_amount() ), |
|
| 174 | + Pronamic_WP_Util::amount_to_cents($this->get_payment_amount()), |
|
| 175 | 175 | $this->get_currency_code(), |
| 176 | - Pronamic_WP_Util::format_date( 'Y-m-d', $this->get_ship_before_date() ), |
|
| 176 | + Pronamic_WP_Util::format_date('Y-m-d', $this->get_ship_before_date()), |
|
| 177 | 177 | $this->get_merchant_reference(), |
| 178 | 178 | $this->get_skin_code(), |
| 179 | 179 | $this->get_merchant_account(), |
| 180 | - Pronamic_WP_Util::format_date( DATE_ATOM, $this->get_session_validity() ), |
|
| 180 | + Pronamic_WP_Util::format_date(DATE_ATOM, $this->get_session_validity()), |
|
| 181 | 181 | $this->get_shopper_email(), |
| 182 | 182 | $this->get_shopper_reference(), |
| 183 | 183 | ); |
| 184 | 184 | |
| 185 | - $data = implode( '', $data ); |
|
| 185 | + $data = implode('', $data); |
|
| 186 | 186 | |
| 187 | - $signature = base64_encode( hash_hmac( 'sha1', $data, $this->get_shared_secret(), true ) ); |
|
| 187 | + $signature = base64_encode(hash_hmac('sha1', $data, $this->get_shared_secret(), true)); |
|
| 188 | 188 | |
| 189 | 189 | return $signature; |
| 190 | 190 | } |
@@ -197,19 +197,19 @@ discard block |
||
| 197 | 197 | * @return string |
| 198 | 198 | */ |
| 199 | 199 | public function get_html_fields() { |
| 200 | - return Pronamic_IDeal_IDeal::htmlHiddenFields( array( |
|
| 200 | + return Pronamic_IDeal_IDeal::htmlHiddenFields(array( |
|
| 201 | 201 | Pronamic_Gateways_Adyen_Parameters::MERCHANT_REFERENCE => $this->get_merchant_reference(), |
| 202 | - Pronamic_Gateways_Adyen_Parameters::PAYMENT_AMOUNT => Pronamic_WP_Util::amount_to_cents( $this->get_payment_amount() ), |
|
| 202 | + Pronamic_Gateways_Adyen_Parameters::PAYMENT_AMOUNT => Pronamic_WP_Util::amount_to_cents($this->get_payment_amount()), |
|
| 203 | 203 | Pronamic_Gateways_Adyen_Parameters::CURRENCY_CODE => $this->get_currency_code(), |
| 204 | - Pronamic_Gateways_Adyen_Parameters::SHIP_BEFORE_DATE => Pronamic_WP_Util::format_date( 'Y-m-d', $this->get_ship_before_date() ), |
|
| 204 | + Pronamic_Gateways_Adyen_Parameters::SHIP_BEFORE_DATE => Pronamic_WP_Util::format_date('Y-m-d', $this->get_ship_before_date()), |
|
| 205 | 205 | Pronamic_Gateways_Adyen_Parameters::SKIN_CODE => $this->get_skin_code(), |
| 206 | 206 | Pronamic_Gateways_Adyen_Parameters::MERCHANT_ACCOUNT => $this->get_merchant_account(), |
| 207 | 207 | Pronamic_Gateways_Adyen_Parameters::SHOPPER_LOCALE => $this->get_shopper_locale(), |
| 208 | - Pronamic_Gateways_Adyen_Parameters::ORDER_DATA => base64_encode( gzencode( $this->get_order_data() ) ), |
|
| 209 | - Pronamic_Gateways_Adyen_Parameters::SESSION_VALIDITY => Pronamic_WP_Util::format_date( DATE_ATOM, $this->get_session_validity() ), |
|
| 208 | + Pronamic_Gateways_Adyen_Parameters::ORDER_DATA => base64_encode(gzencode($this->get_order_data())), |
|
| 209 | + Pronamic_Gateways_Adyen_Parameters::SESSION_VALIDITY => Pronamic_WP_Util::format_date(DATE_ATOM, $this->get_session_validity()), |
|
| 210 | 210 | Pronamic_Gateways_Adyen_Parameters::MERCHANT_SIGNATURE => $this->get_signature(), |
| 211 | 211 | Pronamic_Gateways_Adyen_Parameters::SHOPPER_EMAIL => $this->get_shopper_email(), |
| 212 | 212 | Pronamic_Gateways_Adyen_Parameters::SHOPPER_REFERENCE => $this->get_shopper_reference(), |
| 213 | - ) ); |
|
| 213 | + )); |
|
| 214 | 214 | } |
| 215 | 215 | } |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param Pronamic_WP_Pay_GatewayConfig $config |
| 39 | 39 | */ |
| 40 | - public function __construct( Pronamic_WP_Pay_GatewayConfig $config ) { |
|
| 41 | - parent::__construct( $config ); |
|
| 40 | + public function __construct(Pronamic_WP_Pay_GatewayConfig $config) { |
|
| 41 | + parent::__construct($config); |
|
| 42 | 42 | |
| 43 | - $this->set_method( self::METHOD_HTML_FORM ); |
|
| 44 | - $this->set_has_feedback( true ); |
|
| 45 | - $this->set_amount_minimum( 0.01 ); |
|
| 46 | - $this->set_slug( self::SLUG ); |
|
| 43 | + $this->set_method(self::METHOD_HTML_FORM); |
|
| 44 | + $this->set_has_feedback(true); |
|
| 45 | + $this->set_amount_minimum(0.01); |
|
| 46 | + $this->set_slug(self::SLUG); |
|
| 47 | 47 | |
| 48 | 48 | $this->client = new Adyen(); |
| 49 | - $this->client->set_payment_server_url( $config->getPaymentServerUrl() ); |
|
| 50 | - $this->client->set_skin_code( $config->get_buckaroo_skin_code() ); |
|
| 51 | - $this->client->set_merchant_account( $config->get_buckaroo_merchant_account() ); |
|
| 52 | - $this->client->set_shared_secret( $config->get_buckaroo_shared_secret() ); |
|
| 49 | + $this->client->set_payment_server_url($config->getPaymentServerUrl()); |
|
| 50 | + $this->client->set_skin_code($config->get_buckaroo_skin_code()); |
|
| 51 | + $this->client->set_merchant_account($config->get_buckaroo_merchant_account()); |
|
| 52 | + $this->client->set_shared_secret($config->get_buckaroo_shared_secret()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | ///////////////////////////////////////////////// |
@@ -60,19 +60,19 @@ discard block |
||
| 60 | 60 | * @param Pronamic_Pay_Payment $payment |
| 61 | 61 | * @see Pronamic_WP_Pay_Gateway::start() |
| 62 | 62 | */ |
| 63 | - public function start( Pronamic_Pay_Payment $payment ) { |
|
| 64 | - $payment->set_transaction_id( md5( time() . $payment->get_order_id() ) ); |
|
| 65 | - $payment->set_action_url( $this->client->get_payment_server_url() ); |
|
| 63 | + public function start(Pronamic_Pay_Payment $payment) { |
|
| 64 | + $payment->set_transaction_id(md5(time() . $payment->get_order_id())); |
|
| 65 | + $payment->set_action_url($this->client->get_payment_server_url()); |
|
| 66 | 66 | |
| 67 | - $this->client->set_merchant_reference( $payment->get_order_id() ); |
|
| 68 | - $this->client->set_payment_amount( $payment->get_amount() ); |
|
| 69 | - $this->client->set_currency_code( $payment->get_currency() ); |
|
| 70 | - $this->client->set_ship_before_date( new DateTime( '+5 days' ) ); |
|
| 71 | - $this->client->set_shopper_locale( $payment->get_locale() ); |
|
| 72 | - $this->client->set_order_data( $payment->get_description() ); |
|
| 73 | - $this->client->set_session_validity( new DateTime( '+1 hour' ) ); |
|
| 74 | - $this->client->set_shopper_reference( $payment->get_email() ); |
|
| 75 | - $this->client->set_shopper_email( $payment->get_email() ); |
|
| 67 | + $this->client->set_merchant_reference($payment->get_order_id()); |
|
| 68 | + $this->client->set_payment_amount($payment->get_amount()); |
|
| 69 | + $this->client->set_currency_code($payment->get_currency()); |
|
| 70 | + $this->client->set_ship_before_date(new DateTime('+5 days')); |
|
| 71 | + $this->client->set_shopper_locale($payment->get_locale()); |
|
| 72 | + $this->client->set_order_data($payment->get_description()); |
|
| 73 | + $this->client->set_session_validity(new DateTime('+1 hour')); |
|
| 74 | + $this->client->set_shopper_reference($payment->get_email()); |
|
| 75 | + $this->client->set_shopper_email($payment->get_email()); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | ///////////////////////////////////////////////// |