function presta_internetplus_payer_acte_dist($config, $id_transaction, $transaction_hash) { include_spip('inc/bank'); // verifier que le montant est < 30EUR $montant = sql_getfetsel("montant", "spip_transactions", "id_transaction=" . intval($id_transaction)); if ($montant >= 30) { spip_log("Payer acte transaction #{$id_transaction} : montant non pris en charge " . $montant, "internetplus" . _LOG_INFO_IMPORTANTE); return ""; } $url_payer = wha_url_transaction($id_transaction, $transaction_hash, $config); $contexte = array('id_transaction' => $id_transaction, 'transaction_hash' => $transaction_hash, 'url_payer' => $url_payer, 'logo' => wha_logo_detecte_fai_visiteur(), 'sandbox' => wha_is_sandbox($config) ? ' ' : ''); return recuperer_fond('presta/internetplus/payer/acte', $contexte); }
/** * Determiner l'URL d'appel serveur en fonction de la config * * @param array $config * @return string */ function wha_node_url($config) { // si cette config dispose d'un node specifique, on l'utilise if (isset($config['node']) and $config['node']) { return $config['node']; } $url = ""; if (wha_is_sandbox($config)) { $url = "https://qualif-marchand.w-ha.com"; } else { $url = "https://route.w-ha.com"; } if ($config['type'] == 'abo') { $url .= "/app-bundlepurchase"; } else { $url .= "/app-authorization"; } return $url . "/node"; }
function presta_internetplus_payer_abonnement_dist($config, $id_transaction, $transaction_hash) { include_spip('inc/bank'); // on decrit l'echeance if ($decrire_echeance = charger_fonction("decrire_echeance", "abos", true) and $echeance = $decrire_echeance($id_transaction)) { if ($echeance['montant'] <= 0 or $echeance['montant'] >= 30) { spip_log("Payer abo transaction #{$id_transaction} : montant non pris en charge " . $echeance['montant'], "internetplus_abo" . _LOG_INFO_IMPORTANTE); return false; } if (!isset($echeance['wha_oid']) or !$echeance['wha_oid']) { spip_log("Payer abo transaction #{$id_transaction} : pas de wha_oid dans l'echeance " . var_export($echeance, true), "internetplus_abo" . _LOG_INFO_IMPORTANTE); return false; } // on ne gere pas les subtilites d'abonnements (frequence, count, count_init) // c'est l'offre wha_oid qui les porte eventuellement (dans la mesure de ce qui est possible ches InternetPlus) } else { spip_log("Payer abo transaction #{$id_transaction} : echeance inconnue", "internetplus_abo" . _LOG_ERREUR); return false; } $url_payer = wha_url_abonnement($echeance['wha_oid'], $id_transaction, $config); return recuperer_fond('presta/internetplus/payer/abonnement', array('id_transaction' => $id_transaction, 'transaction_hash' => $transaction_hash, 'url_payer' => $url_payer, 'logo' => wha_logo_detecte_fai_visiteur(), 'sandbox' => wha_is_sandbox($config))); }